summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp39
-rw-r--r--llvm/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll2
-rw-r--r--llvm/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll2
3 files changed, 25 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
index 707cfad3ded..f38fcb1efce 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
@@ -30,6 +30,11 @@
#include "llvm/Target/TargetSubtargetInfo.h"
using namespace llvm;
+static cl::opt<bool>
+VerboseDAGDumping("dag-dump-verbose", cl::Hidden,
+ cl::desc("Display more information when dumping selection "
+ "DAG nodes."));
+
std::string SDNode::getOperationName(const SelectionDAG *G) const {
switch (getOpcode()) {
default:
@@ -553,26 +558,28 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const {
<< ']';
}
- if (unsigned Order = getIROrder())
- OS << " [ORD=" << Order << ']';
+ if (VerboseDAGDumping) {
+ if (unsigned Order = getIROrder())
+ OS << " [ORD=" << Order << ']';
- if (getNodeId() != -1)
- OS << " [ID=" << getNodeId() << ']';
+ if (getNodeId() != -1)
+ OS << " [ID=" << getNodeId() << ']';
- if (!G)
- return;
+ if (!G)
+ return;
- DILocation *L = getDebugLoc();
- if (!L)
- return;
+ DILocation *L = getDebugLoc();
+ if (!L)
+ return;
- if (auto *Scope = L->getScope())
- OS << Scope->getFilename();
- else
- OS << "<unknown>";
- OS << ':' << L->getLine();
- if (unsigned C = L->getColumn())
- OS << ':' << C;
+ if (auto *Scope = L->getScope())
+ OS << Scope->getFilename();
+ else
+ OS << "<unknown>";
+ OS << ':' << L->getLine();
+ if (unsigned C = L->getColumn())
+ OS << ':' << C;
+ }
}
static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) {
diff --git a/llvm/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll b/llvm/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll
index b43729fe005..7fd9b98ba84 100644
--- a/llvm/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll
+++ b/llvm/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll
@@ -1,4 +1,4 @@
-; RUN: llc -debug < %s 2>&1 | FileCheck %s
+; RUN: llc -debug -dag-dump-verbose < %s 2>&1 | FileCheck %s
; REQUIRES: asserts
; CHECK: t{{[0-9]+}}: i32 = Constant<-1>test.c:4:5
diff --git a/llvm/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll b/llvm/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll
index 36e5b6b507d..cb1dda9738e 100644
--- a/llvm/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll
+++ b/llvm/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll
@@ -1,4 +1,4 @@
-; RUN: llc -debug < %s 2>&1 | FileCheck %s
+; RUN: llc -debug -dag-dump-verbose < %s 2>&1 | FileCheck %s
; REQUIRES: asserts
; CHECK: t{{[0-9]+}}: f64 = ConstantFP<1.500000e+00>test.c:3:5
OpenPOWER on IntegriCloud