From: Nick Lewycky Date: Thu, 25 Feb 2010 08:30:17 +0000 (+0000) Subject: Make the side-numbering of instructions used by metadata (which is needed to X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9a49f1552db7e2ce24a03ec068b17db8a238856d;p=oota-llvm.git Make the side-numbering of instructions used by metadata (which is needed to keep track of instructions that return void) per-function. This fixes PR5278. This breaks backwards compatibility with the metadata format. That's okay because we haven't released the metadata bitcode yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97132 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 4ac5069eb44..a32883720be 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1622,6 +1622,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { if (Stream.EnterSubBlock(bitc::FUNCTION_BLOCK_ID)) return Error("Malformed block record"); + InstructionList.clear(); unsigned ModuleValueListSize = ValueList.size(); // Add all the function arguments to the value table. diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp index b56c8621fd8..aa4c3afab40 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -39,8 +39,6 @@ static bool CompareByFrequency(const std::pairglobal_begin(), E = M->global_end(); I != E; ++I) @@ -377,6 +375,7 @@ void ValueEnumerator::EnumerateAttributes(const AttrListPtr &PAL) { void ValueEnumerator::incorporateFunction(const Function &F) { + InstructionCount = 0; NumModuleValues = Values.size(); // Adding function arguments to the value table.