| 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 // This file declares the Cfg class, which represents the control flow | 10 // This file declares the Cfg class, which represents the control flow |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 97 } |
| 98 enum { IdentifierIndexInvalid = -1 }; | 98 enum { IdentifierIndexInvalid = -1 }; |
| 99 | 99 |
| 100 // Manage instruction numbering. | 100 // Manage instruction numbering. |
| 101 InstNumberT newInstNumber() { return NextInstNumber++; } | 101 InstNumberT newInstNumber() { return NextInstNumber++; } |
| 102 InstNumberT getNextInstNumber() const { return NextInstNumber; } | 102 InstNumberT getNextInstNumber() const { return NextInstNumber; } |
| 103 | 103 |
| 104 // Manage Variables. | 104 // Manage Variables. |
| 105 // Create a new Variable with a particular type and an optional | 105 // Create a new Variable with a particular type and an optional |
| 106 // name. The Node argument is the node where the variable is defined. | 106 // name. The Node argument is the node where the variable is defined. |
| 107 // TODO(jpp): untemplate this with two separate methods: makeVariable and |
| 108 // makeSpillVariable. |
| 107 template <typename T = Variable> T *makeVariable(Type Ty) { | 109 template <typename T = Variable> T *makeVariable(Type Ty) { |
| 108 SizeT Index = Variables.size(); | 110 SizeT Index = Variables.size(); |
| 109 T *Var = T::create(this, Ty, Index); | 111 T *Var = T::create(this, Ty, Index); |
| 110 Variables.push_back(Var); | 112 Variables.push_back(Var); |
| 111 return Var; | 113 return Var; |
| 112 } | 114 } |
| 113 SizeT getNumVariables() const { return Variables.size(); } | 115 SizeT getNumVariables() const { return Variables.size(); } |
| 114 const VarList &getVariables() const { return Variables; } | 116 const VarList &getVariables() const { return Variables; } |
| 115 | 117 |
| 116 // Manage arguments to the function. | 118 // Manage arguments to the function. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 // other uses are possible. | 242 // other uses are possible. |
| 241 ICE_TLS_DECLARE_FIELD(const Cfg *, CurrentCfg); | 243 ICE_TLS_DECLARE_FIELD(const Cfg *, CurrentCfg); |
| 242 | 244 |
| 243 public: | 245 public: |
| 244 static void TlsInit() { ICE_TLS_INIT_FIELD(CurrentCfg); } | 246 static void TlsInit() { ICE_TLS_INIT_FIELD(CurrentCfg); } |
| 245 }; | 247 }; |
| 246 | 248 |
| 247 } // end of namespace Ice | 249 } // end of namespace Ice |
| 248 | 250 |
| 249 #endif // SUBZERO_SRC_ICECFG_H | 251 #endif // SUBZERO_SRC_ICECFG_H |
| OLD | NEW |