[lld] r234442 - Remove atom_collection_empty class.

Rui Ueyama ruiu at google.com
Wed Apr 8 14:59:00 PDT 2015


Author: ruiu
Date: Wed Apr  8 16:59:00 2015
New Revision: 234442

URL: http://llvm.org/viewvc/llvm-project?rev=234442&view=rev
Log:
Remove atom_collection_empty class.

Modified:
    lld/trunk/include/lld/Core/File.h
    lld/trunk/lib/Core/File.cpp

Modified: lld/trunk/include/lld/Core/File.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/File.h?rev=234442&r1=234441&r2=234442&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/File.h (original)
+++ lld/trunk/include/lld/Core/File.h Wed Apr  8 16:59:00 2015
@@ -223,28 +223,10 @@ protected:
     std::vector<const T *> _atoms;
   };
 
-  /// \brief This is a convenience class for File subclasses which need to
-  /// return an empty collection.
-  template <typename T>
-  class atom_collection_empty : public atom_collection<T> {
-  public:
-    atom_iterator<T> begin() const override {
-      return atom_iterator<T>(*this, nullptr);
-    }
-    atom_iterator<T> end() const override {
-      return atom_iterator<T>(*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<DefinedAtom>       _noDefinedAtoms;
-  static atom_collection_empty<UndefinedAtom>     _noUndefinedAtoms;
-  static atom_collection_empty<SharedLibraryAtom> _noSharedLibraryAtoms;
-  static atom_collection_empty<AbsoluteAtom>      _noAbsoluteAtoms;
+  static atom_collection_vector<DefinedAtom>       _noDefinedAtoms;
+  static atom_collection_vector<UndefinedAtom>     _noUndefinedAtoms;
+  static atom_collection_vector<SharedLibraryAtom> _noSharedLibraryAtoms;
+  static atom_collection_vector<AbsoluteAtom>      _noAbsoluteAtoms;
   mutable llvm::BumpPtrAllocator                  _allocator;
 
 private:

Modified: lld/trunk/lib/Core/File.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/File.cpp?rev=234442&r1=234441&r2=234442&view=diff
==============================================================================
--- lld/trunk/lib/Core/File.cpp (original)
+++ lld/trunk/lib/Core/File.cpp Wed Apr  8 16:59:00 2015
@@ -15,10 +15,10 @@ namespace lld {
 
 File::~File() {}
 
-File::atom_collection_empty<DefinedAtom>       File::_noDefinedAtoms;
-File::atom_collection_empty<UndefinedAtom>     File::_noUndefinedAtoms;
-File::atom_collection_empty<SharedLibraryAtom> File::_noSharedLibraryAtoms;
-File::atom_collection_empty<AbsoluteAtom>      File::_noAbsoluteAtoms;
+File::atom_collection_vector<DefinedAtom>       File::_noDefinedAtoms;
+File::atom_collection_vector<UndefinedAtom>     File::_noUndefinedAtoms;
+File::atom_collection_vector<SharedLibraryAtom> File::_noSharedLibraryAtoms;
+File::atom_collection_vector<AbsoluteAtom>      File::_noAbsoluteAtoms;
 
 std::error_code File::parse() {
   std::lock_guard<std::mutex> lock(_parseMutex);





More information about the llvm-commits mailing list