diff options
author | Eric Christopher <echristo@apple.com> | 2010-04-16 23:37:20 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-04-16 23:37:20 +0000 |
commit | fbf918ba42cda25ba57d28eecd0aee89a83a1ecc (patch) | |
tree | 0287e856d7bde9ea8c3e629ffb889a78b778f634 /lib/VMCore/Instructions.cpp | |
parent | 146c6f7e026d4c91ed4fb030660f5af245ee03c6 (diff) | |
download | external_llvm-fbf918ba42cda25ba57d28eecd0aee89a83a1ecc.zip external_llvm-fbf918ba42cda25ba57d28eecd0aee89a83a1ecc.tar.gz external_llvm-fbf918ba42cda25ba57d28eecd0aee89a83a1ecc.tar.bz2 |
Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 6aef9c7..d5c89c9 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -33,7 +33,7 @@ using namespace llvm; User::op_iterator CallSite::getCallee() const { Instruction *II(getInstruction()); return isCall() - ? cast<CallInst>(II)->op_end() - 1 // Skip Function + ? cast<CallInst>(II)->op_begin() : cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Function } @@ -231,7 +231,8 @@ CallInst::~CallInst() { void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) { assert(NumOperands == NumParams+1 && "NumOperands not set up?"); - Op<-1>() = Func; + Use *OL = OperandList; + OL[0] = Func; const FunctionType *FTy = cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); @@ -240,21 +241,20 @@ void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) { assert((NumParams == FTy->getNumParams() || (FTy->isVarArg() && NumParams > FTy->getNumParams())) && "Calling a function with bad signature!"); - - Use *OL = OperandList; for (unsigned i = 0; i != NumParams; ++i) { assert((i >= FTy->getNumParams() || FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a bad signature!"); - OL[i] = Params[i]; + OL[i+1] = Params[i]; } } void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) { assert(NumOperands == 3 && "NumOperands not set up?"); - Op<-1>() = Func; - Op<0>() = Actual1; - Op<1>() = Actual2; + Use *OL = OperandList; + OL[0] = Func; + OL[1] = Actual1; + OL[2] = Actual2; const FunctionType *FTy = cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); @@ -273,8 +273,9 @@ void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) { void CallInst::init(Value *Func, Value *Actual) { assert(NumOperands == 2 && "NumOperands not set up?"); - Op<-1>() = Func; - Op<0>() = Actual; + Use *OL = OperandList; + OL[0] = Func; + OL[1] = Actual; const FunctionType *FTy = cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); @@ -290,7 +291,8 @@ void CallInst::init(Value *Func, Value *Actual) { void CallInst::init(Value *Func) { assert(NumOperands == 1 && "NumOperands not set up?"); - Op<-1>() = Func; + Use *OL = OperandList; + OL[0] = Func; const FunctionType *FTy = cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType()); |