Fix the bitcode reader to deserialize nuw/nsw/etc. bits properly in the case

of a forward-reference, which doesn't use an "abbrev" encoding.

llvm-svn: 94454
This commit is contained in:
Dan Gohman
2010-01-25 21:55:39 +00:00
parent 5cda92820f
commit 00f4747bad
2 changed files with 30 additions and 3 deletions

View File

@@ -1702,12 +1702,12 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
if (Opc == Instruction::Add ||
Opc == Instruction::Sub ||
Opc == Instruction::Mul) {
if (Record[3] & (1 << bitc::OBO_NO_SIGNED_WRAP))
if (Record[OpNum] & (1 << bitc::OBO_NO_SIGNED_WRAP))
cast<BinaryOperator>(I)->setHasNoSignedWrap(true);
if (Record[3] & (1 << bitc::OBO_NO_UNSIGNED_WRAP))
if (Record[OpNum] & (1 << bitc::OBO_NO_UNSIGNED_WRAP))
cast<BinaryOperator>(I)->setHasNoUnsignedWrap(true);
} else if (Opc == Instruction::SDiv) {
if (Record[3] & (1 << bitc::SDIV_EXACT))
if (Record[OpNum] & (1 << bitc::SDIV_EXACT))
cast<BinaryOperator>(I)->setIsExact(true);
}
}