[llvm] r248011 - SelectionDAGDumper: Hide [ID=X], [ORD=X] and source locations by default.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 10:57:29 PDT 2015


Author: matze
Date: Fri Sep 18 12:57:28 2015
New Revision: 248011

URL: http://llvm.org/viewvc/llvm-project?rev=248011&view=rev
Log:
SelectionDAGDumper: Hide [ID=X], [ORD=X] and source locations by default.

You can show them with the new -dag-dump-verbose switch.

Differential Revision: http://reviews.llvm.org/D12566

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
    llvm/trunk/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll
    llvm/trunk/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp?rev=248011&r1=248010&r2=248011&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp Fri Sep 18 12:57:28 2015
@@ -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 &
        << ']';
   }
 
-  if (unsigned Order = getIROrder())
-      OS << " [ORD=" << Order << ']';
-
-  if (getNodeId() != -1)
-    OS << " [ID=" << getNodeId() << ']';
-
-  if (!G)
-    return;
+  if (VerboseDAGDumping) {
+    if (unsigned Order = getIROrder())
+        OS << " [ORD=" << Order << ']';
+
+    if (getNodeId() != -1)
+      OS << " [ID=" << getNodeId() << ']';
+
+    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) {

Modified: llvm/trunk/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll?rev=248011&r1=248010&r2=248011&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll (original)
+++ llvm/trunk/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll Fri Sep 18 12:57:28 2015
@@ -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

Modified: llvm/trunk/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll?rev=248011&r1=248010&r2=248011&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll (original)
+++ llvm/trunk/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll Fri Sep 18 12:57:28 2015
@@ -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




More information about the llvm-commits mailing list