// is specified. This should probably not be referenced directly, instead, use
// the DEBUG macro below.
//
+#ifndef NDEBUG
extern bool DebugFlag;
+#endif
// isCurrentDebugType - Return true if the specified string is the debug type
// specified on the command line, or if none was specified on the command line
#ifndef NDEBUG
ViewGraph(this, "mf" + getFunction()->getNameStr());
#else
- cerr << "SelectionDAG::viewGraph is only available in debug builds on "
- << "systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::viewGraph is only available in debug builds on "
+ << "systems with Graphviz or gv!\n";
#endif // NDEBUG
}
#ifndef NDEBUG
ViewGraph(this, "mf" + getFunction()->getNameStr(), true);
#else
- cerr << "SelectionDAG::viewGraph is only available in debug builds on "
- << "systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::viewGraph is only available in debug builds on "
+ << "systems with Graphviz or gv!\n";
#endif // NDEBUG
}
ViewGraph(this, "dag." + MF.getFunction()->getNameStr(), false,
"Scheduling-Units Graph for " + MF.getFunction()->getNameStr());
#else
- cerr << "ScheduleDAG::viewGraph is only available in debug builds on "
- << "systems with Graphviz or gv!\n";
+ errs() << "ScheduleDAG::viewGraph is only available in debug builds on "
+ << "systems with Graphviz or gv!\n";
#endif // NDEBUG
}
ViewGraph(this, "dag." + getMachineFunction().getFunction()->getNameStr(),
false, Title);
#else
- cerr << "SelectionDAG::viewGraph is only available in debug builds on "
- << "systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::viewGraph is only available in debug builds on "
+ << "systems with Graphviz or gv!\n";
#endif // NDEBUG
}
#ifndef NDEBUG
NodeGraphAttrs.clear();
#else
- cerr << "SelectionDAG::clearGraphAttrs is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::clearGraphAttrs is only available in debug builds"
+ << " on systems with Graphviz or gv!\n";
#endif
}
#ifndef NDEBUG
NodeGraphAttrs[N] = Attrs;
#else
- cerr << "SelectionDAG::setGraphAttrs is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::setGraphAttrs is only available in debug builds"
+ << " on systems with Graphviz or gv!\n";
#endif
}
else
return "";
#else
- cerr << "SelectionDAG::getGraphAttrs is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::getGraphAttrs is only available in debug builds"
+ << " on systems with Graphviz or gv!\n";
return std::string("");
#endif
}
#ifndef NDEBUG
NodeGraphAttrs[N] = std::string("color=") + Color;
#else
- cerr << "SelectionDAG::setGraphColor is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::setGraphColor is only available in debug builds"
+ << " on systems with Graphviz or gv!\n";
#endif
}
}
}
#else
- cerr << "SelectionDAG::setSubgraphColor is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::setSubgraphColor is only available in debug builds"
+ << " on systems with Graphviz or gv!\n";
#endif
return hit_limit;
}
}
#else
- cerr << "SelectionDAG::setSubgraphColor is only available in debug builds"
- << " on systems with Graphviz or gv!\n";
+ errs() << "SelectionDAG::setSubgraphColor is only available in debug builds"
+ << " on systems with Graphviz or gv!\n";
#endif
}
#include "llvm/Support/Debug.h"
using namespace llvm;
+// All Debug.h functionality is a no-op in NDEBUG mode.
+#ifndef NDEBUG
bool llvm::DebugFlag; // DebugFlag - Exported boolean set by the -debug option
-#ifndef NDEBUG
// -debug - Command line option to enable the DEBUG statements in the passes.
// This flag may only be enabled in debug builds.
static cl::opt<bool, true>
DebugOnly("debug-only", cl::desc("Enable a specific type of debug output"),
cl::Hidden, cl::value_desc("debug string"),
cl::location(DebugOnlyOptLoc), cl::ValueRequired);
-#endif
// isCurrentDebugType - Return true if the specified string is the debug type
// specified on the command line, or if none was specified on the command line
// with the -debug-only=X option.
//
bool llvm::isCurrentDebugType(const char *DebugType) {
-#ifndef NDEBUG
return CurrentDebugType.empty() || DebugType == CurrentDebugType;
+}
#else
- return false;
+// Avoid "has no symbols" warning.
+int Debug_dummy = 0;
#endif
-}
// Codegen the basic block.
DEBUG(errs() << "===== Instruction selection begins:\n");
- Indent = 0;
+ DEBUG(Indent = 0);
SelectRoot(*CurDAG);
DEBUG(errs() << "===== Instruction selection ends:\n");
DEBUG(errs().indent(Indent) << "Selecting: ");
DEBUG(Node->dump(CurDAG));
DEBUG(errs() << "\n");
- Indent += 2;
+ DEBUG(Indent += 2);
// If we have a custom node, we already have selected!
if (Node->isMachineOpcode()) {
DEBUG(errs().indent(Indent-2) << "== ";
Node->dump(CurDAG);
errs() << "\n");
- Indent -= 2;
+ DEBUG(Indent -= 2);
return NULL;
}
else
DEBUG(ResNode->dump(CurDAG));
DEBUG(errs() << "\n");
- Indent -= 2;
+ DEBUG(Indent -= 2);
return ResNode;
}
DEBUG(BB->dump());
// Codegen the basic block.
DEBUG(errs() << "===== Instruction selection begins:\n");
- Indent = 0;
+ DEBUG(Indent = 0);
// Select target instructions for the DAG.
SelectRoot(*CurDAG);
DEBUG(errs().indent(Indent) << "Selecting: ";
Node->dump(CurDAG);
errs() << "\n");
- Indent += 2;
+ DEBUG(Indent += 2);
// If we have a custom node, we already have selected!
if (Node->isMachineOpcode()) {
DEBUG(errs().indent(Indent-2) << "== ";
Node->dump(CurDAG);
errs() << "\n");
- Indent -= 2;
+ DEBUG(Indent -= 2);
return NULL;
}
else
DEBUG(ResNode->dump(CurDAG));
DEBUG(errs() << "\n");
- Indent -= 2;
+ DEBUG(Indent -= 2);
return ResNode;
}
// Codegen the basic block.
DEBUG(errs() << "===== Instruction selection begins:\n");
- Indent = 0;
+ DEBUG(Indent = 0);
SelectRoot(*CurDAG);
DEBUG(errs() << "===== Instruction selection ends:\n");
DEBUG(errs().indent(Indent) << "Selecting: ";
Node->dump(CurDAG);
errs() << "\n");
- Indent += 2;
+ DEBUG(Indent += 2);
// If we have a custom node, we already have selected!
if (Node->isMachineOpcode()) {
DEBUG(errs().indent(Indent-2) << "== ";
Node->dump(CurDAG);
errs() << "\n");
- Indent -= 2;
+ DEBUG(Indent -= 2);
return NULL; // Already selected.
}
ResNode->dump(CurDAG);
errs() << "\n";
);
- Indent -= 2;
+ DEBUG(Indent -= 2);
return ResNode;
}