diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2010-02-25 08:30:17 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2010-02-25 08:30:17 +0000 |
| commit | 0ed995e78e3053eb85c123e1b0f80389ddb584ca (patch) | |
| tree | c9118bf4a44833374e486895fbc55231de596ba4 /lib/Bitcode | |
| parent | cd632fb0570fd33ef3bff6d2b8c348de285d7d30 (diff) | |
| download | external_llvm-0ed995e78e3053eb85c123e1b0f80389ddb584ca.zip external_llvm-0ed995e78e3053eb85c123e1b0f80389ddb584ca.tar.gz external_llvm-0ed995e78e3053eb85c123e1b0f80389ddb584ca.tar.bz2 | |
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
Diffstat (limited to 'lib/Bitcode')
| -rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 1 | ||||
| -rw-r--r-- | lib/Bitcode/Writer/ValueEnumerator.cpp | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 4ac5069..a328837 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 b56c862..aa4c3af 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -39,8 +39,6 @@ static bool CompareByFrequency(const std::pair<const llvm::Type*, /// ValueEnumerator - Enumerate module-level information. ValueEnumerator::ValueEnumerator(const Module *M) { - InstructionCount = 0; - // Enumerate the global variables. for (Module::const_global_iterator I = M->global_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. |
