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 std::unique_lock<std::mutex> GlobalsLock(GlobalsSeenMutex); | |
Jim Stichnoth
2016/07/19 22:39:00
I think this could be simpler:
void Instrumentati
tlively
2016/07/19 23:20:14
Done.
| |
123 HasSeenGlobals = true; | |
124 GlobalsLock.unlock(); | |
125 GlobalsSeenCV.notify_all(); | |
126 } | |
127 | |
128 LockedPtr<VariableDeclarationList> Instrumentation::getGlobals() { | |
129 std::unique_lock<std::mutex> GlobalsLock(GlobalsSeenMutex); | |
130 GlobalsSeenCV.wait(GlobalsLock, [&] { return HasSeenGlobals; }); | |
Jim Stichnoth
2016/07/19 22:39:00
Instead of default capture, can you capture "this"
tlively
2016/07/19 23:20:14
Done.
| |
131 return Ctx->getGlobals(); | |
132 } | |
133 | |
121 } // end of namespace Ice | 134 } // end of namespace Ice |
OLD | NEW |