diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2015-04-08 10:06:28 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2015-04-08 10:06:28 +0000 |
| commit | d42488a637a0a9851dbc0ebfbb1e1fc20660326a (patch) | |
| tree | 0b3b4e70049d34eef112c557fd8fcf01b932cf5e | |
| parent | 8e951ce3923320de7accd5c7c4d85d9c7ff18a3e (diff) | |
| download | bcm5719-llvm-d42488a637a0a9851dbc0ebfbb1e1fc20660326a.tar.gz bcm5719-llvm-d42488a637a0a9851dbc0ebfbb1e1fc20660326a.zip | |
[ELF] Remove redundant GOTFile classes
llvm-svn: 234397
5 files changed, 16 insertions, 50 deletions
diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h index cb97d342077..d1585e7412a 100644 --- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h @@ -25,13 +25,6 @@ public: protected: // Add any runtime files and their atoms to the output void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override; - -private: - class GOTFile : public SimpleFile { - public: - GOTFile(const ELFLinkingContext &eti) : SimpleFile("GOTFile") {} - llvm::BumpPtrAllocator _alloc; - }; }; template <class ELFT> @@ -43,9 +36,9 @@ template <class ELFT> void AArch64DynamicLibraryWriter<ELFT>::createImplicitFiles( std::vector<std::unique_ptr<File>> &result) { DynamicLibraryWriter<ELFT>::createImplicitFiles(result); - auto gotFile = llvm::make_unique<GOTFile>(this->_ctx); - gotFile->addAtom(*new (gotFile->_alloc) GlobalOffsetTableAtom(*gotFile)); - gotFile->addAtom(*new (gotFile->_alloc) DynamicAtom(*gotFile)); + auto gotFile = llvm::make_unique<SimpleFile>("GOTFile"); + gotFile->addAtom(*new (gotFile->allocator()) GlobalOffsetTableAtom(*gotFile)); + gotFile->addAtom(*new (gotFile->allocator()) DynamicAtom(*gotFile)); result.push_back(std::move(gotFile)); } diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h b/lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h index 1ef3aa85599..f9eaa3bd5a9 100644 --- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h +++ b/lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h @@ -24,13 +24,6 @@ public: protected: // Add any runtime files and their atoms to the output void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override; - -private: - class GOTFile : public SimpleFile { - public: - GOTFile(const ELFLinkingContext &eti) : SimpleFile("GOTFile") {} - llvm::BumpPtrAllocator _alloc; - }; }; template <class ELFT> @@ -42,10 +35,10 @@ template <class ELFT> void AArch64ExecutableWriter<ELFT>::createImplicitFiles( std::vector<std::unique_ptr<File>> &result) { ExecutableWriter<ELFT>::createImplicitFiles(result); - auto gotFile = llvm::make_unique<GOTFile>(this->_ctx); - gotFile->addAtom(*new (gotFile->_alloc) GlobalOffsetTableAtom(*gotFile)); + auto gotFile = llvm::make_unique<SimpleFile>("GOTFile"); + gotFile->addAtom(*new (gotFile->allocator()) GlobalOffsetTableAtom(*gotFile)); if (this->_ctx.isDynamic()) - gotFile->addAtom(*new (gotFile->_alloc) DynamicAtom(*gotFile)); + gotFile->addAtom(*new (gotFile->allocator()) DynamicAtom(*gotFile)); result.push_back(std::move(gotFile)); } diff --git a/lld/lib/ReaderWriter/ELF/X86/X86DynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/X86/X86DynamicLibraryWriter.h index 09f0eaf7bc7..0cc67dfaa98 100644 --- a/lld/lib/ReaderWriter/ELF/X86/X86DynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/X86/X86DynamicLibraryWriter.h @@ -23,13 +23,6 @@ public: protected: // Add any runtime files and their atoms to the output void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override; - -private: - class GOTFile : public SimpleFile { - public: - GOTFile(const ELFLinkingContext &eti) : SimpleFile("GOTFile") {} - llvm::BumpPtrAllocator _alloc; - }; }; template <class ELFT> @@ -41,9 +34,9 @@ template <class ELFT> void X86DynamicLibraryWriter<ELFT>::createImplicitFiles( std::vector<std::unique_ptr<File>> &result) { DynamicLibraryWriter<ELFT>::createImplicitFiles(result); - auto gotFile = llvm::make_unique<GOTFile>(this->_ctx); - gotFile->addAtom(*new (gotFile->_alloc) GlobalOffsetTableAtom(*gotFile)); - gotFile->addAtom(*new (gotFile->_alloc) DynamicAtom(*gotFile)); + auto gotFile = llvm::make_unique<SimpleFile>("GOTFile"); + gotFile->addAtom(*new (gotFile->allocator()) GlobalOffsetTableAtom(*gotFile)); + gotFile->addAtom(*new (gotFile->allocator()) DynamicAtom(*gotFile)); result.push_back(std::move(gotFile)); } diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h index b67b7f04d2c..e593e469a0c 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h @@ -25,13 +25,6 @@ public: protected: // Add any runtime files and their atoms to the output void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override; - -private: - class GOTFile : public SimpleFile { - public: - GOTFile(const ELFLinkingContext &eti) : SimpleFile("GOTFile") {} - llvm::BumpPtrAllocator _alloc; - }; }; X86_64DynamicLibraryWriter::X86_64DynamicLibraryWriter( @@ -41,9 +34,9 @@ X86_64DynamicLibraryWriter::X86_64DynamicLibraryWriter( void X86_64DynamicLibraryWriter::createImplicitFiles( std::vector<std::unique_ptr<File>> &result) { DynamicLibraryWriter::createImplicitFiles(result); - auto gotFile = llvm::make_unique<GOTFile>(this->_ctx); - gotFile->addAtom(*new (gotFile->_alloc) GlobalOffsetTableAtom(*gotFile)); - gotFile->addAtom(*new (gotFile->_alloc) DynamicAtom(*gotFile)); + auto gotFile = llvm::make_unique<SimpleFile>("GOTFile"); + gotFile->addAtom(*new (gotFile->allocator()) GlobalOffsetTableAtom(*gotFile)); + gotFile->addAtom(*new (gotFile->allocator()) DynamicAtom(*gotFile)); result.push_back(std::move(gotFile)); } diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64ExecutableWriter.h b/lld/lib/ReaderWriter/ELF/X86_64/X86_64ExecutableWriter.h index 79fdee54ed5..622f28bf520 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64ExecutableWriter.h +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64ExecutableWriter.h @@ -26,19 +26,13 @@ protected: void createImplicitFiles(std::vector<std::unique_ptr<File>> &result) override { ExecutableWriter::createImplicitFiles(result); - auto gotFile = llvm::make_unique<GOTFile>(this->_ctx); - gotFile->addAtom(*new (gotFile->_alloc) GlobalOffsetTableAtom(*gotFile)); + auto gotFile = llvm::make_unique<SimpleFile>("GOTFile"); + gotFile->addAtom(*new (gotFile->allocator()) + GlobalOffsetTableAtom(*gotFile)); if (this->_ctx.isDynamic()) - gotFile->addAtom(*new (gotFile->_alloc) DynamicAtom(*gotFile)); + gotFile->addAtom(*new (gotFile->allocator()) DynamicAtom(*gotFile)); result.push_back(std::move(gotFile)); } - -private: - class GOTFile : public SimpleFile { - public: - GOTFile(const ELFLinkingContext &eti) : SimpleFile("GOTFile") {} - llvm::BumpPtrAllocator _alloc; - }; }; } // namespace elf |

