-
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e9079e6
[LLDB] Update DIL to pass current 'frame var' tests.
cmtice e7ae837
Fix clang-format issues.
cmtice f7fbde0
Fix more clang-format issues.
cmtice c7c16bd
Fix clang-format issue.
cmtice 30bf17a
Merge remote-tracking branch 'origin/main' into DIL-fix-tests
cmtice ca0f328
Address reviewer comments:
cmtice d0c585c
Merge remote-tracking branch 'origin/main' into DIL-fix-tests
cmtice 3a408eb
Fix bug introduced in previous commit.
cmtice bc74c12
Address reviewer comment:
cmtice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -191,12 +191,28 @@ ASTNodeUP DILParser::ParsePrimaryExpression() { | |
| return std::make_unique<IdentifierNode>(loc, identifier); | ||
| } | ||
|
|
||
| uint32_t loc = CurToken().GetLocation(); | ||
| std::string nested_name_specifier; | ||
|
|
||
| if (CurToken().Is(Token::l_paren)) { | ||
| m_dil_lexer.Advance(); | ||
| auto expr = ParseExpression(); | ||
| Expect(Token::r_paren); | ||
| m_dil_lexer.Advance(); | ||
| return expr; | ||
| nested_name_specifier = ParseNestedNameSpecifier(); | ||
|
|
||
| if (!nested_name_specifier.empty()) { | ||
| if (!CurToken().Is(Token::identifier)) { | ||
| BailOut("Expected an identifier, but not found.", | ||
| CurToken().GetLocation(), CurToken().GetSpelling().length()); | ||
| } | ||
|
|
||
| std::string unqualified_id = ParseUnqualifiedId(); | ||
| return std::make_unique<IdentifierNode>(loc, nested_name_specifier + | ||
| unqualified_id); | ||
| } 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()), | ||
|
|
@@ -232,16 +248,16 @@ std::string DILParser::ParseNestedNameSpecifier() { | |
| m_dil_lexer.LookAhead(4).Is(Token::coloncolon)) { | ||
| m_dil_lexer.Advance(4); | ||
|
|
||
| assert( | ||
| (CurToken().Is(Token::identifier) || CurToken().Is(Token::l_paren)) && | ||
| "Expected an identifier or anonymous namespace, but not found."); | ||
| Expect(Token::coloncolon); | ||
| m_dil_lexer.Advance(); | ||
| if (!CurToken().Is(Token::identifier) && !CurToken().Is(Token::l_paren)) { | ||
| BailOut( | ||
| "Expected an identifier or anonymous namespeace, but not found.", | ||
|
||
| CurToken().GetLocation(), CurToken().GetSpelling().length()); | ||
| } | ||
| // Continue parsing the nested_namespace_specifier. | ||
| std::string identifier2 = ParseNestedNameSpecifier(); | ||
| if (identifier2.empty()) { | ||
| Expect(Token::identifier); | ||
| identifier2 = CurToken().GetSpelling(); | ||
| m_dil_lexer.Advance(); | ||
| } | ||
|
|
||
| return "(anonymous namespace)::" + identifier2; | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
no else after return
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.
Done.