From 86132a721d7671f382e0c88c0233ec92186daaf4 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 7 Jan 2012 21:17:16 +0000 Subject: [PATCH] Make clever use of alignment and padding to shrink GlobalValue. -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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 63dc4ab6bae..81a11a4c925 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -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() {