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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 ConstantPrimitive(const ConstantPrimitive &) LLVM_DELETED_FUNCTION; | 139 ConstantPrimitive(const ConstantPrimitive &) LLVM_DELETED_FUNCTION; |
140 ConstantPrimitive &operator=(const ConstantPrimitive &) LLVM_DELETED_FUNCTION; | 140 ConstantPrimitive &operator=(const ConstantPrimitive &) LLVM_DELETED_FUNCTION; |
141 virtual ~ConstantPrimitive() {} | 141 virtual ~ConstantPrimitive() {} |
142 const T Value; | 142 const T Value; |
143 }; | 143 }; |
144 | 144 |
145 typedef ConstantPrimitive<uint64_t, Operand::kConstInteger> ConstantInteger; | 145 typedef ConstantPrimitive<uint64_t, Operand::kConstInteger> ConstantInteger; |
146 typedef ConstantPrimitive<float, Operand::kConstFloat> ConstantFloat; | 146 typedef ConstantPrimitive<float, Operand::kConstFloat> ConstantFloat; |
147 typedef ConstantPrimitive<double, Operand::kConstDouble> ConstantDouble; | 147 typedef ConstantPrimitive<double, Operand::kConstDouble> ConstantDouble; |
148 | 148 |
| 149 template <> inline void ConstantInteger::dump(GlobalContext *Ctx) const { |
| 150 Ostream &Str = Ctx->getStrDump(); |
| 151 if (getType() == IceType_i1) |
| 152 Str << (getValue() ? "true" : "false"); |
| 153 else |
| 154 Str << static_cast<int64_t>(getValue()); |
| 155 } |
| 156 |
149 // RelocatableTuple bundles the parameters that are used to | 157 // RelocatableTuple bundles the parameters that are used to |
150 // construct an ConstantRelocatable. It is done this way so that | 158 // construct an ConstantRelocatable. It is done this way so that |
151 // ConstantRelocatable can fit into the global constant pool | 159 // ConstantRelocatable can fit into the global constant pool |
152 // template mechanism. | 160 // template mechanism. |
153 class RelocatableTuple { | 161 class RelocatableTuple { |
154 RelocatableTuple &operator=(const RelocatableTuple &) LLVM_DELETED_FUNCTION; | 162 RelocatableTuple &operator=(const RelocatableTuple &) LLVM_DELETED_FUNCTION; |
155 | 163 |
156 public: | 164 public: |
157 RelocatableTuple(const int64_t Offset, const IceString &Name, | 165 RelocatableTuple(const int64_t Offset, const IceString &Name, |
158 bool SuppressMangling) | 166 bool SuppressMangling) |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 Variable *LoVar; | 469 Variable *LoVar; |
462 Variable *HiVar; | 470 Variable *HiVar; |
463 // VarsReal (and Operand::Vars) are set up such that Vars[0] == | 471 // VarsReal (and Operand::Vars) are set up such that Vars[0] == |
464 // this. | 472 // this. |
465 Variable *VarsReal[1]; | 473 Variable *VarsReal[1]; |
466 }; | 474 }; |
467 | 475 |
468 } // end of namespace Ice | 476 } // end of namespace Ice |
469 | 477 |
470 #endif // SUBZERO_SRC_ICEOPERAND_H | 478 #endif // SUBZERO_SRC_ICEOPERAND_H |
OLD | NEW |