summaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/lld/ELF/ScriptLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lld/ELF/ScriptLexer.cpp')
-rw-r--r--contrib/llvm/tools/lld/ELF/ScriptLexer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/llvm/tools/lld/ELF/ScriptLexer.cpp b/contrib/llvm/tools/lld/ELF/ScriptLexer.cpp
index d4b1f6d99cc1..9a372c6d1c6f 100644
--- a/contrib/llvm/tools/lld/ELF/ScriptLexer.cpp
+++ b/contrib/llvm/tools/lld/ELF/ScriptLexer.cpp
@@ -244,6 +244,15 @@ StringRef ScriptLexer::peek() {
return Tok;
}
+StringRef ScriptLexer::peek2() {
+ skip();
+ StringRef Tok = next();
+ if (errorCount())
+ return "";
+ Pos = Pos - 2;
+ return Tok;
+}
+
bool ScriptLexer::consume(StringRef Tok) {
if (peek() == Tok) {
skip();