diff options
author | Chad Rosier <mcrosier@codeaurora.org> | 2016-01-06 14:35:46 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@codeaurora.org> | 2016-01-06 14:35:46 +0000 |
commit | 7dbc9cf8760e07f28cea29e337ff3666624dc91d (patch) | |
tree | 535726e6c08e0a98ffbb3de5e2a3280cc32acaf6 /clang/lib/CodeGen/BackendUtil.cpp | |
parent | 2d0418e842e1635aaff4a642320dfa8fbf7669fd (diff) | |
download | bcm5719-llvm-7dbc9cf8760e07f28cea29e337ff3666624dc91d.tar.gz bcm5719-llvm-7dbc9cf8760e07f28cea29e337ff3666624dc91d.zip |
[Driver] Add support for -fno-builtin-foo options.
Addresses PR4941 and rdar://6756912.
http://reviews.llvm.org/D15195
llvm-svn: 256937
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 82297e7ee41..7032d00386f 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -249,6 +249,13 @@ static TargetLibraryInfoImpl *createTLII(llvm::Triple &TargetTriple, TargetLibraryInfoImpl *TLII = new TargetLibraryInfoImpl(TargetTriple); if (!CodeGenOpts.SimplifyLibCalls) TLII->disableAllFunctions(); + else { + // Disable individual libc/libm calls in TargetLibraryInfo. + LibFunc::Func F; + for (auto &FuncName : CodeGenOpts.getNoBuiltinFuncs()) + if (TLII->getLibFunc(FuncName, F)) + TLII->setUnavailable(F); + } switch (CodeGenOpts.getVecLib()) { case CodeGenOptions::Accelerate: |