OLD | NEW |
---|---|
1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===// | 1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===// |
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 implements the Operand class and its target-independent | 10 // This file implements the Operand class and its target-independent |
(...skipping 171 matching lines...) Loading... | |
182 | 182 |
183 IceString Variable::getName() const { | 183 IceString Variable::getName() const { |
184 if (!Name.empty()) | 184 if (!Name.empty()) |
185 return Name; | 185 return Name; |
186 char buf[30]; | 186 char buf[30]; |
187 snprintf(buf, llvm::array_lengthof(buf), "__%u", getIndex()); | 187 snprintf(buf, llvm::array_lengthof(buf), "__%u", getIndex()); |
188 return buf; | 188 return buf; |
189 } | 189 } |
190 | 190 |
191 Variable Variable::asType(Type Ty) { | 191 Variable Variable::asType(Type Ty) { |
192 Variable V(Ty, DefNode, Number, Name); | 192 Variable V(kVariable, Ty, DefNode, Number, Name); |
jvoung (off chromium)
2014/09/20 18:30:56
Should it use the original Kind, instead of kVaria
Jim Stichnoth
2014/09/20 19:24:53
I don't think so, because then you could do someth
| |
193 V.RegNum = RegNum; | 193 V.RegNum = RegNum; |
194 V.StackOffset = StackOffset; | 194 V.StackOffset = StackOffset; |
195 return V; | 195 return V; |
196 } | 196 } |
197 | 197 |
198 // ======================== dump routines ======================== // | 198 // ======================== dump routines ======================== // |
199 | 199 |
200 void Variable::emit(const Cfg *Func) const { | 200 void Variable::emit(const Cfg *Func) const { |
201 Func->getTarget()->emitVariable(this, Func); | 201 Func->getTarget()->emitVariable(this, Func); |
202 } | 202 } |
(...skipping 64 matching lines...) Loading... | |
267 | 267 |
268 Ostream &operator<<(Ostream &Str, const RegWeight &W) { | 268 Ostream &operator<<(Ostream &Str, const RegWeight &W) { |
269 if (W.getWeight() == RegWeight::Inf) | 269 if (W.getWeight() == RegWeight::Inf) |
270 Str << "Inf"; | 270 Str << "Inf"; |
271 else | 271 else |
272 Str << W.getWeight(); | 272 Str << W.getWeight(); |
273 return Str; | 273 return Str; |
274 } | 274 } |
275 | 275 |
276 } // end of namespace Ice | 276 } // end of namespace Ice |
OLD | NEW |