diff options
| author | Manuel Jacob <me@manueljacob.de> | 2016-01-17 22:37:39 +0000 | 
|---|---|---|
| committer | Manuel Jacob <me@manueljacob.de> | 2016-01-17 22:37:39 +0000 | 
| commit | 190577ac81d6c7ef6c58850cfbbb3bf18c7c7fab (patch) | |
| tree | 444e207d2503b0d9c6e8cf8b6b1a8c2461b277e2 /llvm/lib | |
| parent | da2c9baa0735bfa36b0346f87fc3f783815cbc9c (diff) | |
| download | bcm5719-llvm-190577ac81d6c7ef6c58850cfbbb3bf18c7c7fab.tar.gz bcm5719-llvm-190577ac81d6c7ef6c58850cfbbb3bf18c7c7fab.zip  | |
[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
llvm-svn: 258023
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/ARMFastISel.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/Mips16HardFloat.cpp | 10 | 
4 files changed, 9 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index cfbb20947ac..efbd98ec4e3 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -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; diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 4e645a0d32d..83962309d3f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -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; diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index ff2fcfa349d..088638b10f7 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -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. diff --git a/llvm/lib/Target/Mips/Mips16HardFloat.cpp b/llvm/lib/Target/Mips/Mips16HardFloat.cpp index b2bc7e74c70..d5de409ecc3 100644 --- a/llvm/lib/Target/Mips/Mips16HardFloat.cpp +++ b/llvm/lib/Target/Mips/Mips16HardFloat.cpp @@ -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");  | 

