[llvm-commits] [llvm] r156383 - in /llvm/trunk: include/llvm/Bitcode/LLVMBitCodes.h lib/Bitcode/Reader/BitcodeReader.cpp

Kuperstein, Michael M michael.m.kuperstein at intel.com
Tue May 22 03:55:50 PDT 2012


Hello,

The commit below (156383) broke binary compatibility with LLVM 3.0. 
The LLVM 3.1 branch generates bitcode files with the new TYPE_CODE_FUNCTION, and can read both. However, 3.0 still generated TYPE_CODE_FUNCTION_OLD (it is named TYPE_CODE_FUNCTION in 3.0, the change to OLD was made somewhere between 3.0 and the final 3.1 branch) records. This means 3.1 is still able to read 3.0 bitcode, but 3.2 will not be able to.

I'm attaching a small test-case. I will be happy to provide a proper patch that resurrects TYPE_CODE_FUNCTION_OLD, if that's helpful.

Thanks,
   Michael

-----Original Message-----
From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Nuno Lopes
Sent: Tuesday, May 08, 2012 19:16
To: llvm-commits at cs.uiuc.edu
Subject: [llvm-commits] [llvm] r156383 - in /llvm/trunk: include/llvm/Bitcode/LLVMBitCodes.h lib/Bitcode/Reader/BitcodeReader.cpp

Author: nlopes
Date: Tue May  8 11:16:20 2012
New Revision: 156383

URL: http://llvm.org/viewvc/llvm-project?rev=156383&view=rev
Log:
remove TYPE_CODE_FUNCTION_OLD type code. it is no longer in use and it was marked for removal in 3.0

Modified:
    llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp

Modified: llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h?rev=156383&r1=156382&r2=156383&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h (original)
+++ llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h Tue May  8 11:16:20 2012
@@ -90,9 +90,6 @@
     TYPE_CODE_OPAQUE   =  6,    // OPAQUE
     TYPE_CODE_INTEGER  =  7,    // INTEGER: [width]
     TYPE_CODE_POINTER  =  8,    // POINTER: [pointee type]
-
-    TYPE_CODE_FUNCTION_OLD = 9, // FUNCTION: [vararg, attrid, retty,
-                                //            paramty x N]
     
     TYPE_CODE_HALF     =  10,   // HALF
     

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=156383&r1=156382&r2=156383&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue May  8 11:16:20 2012
@@ -620,26 +620,6 @@
       ResultTy = PointerType::get(ResultTy, AddressSpace);
       break;
     }
-    case bitc::TYPE_CODE_FUNCTION_OLD: {
-      // FIXME: attrid is dead, remove it in LLVM 3.0
-      // FUNCTION: [vararg, attrid, retty, paramty x N]
-      if (Record.size() < 3)
-        return Error("Invalid FUNCTION type record");
-      SmallVector<Type*, 8> ArgTys;
-      for (unsigned i = 3, e = Record.size(); i != e; ++i) {
-        if (Type *T = getTypeByID(Record[i]))
-          ArgTys.push_back(T);
-        else
-          break;
-      }
-      
-      ResultTy = getTypeByID(Record[2]);
-      if (ResultTy == 0 || ArgTys.size() < Record.size()-3)
-        return Error("invalid type in function type");
-
-      ResultTy = FunctionType::get(ResultTy, ArgTys, Record[0]);
-      break;
-    }
     case bitc::TYPE_CODE_FUNCTION: {
       // FUNCTION: [vararg, retty, paramty x N]
       if (Record.size() < 2)


_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm30_function.bc
Type: application/octet-stream
Size: 288 bytes
Desc: llvm30_function.bc
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120522/aab7d19c/attachment.obj>


More information about the llvm-commits mailing list