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

Unified Diff: src/IceOperand.h

Issue 686913005: Turn off dump/emit routines when building minimal subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 6 years, 1 month 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
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index c37b195415d78807a42e4eb3d1e83b4464bd327c..13e53248c82345184d8c57dcd4ce061862a50a41 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -65,10 +65,15 @@ public:
// situation where Func==NULL.
virtual void dump(const Cfg *Func, Ostream &Str) const = 0;
void dump(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
assert(Func);
dump(Func, Func->getContext()->getStrDump());
}
- void dump(Ostream &Str) const { dump(NULL, Str); }
+ void dump(Ostream &Str) const {
+ if (ALLOW_DUMP)
+ dump(NULL, Str);
+ }
// Query whether this object was allocated in isolation, or added to
// some higher-level pool. This determines whether a containing
@@ -148,7 +153,10 @@ public:
// specialization.
void emit(GlobalContext *Ctx) const override;
using Constant::dump;
- void dump(const Cfg *, Ostream &Str) const override { Str << getValue(); }
+ void dump(const Cfg *, Ostream &Str) const override {
+ if (ALLOW_DUMP)
+ Str << getValue();
+ }
static bool classof(const Operand *Operand) {
return Operand->getKind() == K;
@@ -167,6 +175,8 @@ typedef ConstantPrimitive<float, Operand::kConstFloat> ConstantFloat;
typedef ConstantPrimitive<double, Operand::kConstDouble> ConstantDouble;
template <> inline void ConstantInteger32::dump(const Cfg *, Ostream &Str) const {
+ if (!ALLOW_DUMP)
+ return;
if (getType() == IceType_i1)
Str << (getValue() ? "true" : "false");
else
@@ -174,6 +184,8 @@ template <> inline void ConstantInteger32::dump(const Cfg *, Ostream &Str) const
}
template <> inline void ConstantInteger64::dump(const Cfg *, Ostream &Str) const {
+ if (!ALLOW_DUMP)
+ return;
assert(getType() == IceType_i64);
Str << static_cast<int64_t>(getValue());
}
@@ -259,7 +271,10 @@ public:
using Constant::dump;
// The target needs to implement this.
void emit(GlobalContext *Ctx) const override;
- void dump(const Cfg *, Ostream &Str) const override { Str << "undef"; }
+ void dump(const Cfg *, Ostream &Str) const override {
+ if (ALLOW_DUMP)
+ Str << "undef";
+ }
static bool classof(const Operand *Operand) {
return Operand->getKind() == kConstUndef;
« no previous file with comments | « src/IceInstX8632.cpp ('k') | src/IceOperand.cpp » ('j') | tests_lit/reader_tests/alloca.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698