OLD | NEW |
1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- C++ -*-===// | 1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 /// \name Manage the CurrentNode field. | 213 /// \name Manage the CurrentNode field. |
214 /// CurrentNode is used for validating the Variable::DefNode field during | 214 /// CurrentNode is used for validating the Variable::DefNode field during |
215 /// dumping/emitting. | 215 /// dumping/emitting. |
216 /// @{ | 216 /// @{ |
217 void setCurrentNode(const CfgNode *Node) { CurrentNode = Node; } | 217 void setCurrentNode(const CfgNode *Node) { CurrentNode = Node; } |
218 void resetCurrentNode() { setCurrentNode(nullptr); } | 218 void resetCurrentNode() { setCurrentNode(nullptr); } |
219 const CfgNode *getCurrentNode() const { return CurrentNode; } | 219 const CfgNode *getCurrentNode() const { return CurrentNode; } |
220 /// @} | 220 /// @} |
221 | 221 |
| 222 /// Get the total amount of memory held by the per-Cfg allocator. This is |
| 223 /// mostly meant for use inside a debugger. |
| 224 static size_t getTotalMemoryMB(); |
| 225 |
222 void emit(); | 226 void emit(); |
223 void emitIAS(); | 227 void emitIAS(); |
224 static void emitTextHeader(const IceString &MangledName, GlobalContext *Ctx, | 228 static void emitTextHeader(const IceString &MangledName, GlobalContext *Ctx, |
225 const Assembler *Asm); | 229 const Assembler *Asm); |
226 void dump(const IceString &Message = ""); | 230 void dump(const IceString &Message = ""); |
227 | 231 |
228 /// Allocate data of type T using the per-Cfg allocator. | 232 /// Allocate data of type T using the per-Cfg allocator. |
229 template <typename T> T *allocate() { return Allocator->Allocate<T>(); } | 233 template <typename T> T *allocate() { return Allocator->Allocate<T>(); } |
230 | 234 |
231 /// Allocate an array of data of type T using the per-Cfg allocator. | 235 /// Allocate an array of data of type T using the per-Cfg allocator. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 311 |
308 public: | 312 public: |
309 static void TlsInit() { CfgAllocatorTraits::init(); } | 313 static void TlsInit() { CfgAllocatorTraits::init(); } |
310 }; | 314 }; |
311 | 315 |
312 template <> Variable *Cfg::makeVariable<Variable>(Type Ty); | 316 template <> Variable *Cfg::makeVariable<Variable>(Type Ty); |
313 | 317 |
314 } // end of namespace Ice | 318 } // end of namespace Ice |
315 | 319 |
316 #endif // SUBZERO_SRC_ICECFG_H | 320 #endif // SUBZERO_SRC_ICECFG_H |
OLD | NEW |