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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 /// @} | 215 /// @} |
216 | 216 |
217 /// Return a locked pointer to the registered jump tables. | 217 /// Return a locked pointer to the registered jump tables. |
218 JumpTableDataList getJumpTables(); | 218 JumpTableDataList getJumpTables(); |
219 /// Create a new jump table entry and return a reference to it. | 219 /// Create a new jump table entry and return a reference to it. |
220 JumpTableData &addJumpTable(IceString FuncName, SizeT Id, | 220 JumpTableData &addJumpTable(IceString FuncName, SizeT Id, |
221 const JumpTableData::TargetList &TargetList); | 221 const JumpTableData::TargetList &TargetList); |
222 | 222 |
223 const ClFlags &getFlags() const { return Flags; } | 223 const ClFlags &getFlags() const { return Flags; } |
224 | 224 |
225 bool isIRGenerationDisabled() const { | |
226 return getFlags().getDisableIRGeneration(); | |
227 } | |
228 | |
229 /// Allocate data of type T using the global allocator. We allow entities | 225 /// Allocate data of type T using the global allocator. We allow entities |
230 /// allocated from this global allocator to be either trivially or | 226 /// allocated from this global allocator to be either trivially or |
231 /// non-trivially destructible. We optimize the case when T is trivially | 227 /// non-trivially destructible. We optimize the case when T is trivially |
232 /// destructible by not registering a destructor. Destructors will be invoked | 228 /// destructible by not registering a destructor. Destructors will be invoked |
233 /// during GlobalContext destruction in the reverse object creation order. | 229 /// during GlobalContext destruction in the reverse object creation order. |
234 template <typename T> | 230 template <typename T> |
235 typename std::enable_if<std::is_trivially_destructible<T>::value, T>::type * | 231 typename std::enable_if<std::is_trivially_destructible<T>::value, T>::type * |
236 allocate() { | 232 allocate() { |
237 return getAllocator()->Allocate<T>(); | 233 return getAllocator()->Allocate<T>(); |
238 } | 234 } |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 598 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
603 ~OstreamLocker() { Ctx->unlockStr(); } | 599 ~OstreamLocker() { Ctx->unlockStr(); } |
604 | 600 |
605 private: | 601 private: |
606 GlobalContext *const Ctx; | 602 GlobalContext *const Ctx; |
607 }; | 603 }; |
608 | 604 |
609 } // end of namespace Ice | 605 } // end of namespace Ice |
610 | 606 |
611 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 607 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
OLD | NEW |