-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[libSyntax] Restructure to more closely resemble the SwiftSyntax data structure #35517
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
Conversation
@swift-ci Please test |
537dce9
to
24fb68e
Compare
@swift-ci Please test |
24fb68e
to
6ee1c8e
Compare
Discovered another clean-up commit that wanted to make it into this PR. Everything should be in now @swift-ci Please test |
Build failed |
Build failed |
Failure seems unrelated. @swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please test |
@swift-ci Please ASAN test |
ASAN test timed out (https://ci.swift.org/job/swift-PR-macos-ASAN-test/192/). Let’s start it again @swift-ci Please ASAN test |
ASAN build timed out again… |
Giving the ASAN bot a third chance since it seems to be passing lately on other PRs but the point where it stalls doesn’t seem to be directly related to my changes. If it times out again, I’ll need to look into it. @swift-ci Please ASAN test |
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.
I haven't been able to look into the implementation line by line, but this looks good in general.
lib/Syntax/AbsoluteRawSyntax.cpp
Outdated
@@ -0,0 +1,67 @@ | |||
//===--- AbsoluteRawSyntax.h ------------------------------------*- C++ -*-===// |
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.
Nit pick:
//===--- AbsoluteRawSyntax.h ------------------------------------*- C++ -*-===// | |
//===--- AbsoluteRawSyntax.cpp ----------------------------------*- C++ -*-===// |
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.
Whoops. Fixed it.
…yntax implementation
Instead, reference count the SyntaxData's parent. This has a couple of advantages: 1. We eliminate a const_cast that was potentially unsafe 2. It more closely resembles the architecture on the Swift side 3. It has the potential to be optimised further if the parent can be accessed in an unsafe, non-reference-counted way
aa48999
to
8a6b8b8
Compare
@swift-ci Please test |
Build failed |
@swift-ci Please smoke test linux platform |
@swift-ci Please smoke test linux platform |
After trying to use the libSyntax tree in the compiler pipeline, I uncovered several performance bottlenecks in the way libSyntax trees are represented. As a first step towards a more efficient representation of the syntax tree in C++, this PR refactors the current libSyntax tree to more closely resemble the way the tree is represented in SwiftSyntax, which has received more performance-related attention in the recent past.