aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-08-31 18:50:09 +0000
committerDevang Patel <dpatel@apple.com>2010-08-31 18:50:09 +0000
commit8480c2e314f6c01638ea16f32149417848352085 (patch)
treec65328cb1b461ce865bb8082ee75c663a338b348 /lib/CodeGen/AsmPrinter
parentd4511e947ee1e89a4f199bfac0d401976930ccfe (diff)
downloadexternal_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/AsmPrinter')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index eaa12d4..eeae8a3 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1629,9 +1629,16 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
bool updated = false;
// FIXME : Handle getNumOperands != 3
if (DVInsn->getNumOperands() == 3) {
- if (DVInsn->getOperand(0).isReg())
- updated =
- addRegisterAddress(VariableDie, DVLabel, DVInsn->getOperand(0));
+ if (DVInsn->getOperand(0).isReg()) {
+ const MachineOperand RegOp = DVInsn->getOperand(0);
+ const TargetRegisterInfo *TRI = Asm->TM.getRegisterInfo();
+ if (DVInsn->getOperand(1).isImm() &&
+ TRI->getFrameRegister(*Asm->MF) == RegOp.getReg()) {
+ addVariableAddress(DV, VariableDie, DVInsn->getOperand(1).getImm());
+ updated = true;
+ } else
+ updated = addRegisterAddress(VariableDie, DVLabel, RegOp);
+ }
else if (DVInsn->getOperand(0).isImm())
updated = addConstantValue(VariableDie, DVLabel, DVInsn->getOperand(0));
else if (DVInsn->getOperand(0).isFPImm())