-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[LLDB] Update DIL to pass current 'frame var' tests. #145055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
e9079e6
e7ae837
f7fbde0
c7c16bd
30bf17a
ca0f328
d0c585c
3a408eb
bc74c12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,11 +178,40 @@ ASTNodeUP DILParser::ParsePrimaryExpression() { | |
| } | ||
|
|
||
| if (CurToken().Is(Token::l_paren)) { | ||
| m_dil_lexer.Advance(); | ||
| auto expr = ParseExpression(); | ||
| Expect(Token::r_paren); | ||
| m_dil_lexer.Advance(); | ||
| return expr; | ||
| // Check in case this is an anonynmous namespace | ||
| if (m_dil_lexer.LookAhead(1).Is(Token::identifier) && | ||
| (m_dil_lexer.LookAhead(1).GetSpelling() == "anonymous") && | ||
| m_dil_lexer.LookAhead(2).Is(Token::identifier) && | ||
| (m_dil_lexer.LookAhead(2).GetSpelling() == "namespace") && | ||
| m_dil_lexer.LookAhead(3).Is(Token::r_paren) && | ||
| m_dil_lexer.LookAhead(4).Is(Token::coloncolon)) { | ||
| m_dil_lexer.Advance(4); | ||
|
|
||
| std::string identifier = "(anonymous namespace)"; | ||
| Expect(Token::coloncolon); | ||
| // Save the source location for the diagnostics message. | ||
| uint32_t loc = CurToken().GetLocation(); | ||
| m_dil_lexer.Advance(); | ||
| assert( | ||
| (CurToken().Is(Token::identifier) || CurToken().Is(Token::l_paren)) && | ||
| "Expected an identifier or anonymous namespeace, but not found."); | ||
|
||
| std::string identifier2 = ParseNestedNameSpecifier(); | ||
| if (identifier2.empty()) { | ||
| // There was only an identifer, no more levels of nesting. Or there | ||
| // was an invalid expression starting with a left parenthesis. | ||
| Expect(Token::identifier); | ||
| identifier2 = CurToken().GetSpelling(); | ||
| m_dil_lexer.Advance(); | ||
| } | ||
| identifier = identifier + "::" + identifier2; | ||
| return std::make_unique<IdentifierNode>(loc, identifier); | ||
| } else { | ||
|
||
| m_dil_lexer.Advance(); | ||
| auto expr = ParseExpression(); | ||
| Expect(Token::r_paren); | ||
| m_dil_lexer.Advance(); | ||
| return expr; | ||
| } | ||
| } | ||
|
|
||
| BailOut(llvm::formatv("Unexpected token: {0}", CurToken()), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of basically inlining a part of ParseIdExpression, could we find a way to delegate to it? What would happen if we changed the check on line 172 to say "if next token is :: or identifier OR next 4 tokens are '(anonymous namespace)'" ?