[PATCH] D93628: [clang] NFC: Refactor custom class into a lambda in CompilerInvocation

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 22 05:45:08 PST 2020


jansvoboda11 added inline comments.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:176
+static auto makeFlagToValueNormalizer(T Value) {
+  return makeFlagToValueNormalizer(uint64_t(Value));
 }
----------------
dexonsmith wrote:
> (not a behaviour change but) I wonder if this correct for signed types, where the conversion back to `T` could change sign if it's a negative value. Should there be an assertion that the value is `>= 0`? (Probably to do separately / outside this patch)
It might be good to be defensive here. I'll put that into a follow-up.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93628



More information about the cfe-commits mailing list