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
This commit is contained in:
Benjamin Kramer 2012-01-07 21:17:16 +00:00
parent 8f37a2422e
commit 86132a721d

View File

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