diff options
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCalls.cpp')
| -rw-r--r-- | lib/Transforms/InstCombine/InstCombineCalls.cpp | 4 | 
1 files changed, 4 insertions, 0 deletions
| 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<Function>(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(); | 
