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

Unified Diff: src/IceOperand.cpp

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.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index b2af752483f9c630ff19a86b3c3bac38d39c64bf..583a6bcbbf5d0852a3336e1a3512fee5b806b358 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -427,10 +427,13 @@ const InstDefList VariablesMetadata::NoDefinitions;
// ======================== dump routines ======================== //
void Variable::emit(const Cfg *Func) const {
- Func->getTarget()->emitVariable(this);
+ if (ALLOW_DUMP)
+ Func->getTarget()->emitVariable(this);
}
void Variable::dump(const Cfg *Func, Ostream &Str) const {
+ if (!ALLOW_DUMP)
+ return;
if (Func == NULL) {
Str << "%" << getName();
return;
@@ -458,6 +461,8 @@ void Variable::dump(const Cfg *Func, Ostream &Str) const {
}
void ConstantRelocatable::emitWithoutDollar(GlobalContext *Ctx) const {
+ if (!ALLOW_DUMP)
+ return;
Ostream &Str = Ctx->getStrEmit();
if (SuppressMangling)
Str << Name;
@@ -471,12 +476,16 @@ void ConstantRelocatable::emitWithoutDollar(GlobalContext *Ctx) const {
}
void ConstantRelocatable::emit(GlobalContext *Ctx) const {
+ if (!ALLOW_DUMP)
+ return;
Ostream &Str = Ctx->getStrEmit();
Str << "$";
emitWithoutDollar(Ctx);
}
void ConstantRelocatable::dump(const Cfg *Func, Ostream &Str) const {
+ if (!ALLOW_DUMP)
+ return;
Str << "@";
if (Func && !SuppressMangling) {
Str << Func->getContext()->mangleName(Name);
@@ -488,6 +497,8 @@ void ConstantRelocatable::dump(const Cfg *Func, Ostream &Str) const {
}
void LiveRange::dump(Ostream &Str) const {
+ if (!ALLOW_DUMP)
+ return;
Str << "(weight=" << Weight << ") ";
bool First = true;
for (const RangeElementType &I : Range) {
@@ -499,11 +510,15 @@ void LiveRange::dump(Ostream &Str) const {
}
Ostream &operator<<(Ostream &Str, const LiveRange &L) {
+ if (!ALLOW_DUMP)
+ return Str;
L.dump(Str);
return Str;
}
Ostream &operator<<(Ostream &Str, const RegWeight &W) {
+ if (!ALLOW_DUMP)
+ return Str;
if (W.getWeight() == RegWeight::Inf)
Str << "Inf";
else
« no previous file with comments | « src/IceOperand.h ('k') | src/IceRegAlloc.cpp » ('j') | tests_lit/reader_tests/alloca.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698