[llvm] r315576 - Reinstantiate old/bad deduplication logic that was removed in r315279.

Daniel Jasper via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 06:25:06 PDT 2017


Author: djasper
Date: Thu Oct 12 06:25:05 2017
New Revision: 315576

URL: http://llvm.org/viewvc/llvm-project?rev=315576&view=rev
Log:
Reinstantiate old/bad deduplication logic that was removed in r315279.

While this shouldn't be necessary anymore, we have cases where we run
into the assertion below, i.e. cases with two non-fragment entries for the
same variable at different frame indices.

This should be fixed, but for now, we should revert to a version that
does not trigger asserts.

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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=315576&r1=315575&r2=315576&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Oct 12 06:25:05 2017
@@ -233,6 +233,16 @@ void DbgVariable::addMMIEntry(const DbgV
   assert(!FrameIndexExprs.empty() && "Expected an MMI entry");
   assert(!V.FrameIndexExprs.empty() && "Expected an MMI entry");
 
+  // FIXME: This logic should not be necessary anymore, as we now have proper
+  // deduplication. However, without it, we currently run into the assertion
+  // below, which means that we are likely dealing with broken input, i.e. two
+  // non-fragment entries for the same variable at different frame indices.
+  if (FrameIndexExprs.size()) {
+    auto *Expr = FrameIndexExprs.back().Expr;
+    if (!Expr || !Expr->isFragment())
+      return;
+  }
+
   for (const auto &FIE : V.FrameIndexExprs)
     // Ignore duplicate entries.
     if (llvm::none_of(FrameIndexExprs, [&](const FrameIndexExpr &Other) {




More information about the llvm-commits mailing list