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. llvm-svn: 287468
This commit is contained in:
parent
8f47556796
commit
f7dfb2e250
|
@ -20,7 +20,6 @@ add_lld_library(lldELF
|
|||
Relocations.cpp
|
||||
ScriptParser.cpp
|
||||
Strings.cpp
|
||||
SymbolListFile.cpp
|
||||
SymbolTable.cpp
|
||||
Symbols.cpp
|
||||
SyntheticSections.cpp
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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(ArrayRef<const char *> Argv) {
|
|||
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);
|
||||
|
|
|
@ -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();
|
||||
}
|
|
@ -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
|
Loading…
Reference in New Issue