llvm.org GIT mirror llvm / d53e4c9
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248011 91177308-0d34-0410-b5e6-96231b3b80d8 Matthias Braun 5 years ago
3 changed file(s) with 29 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
2828 #include "llvm/Target/TargetRegisterInfo.h"
2929 #include "llvm/Target/TargetSubtargetInfo.h"
3030 using namespace llvm;
31
32 static cl::opt
33 VerboseDAGDumping("dag-dump-verbose", cl::Hidden,
34 cl::desc("Display more information when dumping selection "
35 "DAG nodes."));
3136
3237 std::string SDNode::getOperationName(const SelectionDAG *G) const {
3338 switch (getOpcode()) {
552557 << ']';
553558 }
554559
555 if (unsigned Order = getIROrder())
556 OS << " [ORD=" << Order << ']';
557
558 if (getNodeId() != -1)
559 OS << " [ID=" << getNodeId() << ']';
560
561 if (!G)
562 return;
563
564 DILocation *L = getDebugLoc();
565 if (!L)
566 return;
567
568 if (auto *Scope = L->getScope())
569 OS << Scope->getFilename();
570 else
571 OS << "";
572 OS << ':' << L->getLine();
573 if (unsigned C = L->getColumn())
574 OS << ':' << C;
560 if (VerboseDAGDumping) {
561 if (unsigned Order = getIROrder())
562 OS << " [ORD=" << Order << ']';
563
564 if (getNodeId() != -1)
565 OS << " [ID=" << getNodeId() << ']';
566
567 if (!G)
568 return;
569
570 DILocation *L = getDebugLoc();
571 if (!L)
572 return;
573
574 if (auto *Scope = L->getScope())
575 OS << Scope->getFilename();
576 else
577 OS << "";
578 OS << ':' << L->getLine();
579 if (unsigned C = L->getColumn())
580 OS << ':' << C;
581 }
575582 }
576583
577584 static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) {
None ; RUN: llc -debug < %s 2>&1 | FileCheck %s
0 ; RUN: llc -debug -dag-dump-verbose < %s 2>&1 | FileCheck %s
11 ; REQUIRES: asserts
22
33 ; CHECK: t{{[0-9]+}}: i32 = Constant<-1>test.c:4:5
None ; RUN: llc -debug < %s 2>&1 | FileCheck %s
0 ; RUN: llc -debug -dag-dump-verbose < %s 2>&1 | FileCheck %s
11 ; REQUIRES: asserts
22
33 ; CHECK: t{{[0-9]+}}: f64 = ConstantFP<1.500000e+00>test.c:3:5