MC: Simplify MCSymbolData initialization and remove MCSymbol pointer

Finally remove the `MCSymbolData::Symbol` pointer.  It was still being
used to track whether `MCSymbolData` had been initialized, but this is
better tracked by the bitfield in `MCSymbol`.

The only caller of `MCSymbolData::initialize()` was `MCAssembler`, which
(other than `Symbol`) passed in all-0 values.  Replace all that
indirection with a default constructor.

The main point is a cleanup (and there's more cleanup to do), but there
are also some small memory savings.  I measured ~989 MB down to ~975 MB,
cutting a little over 1% off the top of `llc`.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237873 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-05-21 01:33:03 +00:00
parent 0141c66026
commit 4652459f64
3 changed files with 17 additions and 42 deletions

View File

@@ -352,23 +352,6 @@ void MCSectionData::setBundleLockState(BundleLockStateType NewState) {
/* *** */
MCSymbolData::MCSymbolData() : Symbol(nullptr) {}
void MCSymbolData::initialize(const MCSymbol &Symbol, MCFragment *Fragment,
uint64_t Offset) {
assert(!isInitialized() && "Expected uninitialized symbol");
this->Symbol = &Symbol;
this->Fragment.setPointer(Fragment);
this->Offset = Offset;
this->SymbolSize = nullptr;
this->CommonAlign = -1U;
this->Flags = 0;
this->Index = 0;
}
/* *** */
MCAssembler::MCAssembler(MCContext &Context_, MCAsmBackend &Backend_,
MCCodeEmitter &Emitter_, MCObjectWriter &Writer_,
raw_ostream &OS_)