diff options
| author | Dan Gohman <gohman@apple.com> | 2010-05-07 01:09:21 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-05-07 01:09:21 +0000 |
| commit | e7dff14d5dd080057bc00d2da84ac3fe3f126102 (patch) | |
| tree | b7a7a8245e32b6444f06d399b116433baa6c18d8 | |
| parent | 7421ae48bf2c3d5a078d0b3047e7c879c3415320 (diff) | |
| download | bcm5719-llvm-e7dff14d5dd080057bc00d2da84ac3fe3f126102.tar.gz bcm5719-llvm-e7dff14d5dd080057bc00d2da84ac3fe3f126102.zip | |
Print debug information for SDNodes.
llvm-svn: 103227
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index e6df742bc33..4854ff25f2d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -15,6 +15,7 @@ #include "SDNodeOrdering.h" #include "SDNodeDbgValue.h" #include "llvm/Constants.h" +#include "llvm/Analysis/DebugInfo.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/Function.h" #include "llvm/GlobalAlias.h" @@ -6008,6 +6009,21 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const { if (getNodeId() != -1) OS << " [ID=" << getNodeId() << ']'; + + DebugLoc dl = getDebugLoc(); + if (G && !dl.isUnknown()) { + DIScope + Scope(dl.getScope(G->getMachineFunction().getFunction()->getContext())); + OS << " dbg:"; + // Omit the directory, since it's usually long and uninteresting. + if (Scope.Verify()) + OS << Scope.getFilename(); + else + OS << "<unknown>"; + OS << ':' << dl.getLine(); + if (dl.getCol() != 0) + OS << ':' << dl.getCol(); + } } void SDNode::print(raw_ostream &OS, const SelectionDAG *G) const { |

