summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/DynamicFile.h
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-04-03 20:29:37 +0000
committerRui Ueyama <ruiu@google.com>2015-04-03 20:29:37 +0000
commit72553767d5995943ff266ef7e574e61bab5eb153 (patch)
treec4d48577131c44ccdf04e327112acfc23e1b79d0 /lld/lib/ReaderWriter/ELF/DynamicFile.h
parent98cfe2b7a58408d6e6186f61bcebdd68e1995d68 (diff)
downloadbcm5719-llvm-72553767d5995943ff266ef7e574e61bab5eb153.tar.gz
bcm5719-llvm-72553767d5995943ff266ef7e574e61bab5eb153.zip
ELF: Pass file types instead of type traits to ELFObjectReader.
All <Arch>ELFFileCreateFileTraits structs are the same except its file type. That means that we don't need to pass the type traits. Instead, we can only pass file types. By doing this, we can remove copy-pasted boilerplates. llvm-svn: 234047
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/DynamicFile.h')
-rw-r--r--lld/lib/ReaderWriter/ELF/DynamicFile.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/lib/ReaderWriter/ELF/DynamicFile.h b/lld/lib/ReaderWriter/ELF/DynamicFile.h
index e3e898fcd73..50c37c64322 100644
--- a/lld/lib/ReaderWriter/ELF/DynamicFile.h
+++ b/lld/lib/ReaderWriter/ELF/DynamicFile.h
@@ -24,6 +24,10 @@ public:
static ErrorOr<std::unique_ptr<DynamicFile>>
create(std::unique_ptr<llvm::MemoryBuffer> mb, ELFLinkingContext &ctx);
+ DynamicFile(std::unique_ptr<MemoryBuffer> mb, ELFLinkingContext &ctx)
+ : SharedLibraryFile(mb->getBufferIdentifier()), _mb(std::move(mb)),
+ _ctx(ctx), _useShlibUndefines(ctx.useShlibUndefines()) {}
+
const SharedLibraryAtom *exports(StringRef name,
bool dataSymbolOnly) const override {
assert(!dataSymbolOnly && "Invalid option for ELF exports!");
@@ -89,10 +93,6 @@ protected:
}
private:
- DynamicFile(std::unique_ptr<MemoryBuffer> mb, ELFLinkingContext &ctx)
- : SharedLibraryFile(mb->getBufferIdentifier()), _mb(std::move(mb)),
- _ctx(ctx), _useShlibUndefines(ctx.useShlibUndefines()) {}
-
mutable llvm::BumpPtrAllocator _alloc;
std::unique_ptr<llvm::object::ELFFile<ELFT>> _objFile;
/// \brief DT_SONAME
OpenPOWER on IntegriCloud