aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2022-04-14 10:50:26 +0200
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2022-04-19 21:22:07 +0200
commit0f8c626723d2bbd547e78dcab5ab260dfbc437e1 (patch)
tree7d44d9d4bc601d2dda91dab7aa3076ee08968c6a /clang/lib/Frontend/CompilerInvocation.cpp
parent8a9c70fc01e6c900f060f3c23d96ee444be33a9a (diff)
downloadllvm-0f8c626723d2bbd547e78dcab5ab260dfbc437e1.zip
llvm-0f8c626723d2bbd547e78dcab5ab260dfbc437e1.tar.gz
llvm-0f8c626723d2bbd547e78dcab5ab260dfbc437e1.tar.bz2
[BuildLibCalls] Introduce getOrInsertLibFunc() for use when building libcalls.
A new set of overloaded functions named getOrInsertLibFunc() are now supposed to be used instead of getOrInsertFunction() when building a libcall from within an LLVM optimizer(). The idea is that this new function also makes sure that any mandatory argument attributes are added to the function prototype (after calling getOrInsertFunction()). inferLibFuncAttributes() is renamed to inferNonMandatoryLibFuncAttrs() as it only adds attributes that are not necessary for correctness but merely helping with later optimizations. Generally, the front end is responsible for building a correct function prototype with the needed argument attributes. If the middle end however is the one creating the call, e.g. when replacing one libcall with another, it then must take this responsibility. This continues the work of properly handling argument extension if required by the target ABI when building a lib call. getOrInsertLibFunc() now does this for all libcalls currently built by any LLVM optimizer. It is expected that when in the future a new optimization builds a new libcall with an integer argument it is to be added to getOrInsertLibFunc() with the proper handling. Note that not all targets have it in their ABI to sign/zero extend integer arguments to the full register width, but this will be done selectively as determined by getExtAttrForI32Param(). Review: Eli Friedman, Nikita Popov, Dávid Bolvanský Differential Revision: https://reviews.llvm.org/D123198
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions