[lld] r224207 - Remove dead code.

Rui Ueyama ruiu at google.com
Sat Dec 13 18:03:54 PST 2014


Author: ruiu
Date: Sat Dec 13 20:03:54 2014
New Revision: 224207

URL: http://llvm.org/viewvc/llvm-project?rev=224207&view=rev
Log:
Remove dead code.

Modified:
    lld/trunk/include/lld/Core/InputGraph.h
    lld/trunk/include/lld/Driver/GnuLdInputGraph.h
    lld/trunk/unittests/DriverTests/InputGraphTest.cpp

Modified: lld/trunk/include/lld/Core/InputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/InputGraph.h?rev=224207&r1=224206&r2=224207&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/InputGraph.h (original)
+++ lld/trunk/include/lld/Core/InputGraph.h Sat Dec 13 20:03:54 2014
@@ -127,9 +127,6 @@ public:
   /// Get the next file to be processed by the resolver
   virtual ErrorOr<File &> getNextFile() = 0;
 
-  /// \brief Reset the next index
-  virtual void resetNextIndex() = 0;
-
   /// Get the elements that we want to expand with.
   virtual bool getReplacements(InputGraph::InputElementVectorT &) {
     return false;
@@ -160,8 +157,6 @@ public:
     llvm_unreachable("shouldn't be here.");
   }
 
-  void resetNextIndex() override {}
-
 private:
   int _size;
 };
@@ -207,10 +202,6 @@ public:
       _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;
 
   /// \brief Return the next File thats part of this node to the

Modified: lld/trunk/include/lld/Driver/GnuLdInputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/GnuLdInputGraph.h?rev=224207&r1=224206&r2=224207&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/GnuLdInputGraph.h (original)
+++ lld/trunk/include/lld/Driver/GnuLdInputGraph.h Sat Dec 13 20:03:54 2014
@@ -74,19 +74,6 @@ public:
   /// \brief Parse the input file to lld::File.
   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:
   llvm::BumpPtrAllocator _alloc;
   const ELFLinkingContext &_elfLinkingContext;
@@ -125,11 +112,6 @@ public:
     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:
   InputGraph::InputElementVectorT _expandElements;
 };

Modified: lld/trunk/unittests/DriverTests/InputGraphTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/InputGraphTest.cpp?rev=224207&r1=224206&r2=224207&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/InputGraphTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/InputGraphTest.cpp Sat Dec 13 20:03:54 2014
@@ -27,12 +27,6 @@ public:
   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 {
 public:
   TestExpandFileNode(StringRef path) : SimpleFileNode(path) {}
@@ -77,10 +71,10 @@ protected:
 
 } // 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;
   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));
   return file;
 }





More information about the llvm-commits mailing list