Turn off dump/emit routines when building minimal subzero.
Remove the dump/emit routines when ALLOW_DUMP=0. Also fixes some
verbosity messages to not print if ALLOW_DUMP=0. Note: emit routines
needed for emitIAS are not turned off.
BUG=None
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/686913005
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index e41f114..59035f8 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -798,6 +798,8 @@
void emitRegisterUsage(Ostream &Str, const Cfg *Func, const CfgNode *Node,
bool IsLiveIn, std::vector<SizeT> &LiveRegCount) {
+ if (!ALLOW_DUMP)
+ return;
Liveness *Liveness = Func->getLiveness();
const LivenessBV *Live;
if (IsLiveIn) {
@@ -828,6 +830,8 @@
void emitLiveRangesEnded(Ostream &Str, const Cfg *Func, const Inst *Instr,
std::vector<SizeT> &LiveRegCount) {
+ if (!ALLOW_DUMP)
+ return;
bool First = true;
Variable *Dest = Instr->getDest();
if (Dest && Dest->hasReg())
@@ -873,6 +877,8 @@
} // end of anonymous namespace
void CfgNode::emit(Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
Func->setCurrentNode(this);
Ostream &Str = Func->getContext()->getStrEmit();
Liveness *Liveness = Func->getLiveness();
@@ -930,6 +936,8 @@
}
void CfgNode::dump(Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
Func->setCurrentNode(this);
Ostream &Str = Func->getContext()->getStrDump();
Liveness *Liveness = Func->getLiveness();