diff options
| author | Adrian Prantl <aprantl@apple.com> | 2018-09-14 17:08:02 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2018-09-14 17:08:02 +0000 |
| commit | 55b8756b8a58570f168e6dee6ea12b7772615a2b (patch) | |
| tree | 5324c23e7c0491caa482155e131fc0dcfddac7bd /llvm/lib/CodeGen | |
| parent | 13f426304fd81c5283451dcfbb486d29c7514e43 (diff) | |
| download | bcm5719-llvm-55b8756b8a58570f168e6dee6ea12b7772615a2b.tar.gz bcm5719-llvm-55b8756b8a58570f168e6dee6ea12b7772615a2b.zip | |
SelectionDAG: Add compact SDDbgValue representation to -dag-dump-verbose output
llvm-svn: 342245
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h b/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h index 7e6b5742633..490105a9d58 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h +++ b/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h @@ -24,6 +24,7 @@ class DIVariable; class DIExpression; class SDNode; class Value; +class raw_ostream; /// Holds the information from a dbg_value node through SDISel. /// We do not use SDValue here to avoid including its header. @@ -124,6 +125,8 @@ public: /// deleted. void setIsInvalidated() { Invalid = true; } bool isInvalidated() const { return Invalid; } + + LLVM_DUMP_METHOD void dump(raw_ostream &OS) const; }; /// Holds the information from a dbg_label node through SDISel. diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp index fa341e8b5fa..539dbaaee1b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -46,6 +46,7 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetIntrinsicInfo.h" #include "llvm/Target/TargetMachine.h" +#include "SDNodeDbgValue.h" #include <cstdint> #include <iterator> @@ -681,9 +682,24 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const { OS << ':' << L->getLine(); if (unsigned C = L->getColumn()) OS << ':' << C; + + for (SDDbgValue *Dbg : G->GetDbgValues(this)) { + if (Dbg->getKind() != SDDbgValue::SDNODE || Dbg->isInvalidated()) + continue; + Dbg->dump(OS); + } } } +LLVM_DUMP_METHOD void SDDbgValue::dump(raw_ostream &OS) const { + OS << " DbgVal"; + if (kind==SDNODE) + OS << '(' << u.s.ResNo << ')'; + OS << ":\"" << Var->getName() << '"'; + if (Expr->getNumElements()) + Expr->dump(); +} + /// Return true if this node is so simple that we should just print it inline /// if it appears as an operand. static bool shouldPrintInline(const SDNode &Node) { |

