IR: Store StorageType as an unsigned bitfield
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 20 Jan 2015 15:51:14 +0000 (15:51 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 20 Jan 2015 15:51:14 +0000 (15:51 +0000)
Use `unsigned` instead of `StorageType` for the bitfield to prevent MSVC
from treating the top bit of the bitfield as a sign bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226570 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Metadata.h

index 4d5b61b4cfbcf4cb922e62d8cb865d49f5a52bbb..5590bc54881f9baa00a8dc507f66ff2fc36da330 100644 (file)
@@ -51,7 +51,7 @@ protected:
   enum StorageType { Uniqued, Distinct, Temporary };
 
   /// \brief Storage flag for non-uniqued, otherwise unowned, metadata.
-  StorageType Storage : 2;
+  unsigned Storage : 2;
   // TODO: expose remaining bits to subclasses.
 
   unsigned short SubclassData16;