[llvm] r226570 - IR: Store StorageType as an unsigned bitfield

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Jan 20 07:51:14 PST 2015


Author: dexonsmith
Date: Tue Jan 20 09:51:14 2015
New Revision: 226570

URL: http://llvm.org/viewvc/llvm-project?rev=226570&view=rev
Log:
IR: Store StorageType as an unsigned bitfield

Use `unsigned` instead of `StorageType` for the bitfield to prevent MSVC
from treating the top bit of the bitfield as a sign bit.

Modified:
    llvm/trunk/include/llvm/IR/Metadata.h

Modified: llvm/trunk/include/llvm/IR/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=226570&r1=226569&r2=226570&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Metadata.h (original)
+++ llvm/trunk/include/llvm/IR/Metadata.h Tue Jan 20 09:51:14 2015
@@ -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;





More information about the llvm-commits mailing list