aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/lld/ELF/ScriptLexer.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-20 14:42:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-20 14:42:59 +0000
commit0e23b2ff8c430cd1145afb7bd55917c326bb1d06 (patch)
tree14fdbb113c10dc504d2e6723bfbae7efe500b42b /contrib/llvm/tools/lld/ELF/ScriptLexer.cpp
parentd5ea6fa648f8835a44adfb322b788e615d77cb71 (diff)
parente2fd426bdafe9f5c10066d3926ece6e342184a67 (diff)
Notes
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();