[PATCH] D101640: [clang][patch] Add support for option -fextend-arguments={32,64}: widen integer arguments to int64 in unprototyped function calls

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 4 06:22:58 PDT 2021


jansvoboda11 added a comment.

Nice, that looks better. I think we can optimize it a tad by introducing an enum with two cases and store that in `LangOptions` instead of a 32-bit number.



================
Comment at: clang/include/clang/Basic/LangOptions.def:417
 
+COMPATIBLE_VALUE_LANGOPT(ExtendIntArgs, 32, 32, 
+                   "Controls how scalar integer arguments are extended in calls"
----------------
Since we're accepting only two values (either `32` or `64`), we can define an enum for those values and reduce size of this member from 32 bits to just 1.


================
Comment at: clang/include/clang/Driver/Options.td:1435
+  Values<"32,64">,
+  MarshallingInfoInt<LangOpts<"ExtendIntArgs">>;
 def fbracket_depth_EQ : Joined<["-"], "fbracket-depth=">, Group<f_Group>, Flags<[CoreOption]>;
----------------
The `MarshallingInfoEnum` multiclass can be used instead ([[ https://clang.llvm.org/docs/InternalsManual.html#option-marshalling-annotations | docs ]]).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101640



More information about the cfe-commits mailing list