[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
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index cfbb209..efbd98e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -880,9 +880,8 @@
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::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;