mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Syntax] Unify RawSyntax and RawTokenSyntax using union and TrailingObjects
It better matches with SwiftSyntax model. Using TrailingObjects reduces the number of heap allocation which gains 18% performance improvement.
This commit is contained in:
@@ -30,7 +30,7 @@ void ${node.name}::validate() const {
|
||||
if (!Data || !Data->Raw) return;
|
||||
auto raw = Data->Raw;
|
||||
if (isMissing()) return;
|
||||
assert(raw->Layout.size() == ${len(node.children)});
|
||||
assert(raw->getLayout().size() == ${len(node.children)});
|
||||
% for child in node.children:
|
||||
% if child.token_choices:
|
||||
% choices = ", ".join("tok::" + choice.kind
|
||||
@@ -96,4 +96,4 @@ ${node.name} ${node.name}::with${child.name}(
|
||||
}
|
||||
|
||||
% end
|
||||
% end
|
||||
% end
|
||||
|
||||
Reference in New Issue
Block a user