mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-28 14:46:39 +00:00
[opaque pointer types] [NFC] CallSite: use getFunctionType() instead of going through PointerType::getElementType.
Patch by Eduard Burtescu. Reviewers: dblaikie, mjacob Subscribers: dsanders, llvm-commits, dblaikie Differential Revision: http://reviews.llvm.org/D16273 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258023 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
87169a0328
commit
9b6827560b
@ -880,9 +880,8 @@ bool FastISel::lowerCallTo(const CallInst *CI, MCSymbol *Symbol,
|
||||
unsigned NumArgs) {
|
||||
ImmutableCallSite CS(CI);
|
||||
|
||||
PointerType *PT = cast<PointerType>(CS.getCalledValue()->getType());
|
||||
FunctionType *FTy = cast<FunctionType>(PT->getElementType());
|
||||
Type *RetTy = FTy->getReturnType();
|
||||
FunctionType *FTy = CS.getFunctionType();
|
||||
Type *RetTy = CS.getType();
|
||||
|
||||
ArgListTy Args;
|
||||
Args.reserve(NumArgs);
|
||||
@ -1010,9 +1009,8 @@ bool FastISel::lowerCallTo(CallLoweringInfo &CLI) {
|
||||
bool FastISel::lowerCall(const CallInst *CI) {
|
||||
ImmutableCallSite CS(CI);
|
||||
|
||||
PointerType *PT = cast<PointerType>(CS.getCalledValue()->getType());
|
||||
FunctionType *FuncTy = cast<FunctionType>(PT->getElementType());
|
||||
Type *RetTy = FuncTy->getReturnType();
|
||||
FunctionType *FuncTy = CS.getFunctionType();
|
||||
Type *RetTy = CS.getType();
|
||||
|
||||
ArgListTy Args;
|
||||
ArgListEntry Entry;
|
||||
|
@ -5383,9 +5383,8 @@ SelectionDAGBuilder::lowerInvokable(TargetLowering::CallLoweringInfo &CLI,
|
||||
void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
|
||||
bool isTailCall,
|
||||
const BasicBlock *EHPadBB) {
|
||||
PointerType *PT = cast<PointerType>(CS.getCalledValue()->getType());
|
||||
FunctionType *FTy = cast<FunctionType>(PT->getElementType());
|
||||
Type *RetTy = FTy->getReturnType();
|
||||
FunctionType *FTy = CS.getFunctionType();
|
||||
Type *RetTy = CS.getType();
|
||||
|
||||
TargetLowering::ArgListTy Args;
|
||||
TargetLowering::ArgListEntry Entry;
|
||||
|
@ -2295,8 +2295,7 @@ bool ARMFastISel::SelectCall(const Instruction *I,
|
||||
|
||||
// TODO: Avoid some calling conventions?
|
||||
|
||||
PointerType *PT = cast<PointerType>(CS.getCalledValue()->getType());
|
||||
FunctionType *FTy = cast<FunctionType>(PT->getElementType());
|
||||
FunctionType *FTy = CS.getFunctionType();
|
||||
bool isVarArg = FTy->isVarArg();
|
||||
|
||||
// Handle *simple* calls for now.
|
||||
|
@ -427,15 +427,9 @@ static bool fixupFPReturnAndCall(Function &F, Module *M,
|
||||
Value *F = (M->getOrInsertFunction(Name, A, MyVoid, T, nullptr));
|
||||
CallInst::Create(F, Params, "", &Inst );
|
||||
} else if (const CallInst *CI = dyn_cast<CallInst>(I)) {
|
||||
const Value* V = CI->getCalledValue();
|
||||
Type* T = nullptr;
|
||||
if (V) T = V->getType();
|
||||
PointerType *PFT = nullptr;
|
||||
if (T) PFT = dyn_cast<PointerType>(T);
|
||||
FunctionType *FT = nullptr;
|
||||
if (PFT) FT = dyn_cast<FunctionType>(PFT->getElementType());
|
||||
FunctionType *FT = CI->getFunctionType();
|
||||
Function *F_ = CI->getCalledFunction();
|
||||
if (FT && needsFPReturnHelper(*FT) &&
|
||||
if (needsFPReturnHelper(*FT) &&
|
||||
!(F_ && isIntrinsicInline(F_))) {
|
||||
Modified=true;
|
||||
F.addFnAttr("saveS2");
|
||||
|
Loading…
x
Reference in New Issue
Block a user