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

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 09:24:35 PDT 2021


SouraVX added a comment.

Thanks for review @dstenb !



================
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};
----------------
dstenb wrote:
> Why do we only care about unsigned constants here?
> 
> (And in the other cases where `isConstant()` is changed to `isUnsignedConstant()`)
Thanks for the question! As noted in the patch summary, we are trying to be conservative here.
Motivation behind this change, Previous code made a check for `isConstant` which sounds/seems ambiguous to me when I introduced `isSignedConstant` so I took the opportunity to make the change conservatively.


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