Remove atom_collection_empty class.

llvm-svn: 234442
This commit is contained in:
Rui Ueyama
2015-04-08 21:59:00 +00:00
parent 9901e9c6c8
commit 2f05640409
2 changed files with 8 additions and 26 deletions

View File

@@ -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:

View File

@@ -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);