#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<Value*> ¶ms,
+CallInst::CallInst(Value *Func, const std::vector<Value*> ¶ms,
const std::string &Name)
- : Instruction(cast<MethodType>(cast<PointerType>(Meth->getType())
+ : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
->getElementType())->getReturnType(),
Instruction::Call, Name) {
Operands.reserve(1+params.size());
- Operands.push_back(Use(Meth, this));
+ Operands.push_back(Use(Func, this));
- const MethodType *MTy =
- cast<MethodType>(cast<PointerType>(Meth->getType())->getElementType());
+ const FunctionType *MTy =
+ cast<FunctionType>(cast<PointerType>(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");
// InvokeInst Implementation
//===----------------------------------------------------------------------===//
-InvokeInst::InvokeInst(Value *Meth, BasicBlock *IfNormal, \
+InvokeInst::InvokeInst(Value *Func, BasicBlock *IfNormal,
BasicBlock *IfException,
const std::vector<Value*> ¶ms,
const std::string &Name)
- : TerminatorInst(cast<MethodType>(cast<PointerType>(Meth->getType())
+ : TerminatorInst(cast<FunctionType>(cast<PointerType>(Func->getType())
->getElementType())->getReturnType(),
Instruction::Invoke, Name) {
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<MethodType>(cast<PointerType>(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<FunctionType>(cast<PointerType>(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");