OLD | NEW |
1 //===- subzero/src/IceInstrumentation.cpp - ICE instrumentation framework -===// | 1 //===- subzero/src/IceInstrumentation.cpp - ICE instrumentation framework -===// |
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 case Inst::Unreachable: | 111 case Inst::Unreachable: |
112 instrumentUnreachable(Context, llvm::cast<InstUnreachable>(Instr)); | 112 instrumentUnreachable(Context, llvm::cast<InstUnreachable>(Instr)); |
113 break; | 113 break; |
114 default: | 114 default: |
115 // Only instrument high-level ICE instructions | 115 // Only instrument high-level ICE instructions |
116 assert(false && "Instrumentation encountered an unexpected instruction"); | 116 assert(false && "Instrumentation encountered an unexpected instruction"); |
117 break; | 117 break; |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
| 121 void Instrumentation::setHasSeenGlobals() { |
| 122 { |
| 123 std::unique_lock<std::mutex> _(GlobalsSeenMutex); |
| 124 HasSeenGlobals = true; |
| 125 } |
| 126 GlobalsSeenCV.notify_all(); |
| 127 } |
| 128 |
| 129 LockedPtr<VariableDeclarationList> Instrumentation::getGlobals() { |
| 130 std::unique_lock<std::mutex> GlobalsLock(GlobalsSeenMutex); |
| 131 GlobalsSeenCV.wait(GlobalsLock, [this] { return HasSeenGlobals; }); |
| 132 return Ctx->getGlobals(); |
| 133 } |
| 134 |
121 } // end of namespace Ice | 135 } // end of namespace Ice |
OLD | NEW |