From 175e81cf3aab615459d6d86e5bdc83b87312dadd Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 28 Feb 2017 19:36:30 +0000 Subject: [PATCH] Use make<> instead of new (BAlloc). NFC. We converted them before, but there were a few remaining occurrences. llvm-svn: 296510 --- lld/ELF/InputFiles.cpp | 7 +++---- lld/ELF/SymbolTable.cpp | 2 +- lld/ELF/Writer.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index a9f1f860abad..a1f6b137881e 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -511,11 +511,10 @@ SymbolBody *elf::ObjectFile::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(Name, /*IsLocal=*/true, StOther, Type, this); - return new (BAlloc) DefinedRegular(Name, /*IsLocal=*/true, StOther, Type, - Value, Size, Sec, this); + return make(Name, /*IsLocal=*/true, StOther, Type, Value, + Size, Sec, this); } StringRef Name = check(Sym->getName(this->StringTable)); diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 62d76dd6a7cc..a70f76184f27 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -191,7 +191,7 @@ std::pair SymbolTable::insert(StringRef Name) { Symbol *Sym; if (IsNew) { - Sym = new (BAlloc) Symbol; + Sym = make(); Sym->InVersionScript = false; Sym->Binding = STB_WEAK; Sym->Visibility = STV_DEFAULT; diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index cc12e5ce35f3..ce5ef0229a9f 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -533,11 +533,11 @@ template void Writer::addSectionSymbols() { if (!IS || isa(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::SymTab->addSymbol(B); + auto *Sym = + make("", /*IsLocal=*/true, /*StOther=*/0, STT_SECTION, + /*Value=*/0, /*Size=*/0, IS, nullptr); + In::SymTab->addSymbol(Sym); } }