From ec304151b74f9254d7029ee4d197ce1f7cbe501a Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 31 Jan 2015 19:27:28 +0000 Subject: Vendor import of llvm RELEASE_360/rc2 tag r227651 (effectively, 3.6.0 RC2): https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_360/rc2@227651 --- lib/Transforms/InstCombine/InstCombineCalls.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Transforms/InstCombine/InstCombineCalls.cpp') diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index dab2c4b47ad6..83b4b82311f2 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1376,6 +1376,10 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { dyn_cast(CS.getCalledValue()->stripPointerCasts()); if (!Callee) return false; + // The prototype of thunks are a lie, don't try to directly call such + // functions. + if (Callee->hasFnAttribute("thunk")) + return false; Instruction *Caller = CS.getInstruction(); const AttributeSet &CallerPAL = CS.getAttributes(); -- cgit v1.2.3