Skip to content

[libSyntax] Store data of RecoredeOrDeferredNode as PointerIntPair #36420

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 12, 2021

This further reduces the size of ParsedRawSyntaxNode, as well as for intermediate data structures using in SyntaxParseActions, slightly improving syntax parsing performance.

This furthere reduces the size of ParsedRawSyntaxNode, as well as for intermediate data structures using in SyntaxParseActions, improving syntax parsing performance.
@ahoppen ahoppen requested a review from rintaro March 12, 2021 15:56
Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +59 to +61
/// \c llvm::PointerIntPair. This is in particular guaranteed for pointers
/// to C/C++ objects and for pointers that were generated by Swift and passed
/// to the compiler via a C API (in particular \c CLibParseActions ).
Copy link
Member

Choose a reason for hiding this comment

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

This is probably true, but just in case could you add an assertion in the RecordedOrDeferredNode constructor?

https://github.com/apple/llvm-project/blob/28c70a0e/llvm/include/llvm/Support/PointerLikeTypeTraits.h#L73-L74

  /// All clients should use assertions to do a run-time check to ensure that
  /// this is actually true.

Copy link
Member Author

Choose a reason for hiding this comment

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

PointerIntPairInfo already does this check. I suppose that it is considered the client of PointerLikeTypeTraits and we are just using PointerIntPairInfo.

https://github.com/apple/llvm-project/blob/apple/main/llvm/include/llvm/ADT/PointerIntPair.h#L178

@ahoppen
Copy link
Member Author

ahoppen commented Mar 16, 2021

@swift-ci Please smoke test

@ahoppen ahoppen merged commit 4fe3214 into swiftlang:main Mar 16, 2021
@ahoppen ahoppen deleted the pr/recordedordeferrednode-pointerandint branch March 16, 2021 15:09
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