From 25007c4f32521cbc516b785c7a6d6a63240a45e3 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 16 Mar 2018 21:10:07 +0000 Subject: [PATCH] [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 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index 27a1adb..4ff36f0 100644 --- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -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) -- 2.7.4