[PATCH] D140059: [APSInt] Fix bug in APSInt mentioned in https://github.com/llvm/llvm-project/issues/59515

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 10:53:25 PST 2023


efriedma added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:5386
+      if (InitInt)
+        InitExpr = DBuilder.createConstantValueExpression(InitInt.value());
+    } else if (Init.isFloat())
----------------
I think we actually want the existing behavior here.  Values embedded in debug info aren't really signed or unsigned; they're interpreted by the debugger based on the type of the value.

Maybe it makes sense to add a new APSInt API for that?  Or I guess we could explicitly write out `Init.getInt().isSigned() ? Init.getInt().getSExtValue() : Init.getInt().getZExtValue();` if we can't think of a reasonable name for the new API...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140059



More information about the cfe-commits mailing list