summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 967fddd7274..3c66af5544c 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -138,16 +138,11 @@ StringRef ScriptParserBase::peek() {
}
bool ScriptParserBase::consume(StringRef Tok) {
- if (Error)
- return false;
- if (atEOF()) {
- setError("unexpected EOF");
- return false;
+ if (peek() == Tok) {
+ skip();
+ return true;
}
- if (Tokens[Pos] != Tok)
- return false;
- ++Pos;
- return true;
+ return false;
}
void ScriptParserBase::skip() { (void)next(); }
OpenPOWER on IntegriCloud