Skip to content

Commit 715a2a7

Browse files
committed
[lit] Update internal shell lexer to handle LLDB persistent vars.
LLDB allows creation of 'persistent' variables, with names that start with '$'. The lit internal shell was escaping the '$', making it '\$', in some CHECK lines, which causes some LLDB tests to fail when using the lit internal shell. This PR fixes that by having the lexer remove the escape on the '$'.
1 parent 1213d4e commit 715a2a7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/utils/lit/lit/ShUtil.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ def lex_arg_quoted(self, delim):
115115
c = self.eat()
116116
if c == delim:
117117
return str
118+
# LLDB uses "$" at the start of global variable names; it should
119+
# not be escaped nor dropped.
120+
elif c == "\\" and self.look() == "$":
121+
c = self.eat()
122+
str += c
118123
elif c == "\\" and delim == '"':
119124
# Inside a '"' quoted string, '\\' only escapes the quote
120125
# character and backslash, otherwise it is preserved.

0 commit comments

Comments
 (0)