[PATCH] IR: Move the complex address expression field out of DIVariable and into an extra argument of the dbg.declare/dbg.value intrinsics.

David Blaikie dblaikie at gmail.com
Mon Sep 29 14:52:27 PDT 2014


================
Comment at: include/llvm/IR/DebugInfo.h:756
@@ +755,3 @@
+    unsigned N = DbgNode->getNumOperands();
+    return N > 0 ? N-1 : N;
+  }
----------------
When would this ever be zero? Can we just assert that it's not?

(I assume it should be at least 2 - since the expression has to contain some operations, presumably?)

================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1394
@@ -1390,1 +1393,3 @@
+      DIExpression NoExpr;
+      ConcreteVariables.push_back(make_unique<DbgVariable>(DV, NoExpr, this));
       addScopeVariable(Scope, ConcreteVariables.back().get());
----------------
I'd probably just create a DIExpression() inline rather than having a separate variable (when I see it written as a separate variable I wonder if it's an unused out parameter or somesuch). Up to you.

Or consider providing a different ctor for abstract variables that just doesn't take a DIExpression anyway? Not sure.

http://reviews.llvm.org/D4919






More information about the llvm-commits mailing list