mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
InstCombine: Don't strip bitcasts off of callsites marked 'thunk'
The return type of a thunk is meaningless, we just want the arguments and return value to be forwarded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226708 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1381,6 +1381,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();
|
||||
|
||||
|
Reference in New Issue
Block a user