[llvm-commits] [llvm] r130339 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfCompileUnit.cpp DwarfCompileUnit.h DwarfDebug.cpp
Sylvere Teissier
st at invia.fr
Thu May 12 07:47:02 PDT 2011
Le 28/04/2011 00:45, Devang Patel a écrit :
> Author: dpatel
> Date: Wed Apr 27 17:45:24 2011
> New Revision: 130339
>
> URL: http://llvm.org/viewvc/llvm-project?rev=130339&view=rev
> Log:
> Simplify handling of variables with complex address (i.e. blocks variables)
>
> Modified:
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Hi, there is something that seems not clear for me here:
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=130339&r1=130338&r2=130339&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Apr 27 17:45:24 2011
> @@ -699,11 +699,19 @@
> const TargetRegisterInfo *TRI = Asm->TM.getRegisterInfo();
> if (DVInsn->getOperand(1).isImm() &&
> TRI->getFrameRegister(*Asm->MF) == RegOp.getReg()) {
> - VariableCU->addFrameVariableAddress(DV, VariableDie,
> - DVInsn->getOperand(1).getImm());
> - updated = true;
> - } else
> - updated = VariableCU->addRegisterAddress(VariableDie, RegOp);
> + unsigned FrameReg = 0;
> + const TargetFrameLowering *TFI = Asm->TM.getFrameLowering();
My question is for this line:
> + int Offset =
> + TFI->getFrameIndexReference(*Asm->MF,
> + DVInsn->getOperand(1).getImm(),
> + FrameReg);
During frame elimination the Target backend function
"RegisterInfo::eliminateFrameIndex" has converted the DVInsn
from something like this:
DBG_VALUE <fi#12>
to something like this:
DBG_VALUE %SP,44
so here :
DVInsn->getOperand(1).getImm()
returns 44
but TFI->getFrameIndexReference FI argument require a frame index ( 12
in this example), not an offset in byte.
Is there something wrong in this code or did I misunderstand something ?
> + MachineLocation Location(FrameReg, Offset);
> + VariableCU->addVariableAddress(DV, VariableDie, Location);
> +
> + } else if (RegOp.getReg())
> + VariableCU->addVariableAddress(DV, VariableDie,
> + MachineLocation(RegOp.getReg()));
> + updated = true;
> }
> else if (DVInsn->getOperand(0).isImm())
>
>
More information about the llvm-commits
mailing list