OLD | NEW |
1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// | 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 /// arbitrary amount of work during which far-away callees may grab | 168 /// arbitrary amount of work during which far-away callees may grab |
169 /// the stream and do something with it, and finally the thread | 169 /// the stream and do something with it, and finally the thread |
170 /// releases the stream lock. This allows large chunks of output to | 170 /// releases the stream lock. This allows large chunks of output to |
171 /// be dumped or emitted without risking interleaving from multiple | 171 /// be dumped or emitted without risking interleaving from multiple |
172 /// threads. | 172 /// threads. |
173 void lockStr() { StrLock.lock(); } | 173 void lockStr() { StrLock.lock(); } |
174 void unlockStr() { StrLock.unlock(); } | 174 void unlockStr() { StrLock.unlock(); } |
175 Ostream &getStrDump() { return *StrDump; } | 175 Ostream &getStrDump() { return *StrDump; } |
176 Ostream &getStrError() { return *StrError; } | 176 Ostream &getStrError() { return *StrError; } |
177 Ostream &getStrEmit() { return *StrEmit; } | 177 Ostream &getStrEmit() { return *StrEmit; } |
| 178 void setStrEmit(Ostream &NewStrEmit) { StrEmit = &NewStrEmit; } |
178 | 179 |
179 LockedPtr<ErrorCode> getErrorStatus() { | 180 LockedPtr<ErrorCode> getErrorStatus() { |
180 return LockedPtr<ErrorCode>(&ErrorStatus, &ErrorStatusLock); | 181 return LockedPtr<ErrorCode>(&ErrorStatus, &ErrorStatusLock); |
181 } | 182 } |
182 | 183 |
183 /// When emitting assembly, we allow a string to be prepended to | 184 /// When emitting assembly, we allow a string to be prepended to |
184 /// names of translated functions. This makes it easier to create an | 185 /// names of translated functions. This makes it easier to create an |
185 /// execution test against a reference translator like llc, with both | 186 /// execution test against a reference translator like llc, with both |
186 /// translators using the same bitcode as input. | 187 /// translators using the same bitcode as input. |
187 IceString mangleName(const IceString &Name) const; | 188 IceString mangleName(const IceString &Name) const; |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 601 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
601 ~OstreamLocker() { Ctx->unlockStr(); } | 602 ~OstreamLocker() { Ctx->unlockStr(); } |
602 | 603 |
603 private: | 604 private: |
604 GlobalContext *const Ctx; | 605 GlobalContext *const Ctx; |
605 }; | 606 }; |
606 | 607 |
607 } // end of namespace Ice | 608 } // end of namespace Ice |
608 | 609 |
609 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 610 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
OLD | NEW |