| OLD | NEW |
| 1 //===- subzero/src/IceASanInstrumentation.h - AddressSanitizer --*- C++ -*-===// | 1 //===- subzero/src/IceASanInstrumentation.h - AddressSanitizer --*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 ASanInstrumentation(GlobalContext *Ctx) | 36 ASanInstrumentation(GlobalContext *Ctx) |
| 37 : Instrumentation(Ctx), RzNum(0), | 37 : Instrumentation(Ctx), RzNum(0), |
| 38 GlobalsLock(GlobalsMutex, std::defer_lock) { | 38 GlobalsLock(GlobalsMutex, std::defer_lock) { |
| 39 ICE_TLS_INIT_FIELD(LocalDtors); | 39 ICE_TLS_INIT_FIELD(LocalDtors); |
| 40 } | 40 } |
| 41 void instrumentGlobals(VariableDeclarationList &Globals) override; | 41 void instrumentGlobals(VariableDeclarationList &Globals) override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 std::string nextRzName(); | 44 std::string nextRzName(); |
| 45 bool isInstrumentable(Cfg *Func) override; |
| 45 void instrumentFuncStart(LoweringContext &Context) override; | 46 void instrumentFuncStart(LoweringContext &Context) override; |
| 46 void instrumentCall(LoweringContext &Context, InstCall *Instr) override; | 47 void instrumentCall(LoweringContext &Context, InstCall *Instr) override; |
| 47 void instrumentRet(LoweringContext &Context, InstRet *Instr) override; | 48 void instrumentRet(LoweringContext &Context, InstRet *Instr) override; |
| 48 void instrumentLoad(LoweringContext &Context, InstLoad *Instr) override; | 49 void instrumentLoad(LoweringContext &Context, InstLoad *Instr) override; |
| 49 void instrumentStore(LoweringContext &Context, InstStore *Instr) override; | 50 void instrumentStore(LoweringContext &Context, InstStore *Instr) override; |
| 50 void instrumentAccess(LoweringContext &Context, Operand *Op, SizeT Size, | 51 void instrumentAccess(LoweringContext &Context, Operand *Op, SizeT Size, |
| 51 Constant *AccessFunc); | 52 Constant *AccessFunc); |
| 52 void instrumentStart(Cfg *Func) override; | 53 void instrumentStart(Cfg *Func) override; |
| 53 void finishFunc(Cfg *Func) override; | 54 void finishFunc(Cfg *Func) override; |
| 54 ICE_TLS_DECLARE_FIELD(std::vector<InstCall *> *, LocalDtors); | 55 ICE_TLS_DECLARE_FIELD(std::vector<InstCall *> *, LocalDtors); |
| 55 std::atomic<uint32_t> RzNum; | 56 std::atomic<uint32_t> RzNum; |
| 56 bool DidProcessGlobals = false; | 57 bool DidProcessGlobals = false; |
| 57 SizeT RzGlobalsNum = 0; | 58 SizeT RzGlobalsNum = 0; |
| 58 std::mutex GlobalsMutex; | 59 std::mutex GlobalsMutex; |
| 59 std::unique_lock<std::mutex> GlobalsLock; | 60 std::unique_lock<std::mutex> GlobalsLock; |
| 60 std::condition_variable GlobalsDoneCV; | 61 std::condition_variable GlobalsDoneCV; |
| 61 }; | 62 }; |
| 62 } // end of namespace Ice | 63 } // end of namespace Ice |
| 63 | 64 |
| 64 #endif // SUBZERO_SRC_ICEASANINSTRUMENTATION_H | 65 #endif // SUBZERO_SRC_ICEASANINSTRUMENTATION_H |
| OLD | NEW |