summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-01-07 21:17:16 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-01-07 21:17:16 +0000
commit86132a721d7671f382e0c88c0233ec92186daaf4 (patch)
treed8d82fd9ea927ec169b05fdce0affe7bdd95cc07
parent8f37a2422ea948b71d0992ab3f82dab07a54ce52 (diff)
downloadllvm-86132a721d7671f382e0c88c0233ec92186daaf4.tar.gz
llvm-86132a721d7671f382e0c88c0233ec92186daaf4.tar.bz2
llvm-86132a721d7671f382e0c88c0233ec92186daaf4.tar.xz
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
-rw-r--r--include/llvm/GlobalValue.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h
index 63dc4ab6ba..81a11a4c92 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() {