diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-16 22:12:59 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-16 22:12:59 +0000 |
| commit | 78a95270624e16ea4bf1a6d6224e32db0fdd6a07 (patch) | |
| tree | 9665345eee57f20982f3d5e1035c10f2144864e3 /llvm | |
| parent | 54fff4c9e258b58833083e8171730a0e7818d166 (diff) | |
| download | bcm5719-llvm-78a95270624e16ea4bf1a6d6224e32db0fdd6a07.tar.gz bcm5719-llvm-78a95270624e16ea4bf1a6d6224e32db0fdd6a07.zip | |
AsmPrinter: Simplify logic for debug info intrinsics' !dbg attachments
These are required, so just assume they're there.
llvm-svn: 235138
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 5 |
3 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp b/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp index af8827cec29..1e3c5d769f1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp @@ -207,10 +207,7 @@ void llvm::calculateDbgValueHistory(const MachineFunction *MF, MDLocalVariable *RawVar = MI.getDebugVariable(); assert(RawVar->isValidLocationForIntrinsic(MI.getDebugLoc()) && "Expected inlined-at fields to agree"); - MDLocation *IA = nullptr; - if (MDLocation *Loc = MI.getDebugLoc()) - IA = Loc->getInlinedAt(); - InlinedVariable Var(RawVar, IA); + InlinedVariable Var(RawVar, MI.getDebugLoc()->getInlinedAt()); if (unsigned PrevReg = Result.getRegisterForVar(Var)) dropRegDescribedVar(RegVars, PrevReg, Var); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 97c9855fe14..fb8fc6e7545 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -711,7 +711,10 @@ void DwarfDebug::collectVariableInfoFromMMITable( for (const auto &VI : MMI->getVariableDbgInfo()) { if (!VI.Var) continue; - InlinedVariable Var(VI.Var, VI.Loc ? VI.Loc->getInlinedAt() : nullptr); + assert(VI.Var->isValidLocationForIntrinsic(VI.Loc) && + "Expected inlined-at fields to agree"); + + InlinedVariable Var(VI.Var, VI.Loc->getInlinedAt()); Processed.insert(Var); LexicalScope *Scope = LScopes.findLexicalScope(VI.Loc); @@ -719,8 +722,6 @@ void DwarfDebug::collectVariableInfoFromMMITable( if (!Scope) continue; - assert(VI.Var->isValidLocationForIntrinsic(VI.Loc) && - "Expected inlined-at fields to agree"); DIExpression Expr = cast_or_null<MDExpression>(VI.Expr); ensureAbstractVariableIsCreatedIfScoped(Var, Scope->getScopeNode()); auto RegVar = diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index 809e7bdde10..e067f41904c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -98,13 +98,10 @@ public: /// AbstractVar may be NULL. DbgVariable(const MachineInstr *DbgValue, DwarfDebug *DD) : Var(DbgValue->getDebugVariable()), - IA(DbgValue->getDebugLoc() ? DbgValue->getDebugLoc()->getInlinedAt() - : nullptr), + IA(DbgValue->getDebugLoc()->getInlinedAt()), Expr(1, DbgValue->getDebugExpression()), TheDIE(nullptr), DotDebugLocOffset(~0U), MInsn(DbgValue), DD(DD) { FrameIndex.push_back(~0); - if (MDLocation *Loc = DbgValue->getDebugLoc()) - IA = Loc->getInlinedAt(); } // Accessors. |

