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 | 698138384e94bf315b4bc67481400ffab65e5f93 (patch) | |
tree | b0020a348ba072fa1615c9b370ec55fbeaa1fe1a /lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 56e2a5774423047cd9b1a76e1e7b233567780ca6 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112082 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 63c85974e4..0d961c3ab9 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/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; |