Use make<> instead of new (BAlloc). NFC.

We converted them before, but there were a few remaining occurrences.

llvm-svn: 296510
This commit is contained in:
Rui Ueyama 2017-02-28 19:36:30 +00:00
parent 80474a26b9
commit 175e81cf3a
3 changed files with 8 additions and 9 deletions

View File

@ -511,11 +511,10 @@ SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
StringRefZ Name = this->StringTable.data() + Sym->st_name;
if (Sym->st_shndx == SHN_UNDEF)
return new (BAlloc)
Undefined(Name, /*IsLocal=*/true, StOther, Type, this);
return make<Undefined>(Name, /*IsLocal=*/true, StOther, Type, this);
return new (BAlloc) DefinedRegular(Name, /*IsLocal=*/true, StOther, Type,
Value, Size, Sec, this);
return make<DefinedRegular>(Name, /*IsLocal=*/true, StOther, Type, Value,
Size, Sec, this);
}
StringRef Name = check(Sym->getName(this->StringTable));

View File

@ -191,7 +191,7 @@ std::pair<Symbol *, bool> SymbolTable<ELFT>::insert(StringRef Name) {
Symbol *Sym;
if (IsNew) {
Sym = new (BAlloc) Symbol;
Sym = make<Symbol>();
Sym->InVersionScript = false;
Sym->Binding = STB_WEAK;
Sym->Visibility = STV_DEFAULT;

View File

@ -533,11 +533,11 @@ template <class ELFT> void Writer<ELFT>::addSectionSymbols() {
if (!IS || isa<SyntheticSection>(IS) || IS->Type == SHT_REL ||
IS->Type == SHT_RELA)
continue;
auto *B = new (BAlloc)
DefinedRegular("", /*IsLocal=*/true, /*StOther*/ 0, STT_SECTION,
/*Value*/ 0, /*Size*/ 0, IS, nullptr);
In<ELFT>::SymTab->addSymbol(B);
auto *Sym =
make<DefinedRegular>("", /*IsLocal=*/true, /*StOther=*/0, STT_SECTION,
/*Value=*/0, /*Size=*/0, IS, nullptr);
In<ELFT>::SymTab->addSymbol(Sym);
}
}