Un-break the buildbot by tweaking the indirection flag.
Pulled in a testcase from the debuginfo-test suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185993 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 14a2b00..b4ac948f 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -642,11 +642,17 @@
if (Op)
if (Op->isReg()) {
+ // Set the indirect flag if the type and the DIVariable's
+ // indirect field are in disagreement: Indirectly-addressed
+ // variables that are nonpointer types should be marked as
+ // indirect, and VLAs should be marked as indirect eventhough
+ // they are a pointer type.
+ bool IsIndirect = DI->getAddress()->getType()->isPointerTy()
+ ^ DIVar.isIndirect();
Op->setIsDebug(true);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(TargetOpcode::DBG_VALUE),
- /* IsIndirect */ DI->getAddress()->getType()->isPointerTy(),
- Op->getReg(), Offset, DI->getVariable());
+ IsIndirect, Op->getReg(), Offset, DI->getVariable());
} else
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(TargetOpcode::DBG_VALUE)).addOperand(*Op).addImm(0)