diff options
author | Devang Patel <dpatel@apple.com> | 2011-01-07 22:33:41 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-01-07 22:33:41 +0000 |
commit | acbee0b0d9a24d823a7af207762a7aa9ac7bbfd2 (patch) | |
tree | 80b45f0b960ebb12fab396450961244f7affee95 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 39bd6cebcd776ac03889d0a2576ab1dcac5e4b32 (diff) | |
download | bcm5719-llvm-acbee0b0d9a24d823a7af207762a7aa9ac7bbfd2.tar.gz bcm5719-llvm-acbee0b0d9a24d823a7af207762a7aa9ac7bbfd2.zip |
Speculatively revert r123032.
llvm-svn: 123039
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index db03ed954ec..0ebd94a0126 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2257,6 +2257,15 @@ DwarfDebug::collectVariableInfoFromMMITable(const MachineFunction * MF, } } +/// isDbgValueInUndefinedReg - Return true if debug value, encoded by +/// DBG_VALUE instruction, is in undefined reg. +static bool isDbgValueInUndefinedReg(const MachineInstr *MI) { + assert (MI->isDebugValue() && "Invalid DBG_VALUE machine instruction!"); + if (MI->getOperand(0).isReg() && !MI->getOperand(0).getReg()) + return true; + return false; +} + /// isDbgValueInDefinedReg - Return true if debug value, encoded by /// DBG_VALUE instruction, is in a defined reg. static bool isDbgValueInDefinedReg(const MachineInstr *MI) { @@ -2281,7 +2290,7 @@ DwarfDebug::collectVariableInfo(const MachineFunction *MF, for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end(); II != IE; ++II) { const MachineInstr *MInsn = II; - if (!MInsn->isDebugValue()) + if (!MInsn->isDebugValue() || isDbgValueInUndefinedReg(MInsn)) continue; DbgValues.push_back(MInsn); } @@ -2303,18 +2312,19 @@ DwarfDebug::collectVariableInfo(const MachineFunction *MF, ME = DbgValues.end(); MI != ME; ++MI) { const MDNode *Var = (*MI)->getOperand((*MI)->getNumOperands()-1).getMetadata(); - if (Var == DV && + if (Var == DV && isDbgValueInDefinedReg(*MI) && !PrevMI->isIdenticalTo(*MI)) MultipleValues.push_back(*MI); PrevMI = *MI; } - DbgScope *Scope = NULL; + DbgScope *Scope = findDbgScope(MInsn); + bool CurFnArg = false; if (DV.getTag() == dwarf::DW_TAG_arg_variable && DISubprogram(DV.getContext()).describes(MF->getFunction())) + CurFnArg = true; + if (!Scope && CurFnArg) Scope = CurrentFnDbgScope; - else - Scope = findDbgScope(MInsn); // If variable scope is not found then skip this variable. if (!Scope) continue; |