Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: src/IceOperand.h

Issue 539743002: Subzero: Render constants in dump() to be more like LLVM. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698