[llvm] r290696 - [GlobalValue] Move HasLLVMReservedName into existing bitfield. NFC

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 16:30:46 PST 2016


Author: jlebar
Date: Wed Dec 28 18:30:46 2016
New Revision: 290696

URL: http://llvm.org/viewvc/llvm-project?rev=290696&view=rev
Log:
[GlobalValue] Move HasLLVMReservedName into existing bitfield. NFC

Summary:
Follow-up to r290691, where I introduced HasLLVMReservedName.  rnk
pointed out that that patch added an extra word to GlobalValue on MSVC,
because it doesn't pack bitfields with different types.

This patch moves HasLLVMReservedName into the existing bitfield, where
we appear to have plenty of bits to spare.

Reviewers: rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D28149

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

Modified: llvm/trunk/include/llvm/IR/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/GlobalValue.h?rev=290696&r1=290695&r2=290696&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/IR/GlobalValue.h Wed Dec 28 18:30:46 2016
@@ -80,7 +80,7 @@ protected:
         ValueType(Ty), Linkage(Linkage), Visibility(DefaultVisibility),
         UnnamedAddrVal(unsigned(UnnamedAddr::None)),
         DllStorageClass(DefaultStorageClass), ThreadLocal(NotThreadLocal),
-        IntID((Intrinsic::ID)0U), HasLLVMReservedName(false), Parent(nullptr) {
+        HasLLVMReservedName(false), IntID((Intrinsic::ID)0U), Parent(nullptr) {
     setName(Name);
   }
 
@@ -94,13 +94,19 @@ protected:
 
   unsigned ThreadLocal : 3; // Is this symbol "Thread Local", if so, what is
                             // the desired model?
-  static const unsigned GlobalValueSubClassDataBits = 19;
+
+  /// True if the function's name starts with "llvm.".  This corresponds to the
+  /// value of Function::isIntrinsic(), which may be true even if
+  /// Function::intrinsicID() returns Intrinsic::not_intrinsic.
+  unsigned HasLLVMReservedName : 1;
+
+  static const unsigned GlobalValueSubClassDataBits = 18;
 
 private:
   friend class Constant;
 
   // Give subclasses access to what otherwise would be wasted padding.
-  // (19 + 4 + 2 + 2 + 2 + 3) == 32.
+  // (18 + 4 + 2 + 2 + 2 + 3 + 1) == 32.
   unsigned SubClassData : GlobalValueSubClassDataBits;
 
   void destroyConstantImpl();
@@ -137,12 +143,7 @@ protected:
   /// Subclasses can use it to store their intrinsic ID, if they have one.
   ///
   /// This is stored here to save space in Function on 64-bit hosts.
-  Intrinsic::ID IntID : 31;
-
-  /// True if the function's name starts with "llvm.".  This corresponds to the
-  /// value of Function::isIntrinsic(), which may be true even if
-  /// Function::intrinsicID() returns Intrinsic::not_intrinsic.
-  bool HasLLVMReservedName : 1;
+  Intrinsic::ID IntID;
 
   unsigned getGlobalValueSubClassData() const {
     return SubClassData;




More information about the llvm-commits mailing list