[llvm] r235138 - AsmPrinter: Simplify logic for debug info intrinsics' !dbg attachments

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Apr 16 15:12:59 PDT 2015


Author: dexonsmith
Date: Thu Apr 16 17:12:59 2015
New Revision: 235138

URL: http://llvm.org/viewvc/llvm-project?rev=235138&view=rev
Log:
AsmPrinter: Simplify logic for debug info intrinsics' !dbg attachments

These are required, so just assume they're there.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp?rev=235138&r1=235137&r2=235138&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp Thu Apr 16 17:12:59 2015
@@ -207,10 +207,7 @@ void llvm::calculateDbgValueHistory(cons
       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);

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=235138&r1=235137&r2=235138&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Apr 16 17:12:59 2015
@@ -711,7 +711,10 @@ void DwarfDebug::collectVariableInfoFrom
   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::collectVariableInfoFrom
     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 =

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=235138&r1=235137&r2=235138&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Thu Apr 16 17:12:59 2015
@@ -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.





More information about the llvm-commits mailing list