Implement proper support for `-falign-functions`
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 19 Apr 2018 23:14:57 +0000 (23:14 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 19 Apr 2018 23:14:57 +0000 (23:14 +0000)
commit3fe5b7a497249a5886d437b67e8da3d70b098a4d
treeea34faee7f50c5f41b1f1de379b65d3201ebbb39
parent72da02fc30cd7ce6344107c8b33e48e6322f4d7e
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
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Driver/CC1Options.td
clang/include/clang/Driver/Options.td
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/lib/Driver/ToolChains/CommonArgs.h
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/function-alignment.c [new file with mode: 0644]
clang/test/Driver/clang_f_opts.c
clang/test/Driver/function-alignment.c [new file with mode: 0644]