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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 73e51e5138387d8c1cbcf76159db5d5bf75c894a..0828396074cffa8836ce8601f1090275b14e923b 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -146,6 +146,14 @@ typedef ConstantPrimitive<uint64_t, Operand::kConstInteger> ConstantInteger;
typedef ConstantPrimitive<float, Operand::kConstFloat> ConstantFloat;
typedef ConstantPrimitive<double, Operand::kConstDouble> ConstantDouble;
+template <> inline void ConstantInteger::dump(GlobalContext *Ctx) const {
+ Ostream &Str = Ctx->getStrDump();
+ if (getType() == IceType_i1)
+ Str << (getValue() ? "true" : "false");
+ else
+ Str << static_cast<int64_t>(getValue());
+}
+
// RelocatableTuple bundles the parameters that are used to
// construct an ConstantRelocatable. It is done this way so that
// ConstantRelocatable can fit into the global constant pool
« 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