Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceCfgNode.h - Control flow graph node -------*- C++ -*-===// | 1 //===- subzero/src/IceCfgNode.h - Control flow graph node -------*- 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 28 matching lines...) Expand all Loading... | |
| 39 void setName(const IceString &NewName) { | 39 void setName(const IceString &NewName) { |
| 40 // Make sure that the name can only be set once. | 40 // Make sure that the name can only be set once. |
| 41 assert(NameIndex == Cfg::IdentifierIndexInvalid); | 41 assert(NameIndex == Cfg::IdentifierIndexInvalid); |
| 42 if (!NewName.empty()) | 42 if (!NewName.empty()) |
| 43 NameIndex = Func->addIdentifierName(NewName); | 43 NameIndex = Func->addIdentifierName(NewName); |
| 44 } | 44 } |
| 45 IceString getAsmName() const { | 45 IceString getAsmName() const { |
| 46 return ".L" + Func->getFunctionName() + "$" + getName(); | 46 return ".L" + Func->getFunctionName() + "$" + getName(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void incrementLoopNestDepth() { ++LoopNestDepth; } | |
| 50 uint32_t getLoopNestDepth() const { return LoopNestDepth; } | |
| 51 | |
| 49 /// The HasReturn flag indicates that this node contains a return | 52 /// The HasReturn flag indicates that this node contains a return |
| 50 /// instruction and therefore needs an epilog. | 53 /// instruction and therefore needs an epilog. |
| 51 void setHasReturn() { HasReturn = true; } | 54 void setHasReturn() { HasReturn = true; } |
| 52 bool getHasReturn() const { return HasReturn; } | 55 bool getHasReturn() const { return HasReturn; } |
| 53 | 56 |
| 54 void setNeedsPlacement(bool Value) { NeedsPlacement = Value; } | 57 void setNeedsPlacement(bool Value) { NeedsPlacement = Value; } |
| 55 bool needsPlacement() const { return NeedsPlacement; } | 58 bool needsPlacement() const { return NeedsPlacement; } |
| 56 | 59 |
| 57 void setNeedsAlignment() { NeedsAlignment = true; } | 60 void setNeedsAlignment() { NeedsAlignment = true; } |
| 58 bool needsAlignment() const { return NeedsAlignment; } | 61 bool needsAlignment() const { return NeedsAlignment; } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 void dump(Cfg *Func) const; | 107 void dump(Cfg *Func) const; |
| 105 | 108 |
| 106 void profileExecutionCount(VariableDeclaration *Var); | 109 void profileExecutionCount(VariableDeclaration *Var); |
| 107 | 110 |
| 108 private: | 111 private: |
| 109 CfgNode(Cfg *Func, SizeT LabelIndex); | 112 CfgNode(Cfg *Func, SizeT LabelIndex); |
| 110 Cfg *const Func; | 113 Cfg *const Func; |
| 111 SizeT Number; /// label index | 114 SizeT Number; /// label index |
| 112 Cfg::IdentifierIndexType NameIndex = | 115 Cfg::IdentifierIndexType NameIndex = |
| 113 Cfg::IdentifierIndexInvalid; /// index into Cfg::NodeNames table | 116 Cfg::IdentifierIndexInvalid; /// index into Cfg::NodeNames table |
| 117 uint32_t LoopNestDepth = 0; /// the loop nest depth of this node | |
|
Jim Stichnoth
2015/09/01 22:17:37
Maybe the uint32_t should be SizeT?
ascull
2015/09/03 19:52:37
Done.
| |
| 114 bool HasReturn = false; /// does this block need an epilog? | 118 bool HasReturn = false; /// does this block need an epilog? |
| 115 bool NeedsPlacement = false; | 119 bool NeedsPlacement = false; |
| 116 bool NeedsAlignment = false; /// is sandboxing required? | 120 bool NeedsAlignment = false; /// is sandboxing required? |
| 117 InstNumberT InstCountEstimate = 0; /// rough instruction count estimate | 121 InstNumberT InstCountEstimate = 0; /// rough instruction count estimate |
| 118 NodeList InEdges; /// in no particular order | 122 NodeList InEdges; /// in no particular order |
| 119 NodeList OutEdges; /// in no particular order | 123 NodeList OutEdges; /// in no particular order |
| 120 PhiList Phis; /// unordered set of phi instructions | 124 PhiList Phis; /// unordered set of phi instructions |
| 121 InstList Insts; /// ordered list of non-phi instructions | 125 InstList Insts; /// ordered list of non-phi instructions |
| 122 }; | 126 }; |
| 123 | 127 |
| 124 } // end of namespace Ice | 128 } // end of namespace Ice |
| 125 | 129 |
| 126 #endif // SUBZERO_SRC_ICECFGNODE_H | 130 #endif // SUBZERO_SRC_ICECFGNODE_H |
| OLD | NEW |