Print debug information for SDNodes.

llvm-svn: 103227
This commit is contained in:
Dan Gohman 2010-05-07 01:09:21 +00:00
parent 7421ae48bf
commit e7dff14d5d
1 changed files with 16 additions and 0 deletions

View File

@ -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 {