diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-26 22:53:27 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-26 22:53:27 +0000 |
commit | 6cd467bd0e31df2decdf7081868810ef822b64d3 (patch) | |
tree | cb74807cc97bcd3ddedc96a6e78669cec5a5c173 /lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 700f5df518452162de7dda7461917f88e8f4c56e (diff) | |
download | external_llvm-6cd467bd0e31df2decdf7081868810ef822b64d3.zip external_llvm-6cd467bd0e31df2decdf7081868810ef822b64d3.tar.gz external_llvm-6cd467bd0e31df2decdf7081868810ef822b64d3.tar.bz2 |
If node is not available then use FuncInfo.ValueMap to emit debug info for byval parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112238 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index b78a4fc..5b4cc2f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -3947,7 +3947,7 @@ SelectionDAGBuilder::EmitFuncArgumentDbgValue(const Value *V, MDNode *Variable, return false; unsigned Reg = 0; - if (N.getOpcode() == ISD::CopyFromReg) { + if (N.getNode() && N.getOpcode() == ISD::CopyFromReg) { Reg = cast<RegisterSDNode>(N.getOperand(1))->getReg(); if (Reg && TargetRegisterInfo::isVirtualRegister(Reg)) { MachineRegisterInfo &RegInfo = MF.getRegInfo(); @@ -4111,10 +4111,14 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { return 0; DAG.AddDbgValue(SDV, N.getNode(), isParameter); } else { - // This isn't useful, but it shows what we're missing. - SDV = DAG.getDbgValue(Variable, UndefValue::get(Address->getType()), - 0, dl, SDNodeOrder); - DAG.AddDbgValue(SDV, 0, isParameter); + // If Address is an arugment then try to emits its dbg value using + // virtual register info from the FuncInfo.ValueMap. Otherwise add undef + // to help track missing debug info. + if (!EmitFuncArgumentDbgValue(Address, Variable, 0, N)) { + SDV = DAG.getDbgValue(Variable, UndefValue::get(Address->getType()), + 0, dl, SDNodeOrder); + DAG.AddDbgValue(SDV, 0, isParameter); + } } return 0; } |