From 2f05640409b54e2803f3d54167d27ed24fae1707 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 8 Apr 2015 21:59:00 +0000 Subject: [PATCH] Remove atom_collection_empty class. llvm-svn: 234442 --- lld/include/lld/Core/File.h | 26 ++++---------------------- lld/lib/Core/File.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/lld/include/lld/Core/File.h b/lld/include/lld/Core/File.h index cfb58eb..e43141b 100644 --- a/lld/include/lld/Core/File.h +++ b/lld/include/lld/Core/File.h @@ -223,28 +223,10 @@ protected: std::vector _atoms; }; - /// \brief This is a convenience class for File subclasses which need to - /// return an empty collection. - template - class atom_collection_empty : public atom_collection { - public: - atom_iterator begin() const override { - return atom_iterator(*this, nullptr); - } - atom_iterator end() const override { - return atom_iterator(*this, nullptr); - } - const T *deref(const void *it) const override { - llvm_unreachable("empty collection should never be accessed"); - } - void next(const void *&it) const override {} - uint64_t size() const override { return 0; } - }; - - static atom_collection_empty _noDefinedAtoms; - static atom_collection_empty _noUndefinedAtoms; - static atom_collection_empty _noSharedLibraryAtoms; - static atom_collection_empty _noAbsoluteAtoms; + static atom_collection_vector _noDefinedAtoms; + static atom_collection_vector _noUndefinedAtoms; + static atom_collection_vector _noSharedLibraryAtoms; + static atom_collection_vector _noAbsoluteAtoms; mutable llvm::BumpPtrAllocator _allocator; private: diff --git a/lld/lib/Core/File.cpp b/lld/lib/Core/File.cpp index dbac86b..f07d2cc 100644 --- a/lld/lib/Core/File.cpp +++ b/lld/lib/Core/File.cpp @@ -15,10 +15,10 @@ namespace lld { File::~File() {} -File::atom_collection_empty File::_noDefinedAtoms; -File::atom_collection_empty File::_noUndefinedAtoms; -File::atom_collection_empty File::_noSharedLibraryAtoms; -File::atom_collection_empty File::_noAbsoluteAtoms; +File::atom_collection_vector File::_noDefinedAtoms; +File::atom_collection_vector File::_noUndefinedAtoms; +File::atom_collection_vector File::_noSharedLibraryAtoms; +File::atom_collection_vector File::_noAbsoluteAtoms; std::error_code File::parse() { std::lock_guard lock(_parseMutex); -- 2.7.4