summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-04-06 02:52:47 +0000
committerRui Ueyama <ruiu@google.com>2016-04-06 02:52:47 +0000
commitec6aee09274de4bdad2541ec5347e6f39ef4b731 (patch)
treeeb2cc312b061d7bbea4559fb0084bfacee110f63
parent7dc03f060e1110cda920ea00044d35265fb10673 (diff)
downloadbcm5719-llvm-ec6aee09274de4bdad2541ec5347e6f39ef4b731.tar.gz
bcm5719-llvm-ec6aee09274de4bdad2541ec5347e6f39ef4b731.zip
Do not allocate MipsReginfo using BumpPtrAllocator.
So that MipsReginfo's destructor will be called. llvm-svn: 265512
-rw-r--r--lld/ELF/InputFiles.cpp4
-rw-r--r--lld/ELF/InputFiles.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 8256b3bfd9a..4d11f359374 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -268,8 +268,8 @@ elf::ObjectFile<ELFT>::createInputSection(const Elf_Shdr &Sec) {
// A MIPS object file has a special section that contains register
// usage info, which needs to be handled by the linker specially.
if (Config->EMachine == EM_MIPS && Name == ".reginfo") {
- MipsReginfo = new (Alloc) MipsReginfoInputSection<ELFT>(this, &Sec);
- return MipsReginfo;
+ MipsReginfo.reset(new MipsReginfoInputSection<ELFT>(this, &Sec));
+ return MipsReginfo.get();
}
// We dont need special handling of .eh_frame sections if relocatable
diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h
index bae552d89fc..1ed47c8f3f5 100644
--- a/lld/ELF/InputFiles.h
+++ b/lld/ELF/InputFiles.h
@@ -146,7 +146,7 @@ private:
std::vector<SymbolBody *> SymbolBodies;
// MIPS .reginfo section defined by this file.
- MipsReginfoInputSection<ELFT> *MipsReginfo = nullptr;
+ std::unique_ptr<MipsReginfoInputSection<ELFT>> MipsReginfo;
llvm::BumpPtrAllocator Alloc;
llvm::SpecificBumpPtrAllocator<InputSection<ELFT>> IAlloc;
OpenPOWER on IntegriCloud