Allocate space for MCSymbol::Name only if required.
authorPete Cooper <peter_cooper@apple.com>
Tue, 9 Jun 2015 18:36:13 +0000 (18:36 +0000)
committerPete Cooper <peter_cooper@apple.com>
Tue, 9 Jun 2015 18:36:13 +0000 (18:36 +0000)
commit79e04c584474f81e3faef29e33b7195bc7e4d1f6
treedbb59fd6a01144c20d40ca8eb9fda0757137d37e
parent92a42eead2ffd1c71a0a6486560b9773b9a582fb
Allocate space for MCSymbol::Name only if required.

Similarly to User which allocates a number of Use's prior to the this pointer,
allocate space for the Name* for MCSymbol only when we need a name.

Given that an MCSymbol is 48-bytes on 64-bit systems, this saves a decent % of space.

Given the verify_uselistorder test case with debug info and llc, 50k symbols have names
out of 700k so this optimises for the common case of temporary unnamed symbols.

Reviewed by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239423 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCSymbol.h
lib/MC/MCContext.cpp
lib/MC/MCSymbol.cpp