AsmPrinter: Simplify logic for debug info intrinsics' !dbg attachments
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DbgValueHistoryCalculator.cpp
index af8827cec290b99ba0049f3456f7bf04c14b61b7..1e3c5d769f15071fcaefa19375a173bbc1433050 100644 (file)
@@ -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);