[clang] [Driver] Pass correct alignment for -falign-functions with no argument (PR #101257)

Paul T Robinson via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 30 15:41:55 PDT 2024


================
@@ -1982,7 +1982,7 @@ unsigned tools::ParseFunctionAlignment(const ToolChain &TC,
     return 0;
 
   if (A->getOption().matches(options::OPT_falign_functions))
-    return 0;
+    return 4; // log2(16)
----------------
pogo59 wrote:

Ah, I should have said "the commentary" on ParseFunctionAlignment, which does say that no argument means 16.
Which documentation are you quoting? I don't see this option described in [the clang user manual](https://clang.llvm.org/docs/UsersManual.html).

I'm not aware that the driver, or clang generally, knows about preferred alignment by target, but I guess we can invent a parameter for that.

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


More information about the cfe-commits mailing list