diff options
| author | Gabor Greif <ggreif@gmail.com> | 2010-06-26 09:35:09 +0000 | 
|---|---|---|
| committer | Gabor Greif <ggreif@gmail.com> | 2010-06-26 09:35:09 +0000 | 
| commit | e9afee2910e907848f59a7c66d0ef6dbfe8b349f (patch) | |
| tree | ce121adb0ab89daf96982fc6cf004d29630e0c20 | |
| parent | b9bdc5a52dc444879ed5bd7ca387e338b36e70dd (diff) | |
| download | bcm5719-llvm-e9afee2910e907848f59a7c66d0ef6dbfe8b349f.tar.gz bcm5719-llvm-e9afee2910e907848f59a7c66d0ef6dbfe8b349f.zip  | |
resort to ArgOperand API
llvm-svn: 106942
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 17 | 
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 98d567e7677..cdeb854d7d1 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1134,26 +1134,25 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,      Vals.push_back(cast<StoreInst>(I).isVolatile());      break;    case Instruction::Call: { -    const PointerType *PTy = cast<PointerType>(I.getOperand(0)->getType()); +    const CallInst &CI = cast<CallInst>(I); +    const PointerType *PTy = cast<PointerType>(CI.getCalledValue()->getType());      const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());      Code = bitc::FUNC_CODE_INST_CALL; -    const CallInst *CI = cast<CallInst>(&I); -    Vals.push_back(VE.getAttributeID(CI->getAttributes())); -    Vals.push_back((CI->getCallingConv() << 1) | unsigned(CI->isTailCall())); -    PushValueAndType(CI->getOperand(0), InstID, Vals, VE);  // Callee +    Vals.push_back(VE.getAttributeID(CI.getAttributes())); +    Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall())); +    PushValueAndType(CI.getCalledValue(), InstID, Vals, VE);  // Callee      // Emit value #'s for the fixed parameters.      for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) -      Vals.push_back(VE.getValueID(I.getOperand(i+1)));  // fixed param. +      Vals.push_back(VE.getValueID(CI.getArgOperand(i)));  // fixed param.      // Emit type/value pairs for varargs params.      if (FTy->isVarArg()) { -      unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams(); -      for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands(); +      for (unsigned i = FTy->getNumParams(), e = CI.getNumArgOperands();             i != e; ++i) -        PushValueAndType(I.getOperand(i), InstID, Vals, VE);  // varargs +        PushValueAndType(CI.getArgOperand(i), InstID, Vals, VE);  // varargs      }      break;    }  | 

