[X86] Pass SelectionDAG into X86ISelAddressMode::dump and on to SDNode::dump.

This prevents a crash in SelectionDAGDumper with -debug when trying to print mem operands if one of the registers in the addressing mode comes from a load.

llvm-svn: 327744
This commit is contained in:
Craig Topper 2018-03-16 21:10:07 +00:00
parent 5a5c33d8b5
commit 25007c4f32
1 changed files with 4 additions and 4 deletions

View File

@ -100,11 +100,11 @@ namespace {
}
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() {
void dump(SelectionDAG *DAG = nullptr) {
dbgs() << "X86ISelAddressMode " << this << '\n';
dbgs() << "Base_Reg ";
if (Base_Reg.getNode())
Base_Reg.getNode()->dump();
Base_Reg.getNode()->dump(DAG);
else
dbgs() << "nul\n";
if (BaseType == FrameIndexBase)
@ -112,7 +112,7 @@ namespace {
dbgs() << " Scale " << Scale << '\n'
<< "IndexReg ";
if (IndexReg.getNode())
IndexReg.getNode()->dump();
IndexReg.getNode()->dump(DAG);
else
dbgs() << "nul\n";
dbgs() << " Disp " << Disp << '\n'
@ -1280,7 +1280,7 @@ bool X86DAGToDAGISel::matchAddressRecursively(SDValue N, X86ISelAddressMode &AM,
SDLoc dl(N);
DEBUG({
dbgs() << "MatchAddress: ";
AM.dump();
AM.dump(CurDAG);
});
// Limit recursion.
if (Depth > 5)