Remove dead code.

llvm-svn: 224207
This commit is contained in:
Rui Ueyama 2014-12-14 02:03:54 +00:00
parent 4726967a51
commit 83220a00ea
3 changed files with 2 additions and 35 deletions

View File

@ -127,9 +127,6 @@ public:
/// Get the next file to be processed by the resolver /// Get the next file to be processed by the resolver
virtual ErrorOr<File &> getNextFile() = 0; virtual ErrorOr<File &> getNextFile() = 0;
/// \brief Reset the next index
virtual void resetNextIndex() = 0;
/// Get the elements that we want to expand with. /// Get the elements that we want to expand with.
virtual bool getReplacements(InputGraph::InputElementVectorT &) { virtual bool getReplacements(InputGraph::InputElementVectorT &) {
return false; return false;
@ -160,8 +157,6 @@ public:
llvm_unreachable("shouldn't be here."); llvm_unreachable("shouldn't be here.");
} }
void resetNextIndex() override {}
private: private:
int _size; int _size;
}; };
@ -207,10 +202,6 @@ public:
_files.push_back(std::move(ai)); _files.push_back(std::move(ai));
} }
/// \brief Reset the file index if the resolver needs to process
/// the node again.
void resetNextIndex() override { _nextFileIndex = 0; }
bool getReplacements(InputGraph::InputElementVectorT &result) override; bool getReplacements(InputGraph::InputElementVectorT &result) override;
/// \brief Return the next File thats part of this node to the /// \brief Return the next File thats part of this node to the

View File

@ -74,19 +74,6 @@ public:
/// \brief Parse the input file to lld::File. /// \brief Parse the input file to lld::File.
std::error_code parse(const LinkingContext &, raw_ostream &) override; std::error_code parse(const LinkingContext &, raw_ostream &) override;
/// \brief This is used by Group Nodes, when there is a need to reset the
/// the file to be processed next. When handling a group node that contains
/// Input elements, if the group node has to be reprocessed, the linker needs
/// to start processing files as part of the input element from beginning.
/// Reset the next file index to 0 only if the node is an archive library.
void resetNextIndex() override {
auto kind = _files[0]->kind();
if (kind == File::kindSharedLibrary ||
(kind == File::kindArchiveLibrary && !_attributes._isWholeArchive)) {
_nextFileIndex = 0;
}
}
private: private:
llvm::BumpPtrAllocator _alloc; llvm::BumpPtrAllocator _alloc;
const ELFLinkingContext &_elfLinkingContext; const ELFLinkingContext &_elfLinkingContext;
@ -125,11 +112,6 @@ public:
return true; return true;
} }
// Linker Script will be expanded and replaced with other elements
// by InputGraph::normalize(), so at link time it does not exist in
// the tree. No need to handle this message.
void resetNextIndex() override {}
private: private:
InputGraph::InputElementVectorT _expandElements; InputGraph::InputElementVectorT _expandElements;
}; };

View File

@ -27,12 +27,6 @@ public:
bool validateImpl(raw_ostream &) override { return true; } bool validateImpl(raw_ostream &) override { return true; }
}; };
class TestFileNode : public SimpleFileNode {
public:
TestFileNode(StringRef path) : SimpleFileNode(path) {}
void resetNextIndex() override { FileNode::resetNextIndex(); }
};
class TestExpandFileNode : public SimpleFileNode { class TestExpandFileNode : public SimpleFileNode {
public: public:
TestExpandFileNode(StringRef path) : SimpleFileNode(path) {} TestExpandFileNode(StringRef path) : SimpleFileNode(path) {}
@ -77,10 +71,10 @@ protected:
} // end anonymous namespace } // end anonymous namespace
static std::unique_ptr<TestFileNode> createFile(StringRef name) { static std::unique_ptr<SimpleFileNode> createFile(StringRef name) {
std::vector<std::unique_ptr<File>> files; std::vector<std::unique_ptr<File>> files;
files.push_back(std::unique_ptr<SimpleFile>(new SimpleFile(name))); files.push_back(std::unique_ptr<SimpleFile>(new SimpleFile(name)));
std::unique_ptr<TestFileNode> file(new TestFileNode("filenode")); std::unique_ptr<SimpleFileNode> file(new SimpleFileNode("filenode"));
file->addFiles(std::move(files)); file->addFiles(std::move(files));
return file; return file;
} }