OLD | NEW |
1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// | 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- 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 Operand class and its target-independent | 10 // This file declares the Operand class and its target-independent |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // legal to lower ConstantUndef to any value, backends should try to | 210 // legal to lower ConstantUndef to any value, backends should try to |
211 // make code generation deterministic by lowering ConstantUndefs to 0. | 211 // make code generation deterministic by lowering ConstantUndefs to 0. |
212 class ConstantUndef : public Constant { | 212 class ConstantUndef : public Constant { |
213 public: | 213 public: |
214 static ConstantUndef *create(GlobalContext *Ctx, Type Ty, | 214 static ConstantUndef *create(GlobalContext *Ctx, Type Ty, |
215 uint32_t PoolEntryID) { | 215 uint32_t PoolEntryID) { |
216 return new (Ctx->allocate<ConstantUndef>()) ConstantUndef(Ty, PoolEntryID); | 216 return new (Ctx->allocate<ConstantUndef>()) ConstantUndef(Ty, PoolEntryID); |
217 } | 217 } |
218 | 218 |
219 using Constant::emit; | 219 using Constant::emit; |
220 virtual void emit(GlobalContext *Ctx) const { | 220 // The target needs to implement this. |
221 Ostream &Str = Ctx->getStrEmit(); | 221 virtual void emit(GlobalContext *Ctx) const; |
222 Str << "undef"; | |
223 } | |
224 | 222 |
225 using Constant::dump; | 223 using Constant::dump; |
226 virtual void dump(GlobalContext *Ctx) const { | 224 virtual void dump(GlobalContext *Ctx) const { |
227 Ostream &Str = Ctx->getStrEmit(); | 225 Ostream &Str = Ctx->getStrEmit(); |
228 Str << "undef"; | 226 Str << "undef"; |
229 } | 227 } |
230 | 228 |
231 static bool classof(const Operand *Operand) { | 229 static bool classof(const Operand *Operand) { |
232 return Operand->getKind() == kConstUndef; | 230 return Operand->getKind() == kConstUndef; |
233 } | 231 } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 Variable *LoVar; | 461 Variable *LoVar; |
464 Variable *HiVar; | 462 Variable *HiVar; |
465 // VarsReal (and Operand::Vars) are set up such that Vars[0] == | 463 // VarsReal (and Operand::Vars) are set up such that Vars[0] == |
466 // this. | 464 // this. |
467 Variable *VarsReal[1]; | 465 Variable *VarsReal[1]; |
468 }; | 466 }; |
469 | 467 |
470 } // end of namespace Ice | 468 } // end of namespace Ice |
471 | 469 |
472 #endif // SUBZERO_SRC_ICEOPERAND_H | 470 #endif // SUBZERO_SRC_ICEOPERAND_H |
OLD | NEW |