[PATCH] D99273: [DebugInfo] Support for signed constants inside DIExpression

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 09:13:58 PDT 2021


dstenb added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:3052
       // Emit constant global variables in a global symbol section.
-      if (GlobalMap.count(GVE) == 0 && DIE->isConstant()) {
+      if (GlobalMap.count(GVE) == 0 && DIE->isUnsignedConstant()) {
         CVGlobalVariable CVGV = {DIGV, DIE};
----------------
Why do we only care about unsigned constants here?

(And in the other cases where `isConstant()` is changed to `isUnsignedConstant()`)


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:216
+    if (GlobalExprs.size() == 1 && Expr &&
+        (Expr->isUnsignedConstant() || Expr->isSignedConstant())) {
       addToAccelTable = true;
----------------
Can we make a `isConstant()` function in `DIExpression` that wraps these two?


================
Comment at: llvm/lib/IR/DebugInfoMetadata.cpp:1472
+       getElement(2) != dwarf::DW_OP_stack_value))
     return false;
   return true;
----------------
Why do we not allow fragmented expressions here but we do for the unsigned variant?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99273/new/

https://reviews.llvm.org/D99273



More information about the llvm-commits mailing list