diff options
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 13 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp | 68 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPULibFunc.h | 4 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/Mips16HardFloat.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 13 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86WinEHState.cpp | 16 |
9 files changed, 68 insertions, 71 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 03a3dacb76f..31a6e7e7c9f 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -11748,13 +11748,12 @@ void AArch64TargetLowering::insertSSPDeclarations(Module &M) const { Type::getInt8PtrTy(M.getContext())); // MSVC CRT has a function to validate security cookie. - FunctionCallee SecurityCheckCookie = M.getOrInsertFunction( - "__security_check_cookie", Type::getVoidTy(M.getContext()), - Type::getInt8PtrTy(M.getContext())); - if (Function *F = dyn_cast<Function>(SecurityCheckCookie.getCallee())) { - F->setCallingConv(CallingConv::Win64); - F->addAttribute(1, Attribute::AttrKind::InReg); - } + auto *SecurityCheckCookie = cast<Function>( + M.getOrInsertFunction("__security_check_cookie", + Type::getVoidTy(M.getContext()), + Type::getInt8PtrTy(M.getContext()))); + SecurityCheckCookie->setCallingConv(CallingConv::Win64); + SecurityCheckCookie->addAttribute(1, Attribute::AttrKind::InReg); return; } TargetLowering::insertSSPDeclarations(M); diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp index f259f8311ec..1fbaae2ba33 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp @@ -72,7 +72,7 @@ private: // Return a pointer (pointer expr) to the function if function defintion with // "FuncName" exists. It may create a new function prototype in pre-link mode. - FunctionCallee getFunction(Module *M, const FuncInfo &fInfo); + Constant *getFunction(Module *M, const FuncInfo& fInfo); // Replace a normal function with its native version. bool replaceWithNative(CallInst *CI, const FuncInfo &FInfo); @@ -139,7 +139,7 @@ private: // Insert an Alloc instruction. AllocaInst* insertAlloca(CallInst * UI, IRBuilder<> &B, const char *prefix); // Get a scalar native builtin signle argument FP function - FunctionCallee getNativeFunction(Module *M, const FuncInfo &FInfo); + Constant* getNativeFunction(Module* M, const FuncInfo &FInfo); protected: CallInst *CI; @@ -216,19 +216,19 @@ INITIALIZE_PASS(AMDGPUUseNativeCalls, "amdgpu-usenative", false, false) template <typename IRB> -static CallInst *CreateCallEx(IRB &B, FunctionCallee Callee, Value *Arg, +static CallInst *CreateCallEx(IRB &B, Value *Callee, Value *Arg, const Twine &Name = "") { CallInst *R = B.CreateCall(Callee, Arg, Name); - if (Function *F = dyn_cast<Function>(Callee.getCallee())) + if (Function* F = dyn_cast<Function>(Callee)) R->setCallingConv(F->getCallingConv()); return R; } template <typename IRB> -static CallInst *CreateCallEx2(IRB &B, FunctionCallee Callee, Value *Arg1, - Value *Arg2, const Twine &Name = "") { +static CallInst *CreateCallEx2(IRB &B, Value *Callee, Value *Arg1, Value *Arg2, + const Twine &Name = "") { CallInst *R = B.CreateCall(Callee, {Arg1, Arg2}, Name); - if (Function *F = dyn_cast<Function>(Callee.getCallee())) + if (Function* F = dyn_cast<Function>(Callee)) R->setCallingConv(F->getCallingConv()); return R; } @@ -471,7 +471,7 @@ static inline AMDGPULibFunc::EType getArgType(const AMDGPULibFunc& FInfo) { return (AMDGPULibFunc::EType)FInfo.getLeads()[0].ArgType; } -FunctionCallee AMDGPULibCalls::getFunction(Module *M, const FuncInfo &fInfo) { +Constant *AMDGPULibCalls::getFunction(Module *M, const FuncInfo& fInfo) { // If we are doing PreLinkOpt, the function is external. So it is safe to // use getOrInsertFunction() at this stage. @@ -518,11 +518,11 @@ bool AMDGPULibCalls::sincosUseNative(CallInst *aCI, const FuncInfo &FInfo) { nf.setPrefix(AMDGPULibFunc::NATIVE); nf.setId(AMDGPULibFunc::EI_SIN); - FunctionCallee sinExpr = getFunction(M, nf); + Constant *sinExpr = getFunction(M, nf); nf.setPrefix(AMDGPULibFunc::NATIVE); nf.setId(AMDGPULibFunc::EI_COS); - FunctionCallee cosExpr = getFunction(M, nf); + Constant *cosExpr = getFunction(M, nf); if (sinExpr && cosExpr) { Value *sinval = CallInst::Create(sinExpr, opr0, "splitsin", aCI); Value *cosval = CallInst::Create(cosExpr, opr0, "splitcos", aCI); @@ -554,7 +554,7 @@ bool AMDGPULibCalls::useNative(CallInst *aCI) { return sincosUseNative(aCI, FInfo); FInfo.setPrefix(AMDGPULibFunc::NATIVE); - FunctionCallee F = getFunction(aCI->getModule(), FInfo); + Constant *F = getFunction(aCI->getModule(), FInfo); if (!F) return false; @@ -612,7 +612,7 @@ bool AMDGPULibCalls::fold_read_write_pipe(CallInst *CI, IRBuilder<> &B, auto *FTy = FunctionType::get(Callee->getReturnType(), ArrayRef<Type *>(ArgTys), false); AMDGPULibFunc NewLibFunc(Name, FTy); - FunctionCallee F = AMDGPULibFunc::getOrInsertFunction(M, NewLibFunc); + auto *F = AMDGPULibFunc::getOrInsertFunction(M, NewLibFunc); if (!F) return false; @@ -794,7 +794,7 @@ bool AMDGPULibCalls::replaceWithNative(CallInst *CI, const FuncInfo &FInfo) { AMDGPULibFunc nf = FInfo; nf.setPrefix(AMDGPULibFunc::NATIVE); - if (FunctionCallee FPExpr = getFunction(M, nf)) { + if (Constant *FPExpr = getFunction(M, nf)) { LLVM_DEBUG(dbgs() << "AMDIC: " << *CI << " ---> "); CI->setCalledFunction(FPExpr); @@ -933,10 +933,9 @@ bool AMDGPULibCalls::fold_pow(CallInst *CI, IRBuilder<> &B, if (CF && (CF->isExactlyValue(0.5) || CF->isExactlyValue(-0.5))) { // pow[r](x, [-]0.5) = sqrt(x) bool issqrt = CF->isExactlyValue(0.5); - if (FunctionCallee FPExpr = - getFunction(M, AMDGPULibFunc(issqrt ? AMDGPULibFunc::EI_SQRT - : AMDGPULibFunc::EI_RSQRT, - FInfo))) { + if (Constant *FPExpr = getFunction(M, + AMDGPULibFunc(issqrt ? AMDGPULibFunc::EI_SQRT + : AMDGPULibFunc::EI_RSQRT, FInfo))) { LLVM_DEBUG(errs() << "AMDIC: " << *CI << " ---> " << FInfo.getName().c_str() << "(" << *opr0 << ")\n"); Value *nval = CreateCallEx(B,FPExpr, opr0, issqrt ? "__pow2sqrt" @@ -1003,8 +1002,8 @@ bool AMDGPULibCalls::fold_pow(CallInst *CI, IRBuilder<> &B, // powr ---> exp2(y * log2(x)) // pown/pow ---> powr(fabs(x), y) | (x & ((int)y << 31)) - FunctionCallee ExpExpr = - getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_EXP2, FInfo)); + Constant *ExpExpr = getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_EXP2, + FInfo)); if (!ExpExpr) return false; @@ -1090,8 +1089,8 @@ bool AMDGPULibCalls::fold_pow(CallInst *CI, IRBuilder<> &B, Value *nval; if (needabs) { - FunctionCallee AbsExpr = - getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_FABS, FInfo)); + Constant *AbsExpr = getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_FABS, + FInfo)); if (!AbsExpr) return false; nval = CreateCallEx(B, AbsExpr, opr0, "__fabs"); @@ -1099,8 +1098,8 @@ bool AMDGPULibCalls::fold_pow(CallInst *CI, IRBuilder<> &B, nval = cnval ? cnval : opr0; } if (needlog) { - FunctionCallee LogExpr = - getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_LOG2, FInfo)); + Constant *LogExpr = getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_LOG2, + FInfo)); if (!LogExpr) return false; nval = CreateCallEx(B,LogExpr, nval, "__log2"); @@ -1159,8 +1158,8 @@ bool AMDGPULibCalls::fold_rootn(CallInst *CI, IRBuilder<> &B, std::vector<const Type*> ParamsTys; ParamsTys.push_back(opr0->getType()); Module *M = CI->getModule(); - if (FunctionCallee FPExpr = - getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_SQRT, FInfo))) { + if (Constant *FPExpr = getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_SQRT, + FInfo))) { LLVM_DEBUG(errs() << "AMDIC: " << *CI << " ---> sqrt(" << *opr0 << ")\n"); Value *nval = CreateCallEx(B,FPExpr, opr0, "__rootn2sqrt"); replaceCall(nval); @@ -1168,8 +1167,8 @@ bool AMDGPULibCalls::fold_rootn(CallInst *CI, IRBuilder<> &B, } } else if (ci_opr1 == 3) { // rootn(x, 3) = cbrt(x) Module *M = CI->getModule(); - if (FunctionCallee FPExpr = - getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_CBRT, FInfo))) { + if (Constant *FPExpr = getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_CBRT, + FInfo))) { LLVM_DEBUG(errs() << "AMDIC: " << *CI << " ---> cbrt(" << *opr0 << ")\n"); Value *nval = CreateCallEx(B,FPExpr, opr0, "__rootn2cbrt"); replaceCall(nval); @@ -1186,8 +1185,8 @@ bool AMDGPULibCalls::fold_rootn(CallInst *CI, IRBuilder<> &B, std::vector<const Type*> ParamsTys; ParamsTys.push_back(opr0->getType()); Module *M = CI->getModule(); - if (FunctionCallee FPExpr = - getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_RSQRT, FInfo))) { + if (Constant *FPExpr = getFunction(M, AMDGPULibFunc(AMDGPULibFunc::EI_RSQRT, + FInfo))) { LLVM_DEBUG(errs() << "AMDIC: " << *CI << " ---> rsqrt(" << *opr0 << ")\n"); Value *nval = CreateCallEx(B,FPExpr, opr0, "__rootn2rsqrt"); @@ -1243,8 +1242,7 @@ bool AMDGPULibCalls::fold_fma_mad(CallInst *CI, IRBuilder<> &B, } // Get a scalar native builtin signle argument FP function -FunctionCallee AMDGPULibCalls::getNativeFunction(Module *M, - const FuncInfo &FInfo) { +Constant* AMDGPULibCalls::getNativeFunction(Module* M, const FuncInfo& FInfo) { if (getArgType(FInfo) == AMDGPULibFunc::F64 || !HasNative(FInfo.getId())) return nullptr; FuncInfo nf = FInfo; @@ -1257,8 +1255,8 @@ bool AMDGPULibCalls::fold_sqrt(CallInst *CI, IRBuilder<> &B, const FuncInfo &FInfo) { if (getArgType(FInfo) == AMDGPULibFunc::F32 && (getVecSize(FInfo) == 1) && (FInfo.getPrefix() != AMDGPULibFunc::NATIVE)) { - if (FunctionCallee FPExpr = getNativeFunction( - CI->getModule(), AMDGPULibFunc(AMDGPULibFunc::EI_SQRT, FInfo))) { + if (Constant *FPExpr = getNativeFunction( + CI->getModule(), AMDGPULibFunc(AMDGPULibFunc::EI_SQRT, FInfo))) { Value *opr0 = CI->getArgOperand(0); LLVM_DEBUG(errs() << "AMDIC: " << *CI << " ---> " << "sqrt(" << *opr0 << ")\n"); @@ -1335,7 +1333,7 @@ bool AMDGPULibCalls::fold_sincos(CallInst *CI, IRBuilder<> &B, // function. AMDGPULibFunc nf(AMDGPULibFunc::EI_SINCOS, fInfo); nf.getLeads()[0].PtrKind = AMDGPULibFunc::getEPtrKindFromAddrSpace(AMDGPUAS::FLAT_ADDRESS); - FunctionCallee Fsincos = getFunction(M, nf); + Function *Fsincos = dyn_cast_or_null<Function>(getFunction(M, nf)); if (!Fsincos) return false; BasicBlock::iterator ItOld = B.GetInsertPoint(); @@ -1343,7 +1341,7 @@ bool AMDGPULibCalls::fold_sincos(CallInst *CI, IRBuilder<> &B, B.SetInsertPoint(UI); Value *P = Alloc; - Type *PTy = Fsincos.getFunctionType()->getParamType(1); + Type *PTy = Fsincos->getFunctionType()->getParamType(1); // The allocaInst allocates the memory in private address space. This need // to be bitcasted to point to the address space of cos pointer type. // In OpenCL 2.0 this is generic, while in 1.2 that is private. diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp index 09322594dc8..569895c25cb 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp @@ -960,8 +960,8 @@ Function *AMDGPULibFunc::getFunction(Module *M, const AMDGPULibFunc &fInfo) { return nullptr; } -FunctionCallee AMDGPULibFunc::getOrInsertFunction(Module *M, - const AMDGPULibFunc &fInfo) { +Function *AMDGPULibFunc::getOrInsertFunction(Module *M, + const AMDGPULibFunc &fInfo) { std::string const FuncName = fInfo.mangle(); Function *F = dyn_cast_or_null<Function>( M->getValueSymbolTable().lookup(FuncName)); @@ -987,7 +987,7 @@ FunctionCallee AMDGPULibFunc::getOrInsertFunction(Module *M, } } - FunctionCallee C; + Constant *C = nullptr; if (hasPtr) { // Do not set extra attributes for functions with pointer arguments. C = M->getOrInsertFunction(FuncName, FuncTy); @@ -1001,7 +1001,7 @@ FunctionCallee AMDGPULibFunc::getOrInsertFunction(Module *M, C = M->getOrInsertFunction(FuncName, FuncTy, Attr); } - return C; + return cast<Function>(C); } bool UnmangledFuncInfo::lookup(StringRef Name, ID &Id) { diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibFunc.h b/llvm/lib/Target/AMDGPU/AMDGPULibFunc.h index 2354ed7df20..972ccb47fc7 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULibFunc.h +++ b/llvm/lib/Target/AMDGPU/AMDGPULibFunc.h @@ -393,8 +393,8 @@ public: } static Function *getFunction(llvm::Module *M, const AMDGPULibFunc &fInfo); - static FunctionCallee getOrInsertFunction(llvm::Module *M, - const AMDGPULibFunc &fInfo); + static Function *getOrInsertFunction(llvm::Module *M, + const AMDGPULibFunc &fInfo); static bool parse(StringRef MangledName, AMDGPULibFunc &Ptr); private: diff --git a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp index 42cd4f6f691..02e2c50ddf6 100644 --- a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp +++ b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp @@ -2253,8 +2253,10 @@ CleanupAndExit: Type *Int32PtrTy = Type::getInt32PtrTy(Ctx); Type *VoidTy = Type::getVoidTy(Ctx); Module *M = Func->getParent(); - FunctionCallee Fn = M->getOrInsertFunction( - HexagonVolatileMemcpyName, VoidTy, Int32PtrTy, Int32PtrTy, Int32Ty); + Constant *CF = M->getOrInsertFunction(HexagonVolatileMemcpyName, VoidTy, + Int32PtrTy, Int32PtrTy, Int32Ty); + Function *Fn = cast<Function>(CF); + Fn->setLinkage(Function::ExternalLinkage); const SCEV *OneS = SE->getConstant(Int32Ty, 1); const SCEV *BECount32 = SE->getTruncateOrZeroExtend(BECount, Int32Ty); diff --git a/llvm/lib/Target/Mips/Mips16HardFloat.cpp b/llvm/lib/Target/Mips/Mips16HardFloat.cpp index e9a3c7ec4b1..1b403f6c6ac 100644 --- a/llvm/lib/Target/Mips/Mips16HardFloat.cpp +++ b/llvm/lib/Target/Mips/Mips16HardFloat.cpp @@ -414,7 +414,7 @@ static bool fixupFPReturnAndCall(Function &F, Module *M, Attribute::ReadNone); A = A.addAttribute(C, AttributeList::FunctionIndex, Attribute::NoInline); - FunctionCallee F = (M->getOrInsertFunction(Name, A, MyVoid, T)); + Value *F = (M->getOrInsertFunction(Name, A, MyVoid, T)); CallInst::Create(F, Params, "", &I); } else if (const CallInst *CI = dyn_cast<CallInst>(&I)) { FunctionType *FT = CI->getFunctionType(); diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp index acfe49a0043..97f62f94dde 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp @@ -109,11 +109,10 @@ bool LowerGlobalDtors::runOnModule(Module &M) { FunctionType::get(Type::getVoidTy(C), AtExitFuncArgs, /*isVarArg=*/false); - FunctionCallee AtExit = M.getOrInsertFunction( - "__cxa_atexit", - FunctionType::get(Type::getInt32Ty(C), - {PointerType::get(AtExitFuncTy, 0), VoidStar, VoidStar}, - /*isVarArg=*/false)); + Type *AtExitArgs[] = {PointerType::get(AtExitFuncTy, 0), VoidStar, VoidStar}; + FunctionType *AtExitTy = FunctionType::get(Type::getInt32Ty(C), AtExitArgs, + /*isVarArg=*/false); + Constant *AtExit = M.getOrInsertFunction("__cxa_atexit", AtExitTy); // Declare __dso_local. Constant *DsoHandle = M.getNamedValue("__dso_handle"); diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index cc00970569e..353547c0dff 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -2279,13 +2279,12 @@ void X86TargetLowering::insertSSPDeclarations(Module &M) const { Type::getInt8PtrTy(M.getContext())); // MSVC CRT has a function to validate security cookie. - FunctionCallee SecurityCheckCookie = M.getOrInsertFunction( - "__security_check_cookie", Type::getVoidTy(M.getContext()), - Type::getInt8PtrTy(M.getContext())); - if (Function *F = dyn_cast<Function>(SecurityCheckCookie.getCallee())) { - F->setCallingConv(CallingConv::X86_FastCall); - F->addAttribute(1, Attribute::AttrKind::InReg); - } + auto *SecurityCheckCookie = cast<Function>( + M.getOrInsertFunction("__security_check_cookie", + Type::getVoidTy(M.getContext()), + Type::getInt8PtrTy(M.getContext()))); + SecurityCheckCookie->setCallingConv(CallingConv::X86_FastCall); + SecurityCheckCookie->addAttribute(1, Attribute::AttrKind::InReg); return; } // glibc, bionic, and Fuchsia have a special slot for the stack guard. diff --git a/llvm/lib/Target/X86/X86WinEHState.cpp b/llvm/lib/Target/X86/X86WinEHState.cpp index d302d34e2c3..65d93b61f93 100644 --- a/llvm/lib/Target/X86/X86WinEHState.cpp +++ b/llvm/lib/Target/X86/X86WinEHState.cpp @@ -86,15 +86,15 @@ private: StructType *EHLinkRegistrationTy = nullptr; StructType *CXXEHRegistrationTy = nullptr; StructType *SEHRegistrationTy = nullptr; - FunctionCallee SetJmp3 = nullptr; - FunctionCallee CxxLongjmpUnwind = nullptr; + Constant *SetJmp3 = nullptr; + Constant *CxxLongjmpUnwind = nullptr; // Per-function state EHPersonality Personality = EHPersonality::Unknown; Function *PersonalityFn = nullptr; bool UseStackGuard = false; int ParentBaseState; - FunctionCallee SehLongjmpUnwind = nullptr; + Constant *SehLongjmpUnwind = nullptr; Constant *Cookie = nullptr; /// The stack allocation containing all EH data, including the link in the @@ -303,7 +303,7 @@ void WinEHStatePass::emitExceptionRegistrationRecord(Function *F) { CxxLongjmpUnwind = TheModule->getOrInsertFunction( "__CxxLongjmpUnwind", FunctionType::get(VoidTy, Int8PtrType, /*isVarArg=*/false)); - cast<Function>(CxxLongjmpUnwind.getCallee()->stripPointerCasts()) + cast<Function>(CxxLongjmpUnwind->stripPointerCasts()) ->setCallingConv(CallingConv::X86_StdCall); } else if (Personality == EHPersonality::MSVC_X86SEH) { // If _except_handler4 is in use, some additional guard checks and prologue @@ -356,7 +356,7 @@ void WinEHStatePass::emitExceptionRegistrationRecord(Function *F) { UseStackGuard ? "_seh_longjmp_unwind4" : "_seh_longjmp_unwind", FunctionType::get(Type::getVoidTy(TheModule->getContext()), Int8PtrType, /*isVarArg=*/false)); - cast<Function>(SehLongjmpUnwind.getCallee()->stripPointerCasts()) + cast<Function>(SehLongjmpUnwind->stripPointerCasts()) ->setCallingConv(CallingConv::X86_StdCall); } else { llvm_unreachable("unexpected personality function"); @@ -471,11 +471,11 @@ void WinEHStatePass::rewriteSetJmpCallSite(IRBuilder<> &Builder, Function &F, SmallVector<Value *, 3> OptionalArgs; if (Personality == EHPersonality::MSVC_CXX) { - OptionalArgs.push_back(CxxLongjmpUnwind.getCallee()); + OptionalArgs.push_back(CxxLongjmpUnwind); OptionalArgs.push_back(State); OptionalArgs.push_back(emitEHLSDA(Builder, &F)); } else if (Personality == EHPersonality::MSVC_X86SEH) { - OptionalArgs.push_back(SehLongjmpUnwind.getCallee()); + OptionalArgs.push_back(SehLongjmpUnwind); OptionalArgs.push_back(State); if (UseStackGuard) OptionalArgs.push_back(Cookie); @@ -766,7 +766,7 @@ void WinEHStatePass::addStateStores(Function &F, WinEHFuncInfo &FuncInfo) { if (!CS) continue; if (CS.getCalledValue()->stripPointerCasts() != - SetJmp3.getCallee()->stripPointerCasts()) + SetJmp3->stripPointerCasts()) continue; SetJmp3CallSites.push_back(CS); |