diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-25 20:22:53 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-25 20:22:53 +0000 |
commit | 26d837d08653a1c93811b4609422b75d7ddd98aa (patch) | |
tree | b5e932816f3f7c38f2b36c03d69303a47ce79008 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 950ad65841c2654436f2acf74aed231ada7c7d10 (diff) | |
download | bcm5719-llvm-26d837d08653a1c93811b4609422b75d7ddd98aa.tar.gz bcm5719-llvm-26d837d08653a1c93811b4609422b75d7ddd98aa.zip |
Fix the bitcode reader to clear out function-specific state
from MDValueList between each function, now that the bitcode
writer is reusing the index space for function-local metadata.
llvm-svn: 112082
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 63c85974e45..0d961c3ab91 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1636,6 +1636,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { InstructionList.clear(); unsigned ModuleValueListSize = ValueList.size(); + unsigned ModuleMDValueListSize = MDValueList.size(); // Add all the function arguments to the value table. for(Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) @@ -2353,6 +2354,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { // Trim the value list down to the size it was before we parsed this function. ValueList.shrinkTo(ModuleValueListSize); + MDValueList.shrinkTo(ModuleMDValueListSize); std::vector<BasicBlock*>().swap(FunctionBBs); return false; |