diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-04-15 12:46:56 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-04-15 12:46:56 +0000 |
commit | 9fd00c7d255cd5e15de146550a19c5f8a0a7dc33 (patch) | |
tree | bf222f4c04dd1c5266098dd8c20d0c8059dd80ae /llvm/lib/Bitcode/Writer | |
parent | 3d9d23561934f4ea682cc9113d986ece267aa34d (diff) | |
download | bcm5719-llvm-9fd00c7d255cd5e15de146550a19c5f8a0a7dc33.tar.gz bcm5719-llvm-9fd00c7d255cd5e15de146550a19c5f8a0a7dc33.zip |
back out r101364, as it trips the linux nightlybot on some clang C++ tests
llvm-svn: 101368
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 0a7db2b9385..9bda6dca3d5 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1134,23 +1134,24 @@ static void WriteInstruction(const Instruction &I, unsigned InstID, Vals.push_back(cast<StoreInst>(I).isVolatile()); break; case Instruction::Call: { - const CallInst &CI = cast<CallInst>(I); - const PointerType *PTy = cast<PointerType>(CI.getCalledValue()->getType()); + const PointerType *PTy = cast<PointerType>(I.getOperand(0)->getType()); const FunctionType *FTy = cast<FunctionType>(PTy->getElementType()); Code = bitc::FUNC_CODE_INST_CALL; - Vals.push_back(VE.getAttributeID(CI.getAttributes())); - Vals.push_back((CI.getCallingConv() << 1) | unsigned(CI.isTailCall())); - PushValueAndType(CI.getCalledValue(), InstID, Vals, VE); // Callee + 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 // 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))); // fixed param. + Vals.push_back(VE.getValueID(I.getOperand(i+1))); // fixed param. // Emit type/value pairs for varargs params. if (FTy->isVarArg()) { - for (unsigned i = FTy->getNumParams(), e = I.getNumOperands()-1; + unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams(); + for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands(); i != e; ++i) PushValueAndType(I.getOperand(i), InstID, Vals, VE); // varargs } |