aboutsummaryrefslogtreecommitdiff
path: root/lld/wasm/InputFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/wasm/InputFiles.cpp')
-rw-r--r--lld/wasm/InputFiles.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp
index 3d4fe93..a03166d 100644
--- a/lld/wasm/InputFiles.cpp
+++ b/lld/wasm/InputFiles.cpp
@@ -691,12 +691,16 @@ StringRef strip(StringRef s) {
}
void StubFile::parse() {
- bool first = false;
+ bool first = true;
+
+ SmallVector<StringRef> lines;
+ mb.getBuffer().split(lines, '\n');
+ for (StringRef line : lines) {
+ line = line.trim();
- for (StringRef line : args::getLines(mb)) {
// File must begin with #STUB
if (first) {
- assert(line == "#STUB\n");
+ assert(line == "#STUB");
first = false;
}
@@ -713,10 +717,10 @@ void StubFile::parse() {
symbolDependencies[sym] = {};
while (rest.size()) {
- StringRef first;
- std::tie(first, rest) = rest.split(',');
- first = strip(first);
- symbolDependencies[sym].push_back(first);
+ StringRef dep;
+ std::tie(dep, rest) = rest.split(',');
+ dep = strip(dep);
+ symbolDependencies[sym].push_back(dep);
}
}
}