Use getSize instead of data().size(). NFC.

Also assert isFinalized in getSize(). This just reduces the noise from
another patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283125 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2016-10-03 17:49:19 +00:00
parent 420bc5679c
commit 1c287c05a6
4 changed files with 8 additions and 3 deletions

View File

@ -61,7 +61,7 @@ public:
return StringIndexMap;
}
size_t getSize() const { return Size; }
size_t getSize() const;
void clear();
private:

View File

@ -882,7 +882,7 @@ void MachObjectWriter::writeObject(MCAssembler &Asm,
sizeof(MachO::nlist_64) :
sizeof(MachO::nlist));
writeSymtabLoadCommand(SymbolTableOffset, NumSymTabSymbols,
StringTableOffset, StringTable.data().size());
StringTableOffset, StringTable.getSize());
writeDysymtabLoadCommand(FirstLocalSymbol, NumLocalSymbols,
FirstExternalSymbol, NumExternalSymbols,

View File

@ -34,6 +34,11 @@ StringTableBuilder::StringTableBuilder(Kind K, unsigned Alignment)
}
}
size_t StringTableBuilder::getSize() const {
assert(isFinalized());
return Size;
}
typedef std::pair<CachedHash<StringRef>, size_t> StringPair;
// Returns the character at Pos from end of a string.

View File

@ -307,7 +307,7 @@ void ELFState<ELFT>::initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name,
SHeader.sh_type = ELF::SHT_STRTAB;
CBA.getOSAndAlignedOffset(SHeader.sh_offset, SHeader.sh_addralign)
<< STB.data();
SHeader.sh_size = STB.data().size();
SHeader.sh_size = STB.getSize();
SHeader.sh_addralign = 1;
}