[clang] [Clang][ARM]Ensure both -mno-unaligned-access and -munaligned-access are passed to multilib selection logic (PR #134099)

Peter Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 3 02:05:42 PDT 2025


================
@@ -239,12 +239,10 @@ static void getAArch64MultilibFlags(const Driver &D,
     Result.push_back(BranchProtectionArg->getAsString(Args));
   }
 
-  if (Arg *AlignArg = Args.getLastArg(
-          options::OPT_mstrict_align, options::OPT_mno_strict_align,
-          options::OPT_mno_unaligned_access, options::OPT_munaligned_access)) {
-    if (AlignArg->getOption().matches(options::OPT_mstrict_align) ||
-        AlignArg->getOption().matches(options::OPT_mno_unaligned_access))
-      Result.push_back(AlignArg->getAsString(Args));
+  if (FeatureSet.contains("+strict-align")) {
+    Result.push_back("-mno-unaligned-access");
----------------
smithp35 wrote:

Sorry to be really picky, the LLVM coding standard says to not use braces on single statement if else.  https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements 

With that simple change LGTM too.

https://github.com/llvm/llvm-project/pull/134099


More information about the cfe-commits mailing list