aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SimplifyLibCalls.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2012-11-29 09:35:45 -0800
committerDerek Schuff <dschuff@chromium.org>2012-11-29 09:35:45 -0800
commita75f6d81a9d7d19b38120758a4d0445adbfac13b (patch)
treed1961790df7b3aeb5c55e493e3ff3fd094a4476d /lib/Transforms/Utils/SimplifyLibCalls.cpp
parentf9b328eacabf0920770d3ef87bcd5682b10dd502 (diff)
Fix LibCall simplification and ARM EH
Prevent the libcall simplifier from modifying the implementation of libcalls (causes problems when newlib is included in LTO) Use the generic DWARF rather than ARM EH ABI for nacl
Diffstat (limited to 'lib/Transforms/Utils/SimplifyLibCalls.cpp')
-rw-r--r--lib/Transforms/Utils/SimplifyLibCalls.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/SimplifyLibCalls.cpp b/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 2e494fd1bc..6ca1175c41 100644
--- a/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -1594,6 +1594,13 @@ Value *LibCallSimplifierImpl::optimizeCall(CallInst *CI) {
if (Optimizations.empty())
initOptimizations();
+ // @LOCALMOD-BEGIN
+ Function *Caller = CI->getParent()->getParent();
+ LibFunc::Func F = LibFunc::NumLibFuncs;
+ // Don't modify the implementation of known library functions
+ if (TLI->getLibFunc(Caller->getName(), F))
+ return 0;
+ // @LOCALMOD-END
Function *Callee = CI->getCalledFunction();
LibCallOptimization *LCO = Optimizations.lookup(Callee->getName());
if (LCO) {