summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2018-04-19 23:14:57 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2018-04-19 23:14:57 +0000
commit3fe5b7a497249a5886d437b67e8da3d70b098a4d (patch)
treeea34faee7f50c5f41b1f1de379b65d3201ebbb39 /clang/lib/Frontend/CompilerInvocation.cpp
parent72da02fc30cd7ce6344107c8b33e48e6322f4d7e (diff)
downloadbcm5719-llvm-3fe5b7a497249a5886d437b67e8da3d70b098a4d.tar.gz
bcm5719-llvm-3fe5b7a497249a5886d437b67e8da3d70b098a4d.zip
Implement proper support for `-falign-functions`
This implements support for the previously ignored flag `-falign-functions`. This allows the frontend to request alignment on function definitions in the translation unit where they are not explicitly requested in code. This is compatible with the GCC behaviour and the ICC behaviour. The scalar value passed to `-falign-functions` aligns functions to a power-of-two boundary. If flag is used, the functions are aligned to 16-byte boundaries. If the scalar is specified, it must be an integer less than or equal to 4096. If the value is not a power-of-two, the driver will round it up to the nearest power of two. llvm-svn: 330378
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 9146d2a36df..67e15b41add 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2968,6 +2968,9 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
LangOpts.ObjCExceptions = 1;
}
+ LangOpts.FunctionAlignment =
+ getLastArgIntValue(Args, OPT_function_alignment, 0, Diags);
+
if (LangOpts.CUDA) {
// During CUDA device-side compilation, the aux triple is the
// triple used for host compilation.
OpenPOWER on IntegriCloud