Make clever use of alignment and padding to shrink GlobalValue.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 7 Jan 2012 21:17:16 +0000 (21:17 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 7 Jan 2012 21:17:16 +0000 (21:17 +0000)
-8 bytes on x86_64, no change on x86.

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

include/llvm/GlobalValue.h

index 63dc4ab6bae05be4a26a7a394e4774f1b23a76e5..81a11a4c9258c7e832ebe31e7431d5f0e12a43d4 100644 (file)
@@ -59,19 +59,18 @@ public:
 protected:
   GlobalValue(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps,
               LinkageTypes linkage, const Twine &Name)
-    : Constant(ty, vty, Ops, NumOps), Parent(0),
-      Linkage(linkage), Visibility(DefaultVisibility), Alignment(0),
-      UnnamedAddr(0) {
+    : Constant(ty, vty, Ops, NumOps), Linkage(linkage),
+      Visibility(DefaultVisibility), Alignment(0), UnnamedAddr(0), Parent(0) {
     setName(Name);
   }
 
-  Module *Parent;
   // Note: VC++ treats enums as signed, so an extra bit is required to prevent
   // Linkage and Visibility from turning into negative values.
   LinkageTypes Linkage : 5;   // The linkage of this global
   unsigned Visibility : 2;    // The visibility style of this global
   unsigned Alignment : 16;    // Alignment of this symbol, must be power of two
   unsigned UnnamedAddr : 1;   // This value's address is not significant
+  Module *Parent;             // The containing module.
   std::string Section;        // Section to emit this into, empty mean default
 public:
   ~GlobalValue() {