[lld] r204988 - [ELF] Remove class declarations that do nothing.
Shankar Easwaran
shankare at codeaurora.org
Fri Mar 28 08:45:44 PDT 2014
Thanks for doing this.
On 3/28/2014 12:03 AM, Rui Ueyama wrote:
> Author: ruiu
> Date: Fri Mar 28 00:03:35 2014
> New Revision: 204988
>
> URL: http://llvm.org/viewvc/llvm-project?rev=204988&view=rev
> Log:
> [ELF] Remove class declarations that do nothing.
>
> These classes are declared in a .cpp file but not used in the same compliation
> unit. They seems to have been copy-and-pasted from ELFReader.h.
>
> Modified:
> lld/trunk/lib/ReaderWriter/ELF/Reader.cpp
>
> Modified: lld/trunk/lib/ReaderWriter/ELF/Reader.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Reader.cpp?rev=204988&r1=204987&r2=204988&view=diff
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/ELF/Reader.cpp (original)
> +++ lld/trunk/lib/ReaderWriter/ELF/Reader.cpp Fri Mar 28 00:03:35 2014
> @@ -22,82 +22,6 @@ using llvm::support::endianness;
> using namespace llvm::object;
>
> namespace lld {
> -namespace {
> -
> -struct DynamicFileCreateELFTraits {
> - typedef llvm::ErrorOr<std::unique_ptr<lld::SharedLibraryFile>> result_type;
> -
> - template <class ELFT>
> - static result_type create(std::unique_ptr<llvm::MemoryBuffer> mb,
> - bool useUndefines) {
> - return lld::elf::DynamicFile<ELFT>::create(std::move(mb), useUndefines);
> - }
> -};
> -
> -struct ELFFileCreateELFTraits {
> - typedef llvm::ErrorOr<std::unique_ptr<lld::File>> result_type;
> -
> - template <class ELFT>
> - static result_type create(std::unique_ptr<llvm::MemoryBuffer> mb,
> - bool atomizeStrings) {
> - return lld::elf::ELFFile<ELFT>::create(std::move(mb), atomizeStrings);
> - }
> -};
> -
> -class ELFObjectReader : public Reader {
> -public:
> - ELFObjectReader(bool atomizeStrings) : _atomizeStrings(atomizeStrings) {}
> -
> - virtual bool canParse(file_magic magic, StringRef,
> - const MemoryBuffer &) const override {
> - return (magic == llvm::sys::fs::file_magic::elf_relocatable);
> - }
> -
> - virtual error_code
> - parseFile(std::unique_ptr<MemoryBuffer> &mb, const class Registry &,
> - std::vector<std::unique_ptr<File>> &result) const override {
> - error_code ec;
> - std::size_t maxAlignment =
> - 1ULL << llvm::countTrailingZeros(uintptr_t(mb->getBufferStart()));
> - auto f = createELF<ELFFileCreateELFTraits>(
> - getElfArchType(&*mb), maxAlignment, std::move(mb), _atomizeStrings);
> - if (error_code ec = f.getError())
> - return ec;
> - result.push_back(std::move(*f));
> - return error_code::success();
> - }
> -
> -private:
> - bool _atomizeStrings;
> -};
> -
> -class ELFDSOReader : public Reader {
> -public:
> - ELFDSOReader(bool useUndefines) : _useUndefines(useUndefines) {}
> -
> - virtual bool canParse(file_magic magic, StringRef,
> - const MemoryBuffer &) const override {
> - return (magic == llvm::sys::fs::file_magic::elf_shared_object);
> - }
> -
> - virtual error_code
> - parseFile(std::unique_ptr<MemoryBuffer> &mb, const class Registry &,
> - std::vector<std::unique_ptr<File>> &result) const override {
> - std::size_t maxAlignment =
> - 1ULL << llvm::countTrailingZeros(uintptr_t(mb->getBufferStart()));
> - auto f = createELF<DynamicFileCreateELFTraits>(
> - getElfArchType(&*mb), maxAlignment, std::move(mb), _useUndefines);
> - if (error_code ec = f.getError())
> - return ec;
> - result.push_back(std::move(*f));
> - return error_code::success();
> - }
> -
> -private:
> - bool _useUndefines;
> -};
> -
> -} // anonymous
>
> // This dynamic registration of a handler causes support for all ELF
> // architectures to be pulled into the linker. If we want to support making a
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation
More information about the llvm-commits
mailing list