summaryrefslogtreecommitdiffstats
path: root/lld/ELF/DriverUtils.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-11-19 23:26:41 +0000
committerRui Ueyama <ruiu@google.com>2016-11-19 23:26:41 +0000
commitf7dfb2e250b3b0b4a3be39141bbd5cdf3582972f (patch)
tree84813f3225c272508811cc35988e910da6229bba /lld/ELF/DriverUtils.cpp
parent8f475567966a5782afbbe84e7b88b8502e495026 (diff)
downloadbcm5719-llvm-f7dfb2e250b3b0b4a3be39141bbd5cdf3582972f.tar.gz
bcm5719-llvm-f7dfb2e250b3b0b4a3be39141bbd5cdf3582972f.zip
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
Diffstat (limited to 'lld/ELF/DriverUtils.cpp')
-rw-r--r--lld/ELF/DriverUtils.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp
index 3f483ac28e7..2f139371f06 100644
--- a/lld/ELF/DriverUtils.cpp
+++ b/lld/ELF/DriverUtils.cpp
@@ -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);
OpenPOWER on IntegriCloud