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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 /// @{ | 104 /// @{ |
105 InstNumberT newInstNumber() { return NextInstNumber++; } | 105 InstNumberT newInstNumber() { return NextInstNumber++; } |
106 InstNumberT getNextInstNumber() const { return NextInstNumber; } | 106 InstNumberT getNextInstNumber() const { return NextInstNumber; } |
107 /// @} | 107 /// @} |
108 | 108 |
109 /// \name Manage Variables. | 109 /// \name Manage Variables. |
110 /// @{ | 110 /// @{ |
111 | 111 |
112 /// Create a new Variable with a particular type and an optional name. The | 112 /// Create a new Variable with a particular type and an optional name. The |
113 /// Node argument is the node where the variable is defined. | 113 /// Node argument is the node where the variable is defined. |
114 // TODO(jpp): untemplate this with separate methods: makeVariable, | 114 // TODO(jpp): untemplate this with separate methods: makeVariable and |
115 // makeSpillVariable, and makeStackVariable. | 115 // makeStackVariable. |
116 template <typename T = Variable> T *makeVariable(Type Ty) { | 116 template <typename T = Variable> T *makeVariable(Type Ty) { |
117 SizeT Index = Variables.size(); | 117 SizeT Index = Variables.size(); |
118 auto *Var = T::create(this, Ty, Index); | 118 auto *Var = T::create(this, Ty, Index); |
119 Variables.push_back(Var); | 119 Variables.push_back(Var); |
120 return Var; | 120 return Var; |
121 } | 121 } |
122 SizeT getNumVariables() const { return Variables.size(); } | 122 SizeT getNumVariables() const { return Variables.size(); } |
123 const VarList &getVariables() const { return Variables; } | 123 const VarList &getVariables() const { return Variables; } |
124 /// @} | 124 /// @} |
125 | 125 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 using OwnerType = Cfg; | 355 using OwnerType = Cfg; |
356 static StringPool *getStrings(const OwnerType *PoolOwner) { | 356 static StringPool *getStrings(const OwnerType *PoolOwner) { |
357 return PoolOwner->getVarStrings(); | 357 return PoolOwner->getVarStrings(); |
358 } | 358 } |
359 }; | 359 }; |
360 using VariableString = StringID<VariableStringPoolTraits>; | 360 using VariableString = StringID<VariableStringPoolTraits>; |
361 | 361 |
362 } // end of namespace Ice | 362 } // end of namespace Ice |
363 | 363 |
364 #endif // SUBZERO_SRC_ICECFG_H | 364 #endif // SUBZERO_SRC_ICECFG_H |
OLD | NEW |