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

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 30 15:31:45 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)
----------------
compnerd wrote:

This is not true. Quoting the documentation:

```
If n is not specified or is zero, use a machine-dependent default. The maximum allowed n option value is 65536.
```

16 is a reasonable default for X86, but I don't think that it universally makes sense. Can we switch based on the architecture and continue to return a default of `0`?

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


More information about the cfe-commits mailing list