diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-16 09:38:02 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-16 09:38:02 +0000 |
commit | a6aac4c5bc22bb10c7adb11eee3f82c703af7002 (patch) | |
tree | 3e7c2b5a7329eab2f2db6cd575a6da0e0aa5812a /lib/VMCore/Instructions.cpp | |
parent | 10bb4211d69a643e380c537cbc75745c5fea6d6a (diff) |
eliminate CallInst::ArgOffset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index c13696f229..57b7f3f3d6 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -33,10 +33,8 @@ using namespace llvm; User::op_iterator CallSite::getCallee() const { Instruction *II(getInstruction()); return isCall() - ? (CallInst::ArgOffset - ? cast</*FIXME: CallInst*/User>(II)->op_begin() - : cast</*FIXME: CallInst*/User>(II)->op_end() - 1) - : cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Function + ? cast</*FIXME: CallInst*/User>(II)->op_end() - 1 // Skip Callee + : cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Callee } //===----------------------------------------------------------------------===// @@ -233,7 +231,7 @@ CallInst::~CallInst() { void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) { assert(NumOperands == NumParams+1 && "NumOperands not set up?"); - Op<ArgOffset -1>() = Func; + Op<-1>() = Func; const FunctionType *FTy = cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); @@ -246,15 +244,15 @@ void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) { assert((i >= FTy->getNumParams() || FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a bad signature!"); - OperandList[i + ArgOffset] = Params[i]; + OperandList[i] = Params[i]; } } void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) { assert(NumOperands == 3 && "NumOperands not set up?"); - Op<ArgOffset -1>() = Func; - Op<ArgOffset + 0>() = Actual1; - Op<ArgOffset + 1>() = Actual2; + Op<-1>() = Func; + Op<0>() = Actual1; + Op<1>() = Actual2; const FunctionType *FTy = cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); @@ -273,8 +271,8 @@ void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) { void CallInst::init(Value *Func, Value *Actual) { assert(NumOperands == 2 && "NumOperands not set up?"); - Op<ArgOffset -1>() = Func; - Op<ArgOffset + 0>() = Actual; + Op<-1>() = Func; + Op<0>() = Actual; const FunctionType *FTy = cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); @@ -290,7 +288,7 @@ void CallInst::init(Value *Func, Value *Actual) { void CallInst::init(Value *Func) { assert(NumOperands == 1 && "NumOperands not set up?"); - Op<ArgOffset -1>() = Func; + Op<-1>() = Func; const FunctionType *FTy = cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); |