Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 | 68 |
| 69 /// \name Manage errors. | 69 /// \name Manage errors. |
| 70 /// @{ | 70 /// @{ |
| 71 | 71 |
| 72 /// Translation error flagging. If support for some construct is known to be | 72 /// Translation error flagging. If support for some construct is known to be |
| 73 /// missing, instead of an assertion failure, setError() should be called and | 73 /// missing, instead of an assertion failure, setError() should be called and |
| 74 /// the error should be propagated back up. This way, we can gracefully fail | 74 /// the error should be propagated back up. This way, we can gracefully fail |
| 75 /// to translate and let a fallback translator handle the function. | 75 /// to translate and let a fallback translator handle the function. |
| 76 void setError(const IceString &Message); | 76 void setError(const IceString &Message); |
| 77 bool hasError() const { return HasError; } | 77 bool hasError() const { return HasError; } |
| 78 IceString getError() const { return ErrorMessage; } | 78 const IceString &getError() const { return ErrorMessage; } |
|
John
2016/03/06 22:39:38
I understand this change, but consider this carefu
Jim Stichnoth
2016/03/07 00:03:10
You're right, no sense doing risks to optimize get
| |
| 79 /// @} | 79 /// @} |
| 80 | 80 |
| 81 /// \name Manage nodes (a.k.a. basic blocks, CfgNodes). | 81 /// \name Manage nodes (a.k.a. basic blocks, CfgNodes). |
| 82 /// @{ | 82 /// @{ |
| 83 void setEntryNode(CfgNode *EntryNode) { Entry = EntryNode; } | 83 void setEntryNode(CfgNode *EntryNode) { Entry = EntryNode; } |
| 84 CfgNode *getEntryNode() const { return Entry; } | 84 CfgNode *getEntryNode() const { return Entry; } |
| 85 /// Create a node and append it to the end of the linearized list. The loop | 85 /// Create a node and append it to the end of the linearized list. The loop |
| 86 /// nest depth of the new node may not be valid if it is created after | 86 /// nest depth of the new node may not be valid if it is created after |
| 87 /// computeLoopNestDepth. | 87 /// computeLoopNestDepth. |
| 88 CfgNode *makeNode(); | 88 CfgNode *makeNode(); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 | 222 /// Get the total amount of memory held by the per-Cfg allocator. This is |
| 223 /// mostly meant for use inside a debugger. | 223 /// mostly meant for use inside a debugger. |
| 224 static size_t getTotalMemoryMB(); | 224 static size_t getTotalMemoryMB(); |
| 225 | 225 |
| 226 void emit(); | 226 void emit(); |
| 227 void emitIAS(); | 227 void emitIAS(); |
| 228 static void emitTextHeader(const IceString &MangledName, GlobalContext *Ctx, | 228 static void emitTextHeader(const IceString &Name, GlobalContext *Ctx, |
| 229 const Assembler *Asm); | 229 const Assembler *Asm); |
| 230 void dump(const IceString &Message = ""); | 230 void dump(const IceString &Message = ""); |
| 231 | 231 |
| 232 /// Allocate data of type T using the per-Cfg allocator. | 232 /// Allocate data of type T using the per-Cfg allocator. |
| 233 template <typename T> T *allocate() { return Allocator->Allocate<T>(); } | 233 template <typename T> T *allocate() { return Allocator->Allocate<T>(); } |
| 234 | 234 |
| 235 /// 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. |
| 236 template <typename T> T *allocateArrayOf(size_t NumElems) { | 236 template <typename T> T *allocateArrayOf(size_t NumElems) { |
| 237 return Allocator->Allocate<T>(NumElems); | 237 return Allocator->Allocate<T>(NumElems); |
| 238 } | 238 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 | 311 |
| 312 public: | 312 public: |
| 313 static void TlsInit() { CfgAllocatorTraits::init(); } | 313 static void TlsInit() { CfgAllocatorTraits::init(); } |
| 314 }; | 314 }; |
| 315 | 315 |
| 316 template <> Variable *Cfg::makeVariable<Variable>(Type Ty); | 316 template <> Variable *Cfg::makeVariable<Variable>(Type Ty); |
| 317 | 317 |
| 318 } // end of namespace Ice | 318 } // end of namespace Ice |
| 319 | 319 |
| 320 #endif // SUBZERO_SRC_ICECFG_H | 320 #endif // SUBZERO_SRC_ICECFG_H |
| OLD | NEW |