diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-31 18:50:09 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-31 18:50:09 +0000 |
commit | 8480c2e314f6c01638ea16f32149417848352085 (patch) | |
tree | c65328cb1b461ce865bb8082ee75c663a338b348 /lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | d4511e947ee1e89a4f199bfac0d401976930ccfe (diff) | |
download | external_llvm-8480c2e314f6c01638ea16f32149417848352085.zip external_llvm-8480c2e314f6c01638ea16f32149417848352085.tar.gz external_llvm-8480c2e314f6c01638ea16f32149417848352085.tar.bz2 |
Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112623 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index b70bfea..0a33021 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -3917,7 +3917,8 @@ bool SelectionDAGBuilder::EmitFuncArgumentDbgValue(const Value *V, MDNode *Variable, int64_t Offset, const SDValue &N) { - if (!isa<Argument>(V)) + const Argument *Arg = dyn_cast<Argument>(V); + if (!Arg) return false; MachineFunction &MF = DAG.getMachineFunction(); @@ -3931,6 +3932,14 @@ SelectionDAGBuilder::EmitFuncArgumentDbgValue(const Value *V, MDNode *Variable, return false; unsigned Reg = 0; + if (Arg->hasByValAttr()) { + // Byval arguments' frame index is recorded during argument lowering. + // Use this info directly. + const TargetRegisterInfo *TRI = DAG.getTarget().getRegisterInfo(); + Reg = TRI->getFrameRegister(MF); + Offset = FuncInfo.getByValArgumentFrameIndex(Arg); + } + if (N.getNode() && N.getOpcode() == ISD::CopyFromReg) { Reg = cast<RegisterSDNode>(N.getOperand(1))->getReg(); if (Reg && TargetRegisterInfo::isVirtualRegister(Reg)) { @@ -6131,6 +6140,12 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) { i += NumParts; } + // Note down frame index for byval arguments. + if (I->hasByValAttr() && !ArgValues.empty()) + if (FrameIndexSDNode *FI = + dyn_cast<FrameIndexSDNode>(ArgValues[0].getNode())) + FuncInfo->setByValArgumentFrameIndex(I, FI->getIndex()); + if (!I->use_empty()) { SDValue Res; if (!ArgValues.empty()) |