1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Fix mingw build by moving the static const data member before the bitfields

Apparently GCC targeting Windows breaks bitfields on static data members:
  struct Foo {
    unsigned X : 16;
    static const int M = 42;
    unsigned Y : 16;
  };
  static_assert(sizeof(Foo) == 4, "asdf"); // fails

Who knew.

llvm-svn: 290700
This commit is contained in:
Reid Kleckner 2016-12-29 01:14:41 +00:00
parent 23bf9929d1
commit 158f53fe75

View File

@ -85,6 +85,9 @@ protected:
}
Type *ValueType;
static const unsigned GlobalValueSubClassDataBits = 18;
// All bitfields use unsigned as the underlying type so that MSVC will pack
// them.
unsigned Linkage : 4; // The linkage of this global
@ -100,8 +103,6 @@ protected:
/// Function::intrinsicID() returns Intrinsic::not_intrinsic.
unsigned HasLLVMReservedName : 1;
static const unsigned GlobalValueSubClassDataBits = 18;
private:
friend class Constant;