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 | a72e1af8bf7f79e768603ebec79776fba0424ef1 (patch) | |
| tree | 3e7494df6a9e0a924a4f624def3fb99bdf2c9c2b /llvm/lib | |
| parent | ee29cc3b661727db96b4197e8d668c430b7ddcaf (diff) | |
| download | bcm5719-llvm-a72e1af8bf7f79e768603ebec79776fba0424ef1.tar.gz bcm5719-llvm-a72e1af8bf7f79e768603ebec79776fba0424ef1.zip  | |
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.
llvm-svn: 97132
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 3 | 
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 4ac5069eb44..a32883720be 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/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/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index b56c8621fd8..aa4c3afab40 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/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.  | 

