[llvm] r337495 - Work around bug in mingw-w64 GCC 8.1.0

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 13:32:45 PDT 2018


Author: rnk
Date: Thu Jul 19 13:32:45 2018
New Revision: 337495

URL: http://llvm.org/viewvc/llvm-project?rev=337495&view=rev
Log:
Work around bug in mingw-w64 GCC 8.1.0

This particular version of GCC seems to break bitfields when a method
appears between two bitfield members.

Personally, I think it's nice to keep bitfields close together so that
it's easy to check how things are packed, so I moved the method after
SubClassData.

Fixes PR38168.

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=337495&r1=337494&r2=337495&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/IR/GlobalValue.h Thu Jul 19 13:32:45 2018
@@ -110,18 +110,12 @@ protected:
   unsigned IsDSOLocal : 1;
 
 private:
-  friend class Constant;
-
-  void maybeSetDsoLocal() {
-    if (hasLocalLinkage() ||
-        (!hasDefaultVisibility() && !hasExternalWeakLinkage()))
-      setDSOLocal(true);
-  }
-
   // Give subclasses access to what otherwise would be wasted padding.
   // (17 + 4 + 2 + 2 + 2 + 3 + 1 + 1) == 32.
   unsigned SubClassData : GlobalValueSubClassDataBits;
 
+  friend class Constant;
+
   void destroyConstantImpl();
   Value *handleOperandChangeImpl(Value *From, Value *To);
 
@@ -149,6 +143,12 @@ private:
     llvm_unreachable("Fully covered switch above!");
   }
 
+  void maybeSetDsoLocal() {
+    if (hasLocalLinkage() ||
+        (!hasDefaultVisibility() && !hasExternalWeakLinkage()))
+      setDSOLocal(true);
+  }
+
 protected:
   /// The intrinsic ID for this subclass (which must be a Function).
   ///




More information about the llvm-commits mailing list