X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FiCall.cpp;h=3a0545f17425f828377a97326ffaa52acb54a87e;hb=61d295aa291ae66eec95f60a12bacddbefb2f6a2;hp=37eb24e86cbdc0d7f1bea3ebd735a417940beab7;hpb=697954c15da58bd8b186dbafdedd8b06db770201;p=oota-llvm.git diff --git a/lib/VMCore/iCall.cpp b/lib/VMCore/iCall.cpp index 37eb24e86cb..3a0545f1742 100644 --- a/lib/VMCore/iCall.cpp +++ b/lib/VMCore/iCall.cpp @@ -7,24 +7,24 @@ #include "llvm/iOther.h" #include "llvm/iTerminators.h" #include "llvm/DerivedTypes.h" -#include "llvm/Method.h" +#include "llvm/Function.h" //===----------------------------------------------------------------------===// // CallInst Implementation //===----------------------------------------------------------------------===// -CallInst::CallInst(Value *Meth, const std::vector ¶ms, - const std::string &Name) - : Instruction(cast(cast(Meth->getType()) +CallInst::CallInst(Value *Func, const std::vector ¶ms, + const std::string &Name, Instruction *InsertBefore) + : Instruction(cast(cast(Func->getType()) ->getElementType())->getReturnType(), - Instruction::Call, Name) { + Instruction::Call, Name, InsertBefore) { Operands.reserve(1+params.size()); - Operands.push_back(Use(Meth, this)); + Operands.push_back(Use(Func, this)); - const MethodType *MTy = - cast(cast(Meth->getType())->getElementType()); + const FunctionType *MTy = + cast(cast(Func->getType())->getElementType()); - const MethodType::ParamTypes &PL = MTy->getParamTypes(); + const FunctionType::ParamTypes &PL = MTy->getParamTypes(); assert((params.size() == PL.size()) || (MTy->isVarArg() && params.size() >= PL.size()) && "Calling a function with bad signature"); @@ -43,21 +43,21 @@ CallInst::CallInst(const CallInst &CI) // InvokeInst Implementation //===----------------------------------------------------------------------===// -InvokeInst::InvokeInst(Value *Meth, BasicBlock *IfNormal, \ +InvokeInst::InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, const std::vector ¶ms, - const std::string &Name) - : TerminatorInst(cast(cast(Meth->getType()) + const std::string &Name, Instruction *InsertBefore) + : TerminatorInst(cast(cast(Func->getType()) ->getElementType())->getReturnType(), - Instruction::Invoke, Name) { + Instruction::Invoke, Name, InsertBefore) { Operands.reserve(3+params.size()); - Operands.push_back(Use(Meth, this)); - Operands.push_back(Use(IfNormal, this)); - Operands.push_back(Use(IfException, this)); - const MethodType *MTy = - cast(cast(Meth->getType())->getElementType()); + Operands.push_back(Use(Func, this)); + Operands.push_back(Use((Value*)IfNormal, this)); + Operands.push_back(Use((Value*)IfException, this)); + const FunctionType *MTy = + cast(cast(Func->getType())->getElementType()); - const MethodType::ParamTypes &PL = MTy->getParamTypes(); + const FunctionType::ParamTypes &PL = MTy->getParamTypes(); assert((params.size() == PL.size()) || (MTy->isVarArg() && params.size() > PL.size()) && "Calling a function with bad signature");