[PATCH] D102220: [NFC, CFI] Use unsigned type for CFI register values in parser/streamer code

Venkata Ramanaiah Nalamothu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 01:58:00 PDT 2021


RamNalamothu marked 7 inline comments as done.
RamNalamothu added a comment.

In D102220#2752089 <https://reviews.llvm.org/D102220#2752089>, @scott.linder wrote:

> Would it be reasonable to just clean up all the types in these functions? I noted the ones I identified.

Since these are virtual interfaces and will need changes in other places as well, I would defer that to an another patch.



================
Comment at: llvm/lib/MC/MCParser/AsmParser.cpp:1534
+
+  Res = static_cast<uint64_t>(Value);
+
----------------
scott.linder wrote:
> The `Absolute` in this case is just referring to "not relative", right? The `Res` value from `evaluateAsAbsolute` may be negative, and this cast will result in some large unsigned value for that case.
> 
> Maybe we just add an `assert(Value > 0)`? Or as you note a variant of `evaluateAsAbsolute` for `unsigned` which does the check could work.
I went ahead with an `assert`. Thank you.

For this patch, I feel it is a good point to stop here before getting into `MCExpr` and changing all variants of `evaluateAsAbsolute()` and probably parts of the interfacing code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102220



More information about the llvm-commits mailing list