Chromium Code Reviews| Index: src/IceCfg.cpp |
| diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp |
| index e8c74bacc3a08c3e44c460092ed950edfea76395..8eac918b69d671de8fb9e15b511b27b157456b71 100644 |
| --- a/src/IceCfg.cpp |
| +++ b/src/IceCfg.cpp |
| @@ -56,6 +56,7 @@ Cfg::~Cfg() { |
| void Cfg::setError(const IceString &Message) { |
| HasError = true; |
| ErrorMessage = Message; |
| + OstreamLocker L(Ctx); |
| Ctx->getStrDump() << "ICE translation error: " << ErrorMessage << "\n"; |
| } |
| @@ -335,6 +336,7 @@ void Cfg::liveness(LivenessMode Mode) { |
| bool Cfg::validateLiveness() const { |
| TimerMarker T(TimerStack::TT_validateLiveness, this); |
| bool Valid = true; |
| + OstreamLocker L(Ctx); |
| Ostream &Str = Ctx->getStrDump(); |
| for (CfgNode *Node : Nodes) { |
| Inst *FirstInst = nullptr; |
| @@ -442,6 +444,7 @@ void Cfg::emit() { |
| liveness(Liveness_Basic); |
| dump("After recomputing liveness for -decorate-asm"); |
| } |
| + OstreamLocker L(Ctx); |
| Ostream &Str = Ctx->getStrEmit(); |
| IceString MangledName = getContext()->mangleName(getFunctionName()); |
| emitTextHeader(MangledName); |
| @@ -454,6 +457,7 @@ void Cfg::emitIAS() { |
| TimerMarker T(TimerStack::TT_emit, this); |
| assert(!Ctx->getFlags().DecorateAsm); |
| IceString MangledName = getContext()->mangleName(getFunctionName()); |
| + OstreamLocker L(Ctx); |
| if (!Ctx->getFlags().UseELFWriter) |
|
jvoung (off chromium)
2015/01/15 18:20:40
Technically, the lock doesn't need to be held this
Jim Stichnoth
2015/01/17 18:44:16
Done.
|
| emitTextHeader(MangledName); |
| for (CfgNode *Node : Nodes) |
| @@ -474,6 +478,7 @@ void Cfg::dump(const IceString &Message) { |
| return; |
| if (!Ctx->isVerbose()) |
| return; |
| + OstreamLocker L(Ctx); |
| Ostream &Str = Ctx->getStrDump(); |
| if (!Message.empty()) |
| Str << "================ " << Message << " ================\n"; |