[lld] r287468 - Remove a file that is too short to be an independent file.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 19 15:26:42 PST 2016


Author: ruiu
Date: Sat Nov 19 17:26:41 2016
New Revision: 287468

URL: http://llvm.org/viewvc/llvm-project?rev=287468&view=rev
Log:
Remove a file that is too short to be an independent file.

We have a .cpp and a .h for parseDynamicList(). This patch
moves the function to DriverUtil.cpp.

Removed:
    lld/trunk/ELF/SymbolListFile.cpp
    lld/trunk/ELF/SymbolListFile.h
Modified:
    lld/trunk/ELF/CMakeLists.txt
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/Driver.h
    lld/trunk/ELF/DriverUtils.cpp

Modified: lld/trunk/ELF/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/CMakeLists.txt?rev=287468&r1=287467&r2=287468&view=diff
==============================================================================
--- lld/trunk/ELF/CMakeLists.txt (original)
+++ lld/trunk/ELF/CMakeLists.txt Sat Nov 19 17:26:41 2016
@@ -20,7 +20,6 @@ add_lld_library(lldELF
   Relocations.cpp
   ScriptParser.cpp
   Strings.cpp
-  SymbolListFile.cpp
   SymbolTable.cpp
   Symbols.cpp
   SyntheticSections.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=287468&r1=287467&r2=287468&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Sat Nov 19 17:26:41 2016
@@ -16,7 +16,6 @@
 #include "LinkerScript.h"
 #include "Memory.h"
 #include "Strings.h"
-#include "SymbolListFile.h"
 #include "SymbolTable.h"
 #include "Target.h"
 #include "Writer.h"

Modified: lld/trunk/ELF/Driver.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.h?rev=287468&r1=287467&r2=287468&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.h (original)
+++ lld/trunk/ELF/Driver.h Sat Nov 19 17:26:41 2016
@@ -69,6 +69,7 @@ enum {
 
 void printHelp(const char *Argv0);
 std::vector<uint8_t> parseHexstring(StringRef S);
+void parseDynamicList(MemoryBufferRef MB);
 
 std::string createResponseFile(const llvm::opt::InputArgList &Args);
 

Modified: lld/trunk/ELF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/DriverUtils.cpp?rev=287468&r1=287467&r2=287468&view=diff
==============================================================================
--- lld/trunk/ELF/DriverUtils.cpp (original)
+++ lld/trunk/ELF/DriverUtils.cpp Sat Nov 19 17:26:41 2016
@@ -16,6 +16,7 @@
 #include "Driver.h"
 #include "Error.h"
 #include "Memory.h"
+#include "ScriptParser.h"
 #include "lld/Config/Version.h"
 #include "lld/Core/Reproduce.h"
 #include "llvm/ADT/Optional.h"
@@ -89,6 +90,34 @@ opt::InputArgList ELFOptTable::parse(Arr
   return Args;
 }
 
+// Parse the --dynamic-list argument.  A dynamic list is in the form
+//
+//  { symbol1; symbol2; [...]; symbolN };
+//
+// Multiple groups can be defined in the same file, and they are merged
+// into a single group.
+void elf::parseDynamicList(MemoryBufferRef MB) {
+  class Parser : public ScriptParserBase {
+  public:
+    Parser(StringRef S) : ScriptParserBase(S) {}
+
+    void run() {
+      while (!atEOF()) {
+        expect("{");
+        while (!Error) {
+          Config->DynamicList.push_back(unquote(next()));
+          expect(";");
+          if (consume("}"))
+            break;
+        }
+        expect(";");
+      }
+    }
+  };
+
+  Parser(MB.getBuffer()).run();
+}
+
 void elf::printHelp(const char *Argv0) {
   ELFOptTable Table;
   Table.PrintHelp(outs(), Argv0, "lld", false);

Removed: lld/trunk/ELF/SymbolListFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolListFile.cpp?rev=287467&view=auto
==============================================================================
--- lld/trunk/ELF/SymbolListFile.cpp (original)
+++ lld/trunk/ELF/SymbolListFile.cpp (removed)
@@ -1,58 +0,0 @@
-//===- SymbolListFile.cpp -------------------------------------------------===//
-//
-//                             The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the parser/evaluator of the linker script.
-// It does not construct an AST but consume linker script directives directly.
-// Results are written to Driver or Config object.
-//
-//===----------------------------------------------------------------------===//
-
-#include "SymbolListFile.h"
-#include "Config.h"
-#include "ScriptParser.h"
-#include "Strings.h"
-#include "llvm/Support/MemoryBuffer.h"
-
-using namespace llvm;
-using namespace llvm::ELF;
-
-using namespace lld;
-using namespace lld::elf;
-
-// Parse the --dynamic-list argument.  A dynamic list is in the form
-//
-//  { symbol1; symbol2; [...]; symbolN };
-//
-// Multiple groups can be defined in the same file, and they are merged
-// into a single group.
-
-namespace {
-class DynamicListParser final : public ScriptParserBase {
-public:
-  DynamicListParser(StringRef S) : ScriptParserBase(S) {}
-  void run();
-};
-} // end anonymous namespace
-
-void DynamicListParser::run() {
-  while (!atEOF()) {
-    expect("{");
-    while (!Error) {
-      Config->DynamicList.push_back(unquote(next()));
-      expect(";");
-      if (consume("}"))
-        break;
-    }
-    expect(";");
-  }
-}
-
-void elf::parseDynamicList(MemoryBufferRef MB) {
-  DynamicListParser(MB.getBuffer()).run();
-}

Removed: lld/trunk/ELF/SymbolListFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolListFile.h?rev=287467&view=auto
==============================================================================
--- lld/trunk/ELF/SymbolListFile.h (original)
+++ lld/trunk/ELF/SymbolListFile.h (removed)
@@ -1,24 +0,0 @@
-//===- SymbolListFile.h -----------------------------------------*- C++ -*-===//
-//
-//                             The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_ELF_SYMBOL_LIST_FILE_H
-#define LLD_ELF_SYMBOL_LIST_FILE_H
-
-#include "lld/Core/LLVM.h"
-#include "llvm/Support/MemoryBuffer.h"
-
-namespace lld {
-namespace elf {
-
-void parseDynamicList(MemoryBufferRef MB);
-
-} // namespace elf
-} // namespace lld
-
-#endif




More information about the llvm-commits mailing list