Skip to content

[libSyntax] Record reused node IDs #18078

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 2 commits into from
Jul 19, 2018

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 19, 2018

This is cheaper than recording reused region offsets and the reused node IDs will later be used to incrementally transfer the syntax to SwiftSyntax.

@ahoppen ahoppen requested review from rintaro and nkcsgexi July 19, 2018 17:43
@ahoppen
Copy link
Member Author

ahoppen commented Jul 19, 2018

@swift-ci Please smoke test

: ReusedNodeIds(ReusedNodeIds) {}

const std::vector<SyntaxReuseRegion> &getReusedRegions() {
std::sort(ReusedRegions.begin(), ReusedRegions.end(), [](const SyntaxReuseRegion &Lhs, const SyntaxReuseRegion &Rhs) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: 80 column; otherwise LGTM!

/// post-edit file.
std::vector<SyntaxReuseRegion> getReusedRanges() const {
return ReusedRanges;
const std::unordered_set<unsigned> &getReusedNodeIds() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have a type alias of unsigned as the ID type, so we can search more easily.

ahoppen added 2 commits July 19, 2018 13:55
This is cheaper than recording reused region offsets and the reused node
IDs will later be used to incrementally transfer the syntax to
SwiftSyntax.
@ahoppen ahoppen force-pushed the 01#2-record-reused-node-ids branch from 90bacc1 to c8226d1 Compare July 19, 2018 20:57
@ahoppen
Copy link
Member Author

ahoppen commented Jul 19, 2018

@nkcsgexi Fixed the 80-column issue and added a typedef for SyntaxNodeIds.

@swift-ci Please smoke test

@ahoppen ahoppen merged commit dc958d6 into swiftlang:master Jul 19, 2018
@ahoppen ahoppen deleted the 01#2-record-reused-node-ids branch July 20, 2018 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants