[PATCH] D12566: SelectionDAGDumper: Hide [ID=X], [ORD=X] and source locations by default.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 10:55:05 PDT 2015


MatzeB created this revision.
MatzeB added a reviewer: resistor.
MatzeB added a subscriber: llvm-commits.
MatzeB set the repository for this revision to rL LLVM.

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

Repository:
  rL LLVM

http://reviews.llvm.org/D12566

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp

Index: lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
+++ 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 @@
        << ']';
   }
 
-  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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12566.33830.patch
Type: text/x-patch
Size: 1657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150902/a0fc1874/attachment.bin>


More information about the llvm-commits mailing list