mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[libSyntax] Remove ParsedRawSyntaxNode::copyDeferred
This is no longer needed.
This commit is contained in:
@@ -187,17 +187,6 @@ public:
|
||||
return copy;
|
||||
}
|
||||
|
||||
ParsedRawSyntaxNode copyDeferred() const {
|
||||
assert(isDeferredLayout() || isDeferredToken() && "node not deferred");
|
||||
ParsedRawSyntaxNode copy;
|
||||
copy.Data = Data;
|
||||
copy.Range = Range;
|
||||
copy.SynKind = SynKind;
|
||||
copy.TokKind = TokKind;
|
||||
copy.IsMissing = IsMissing;
|
||||
return copy;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
bool ensureDataIsNotRecorded() {
|
||||
if (getDataKind() != DataKind::Recorded)
|
||||
|
||||
@@ -43,10 +43,6 @@ public:
|
||||
return T(std::move(RawNode));
|
||||
}
|
||||
|
||||
ParsedSyntax copyDeferred() const {
|
||||
return ParsedSyntax { RawNode.copyDeferred() };
|
||||
}
|
||||
|
||||
static bool kindof(syntax::SyntaxKind Kind) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ size_t ParsedRawSyntaxRecorder::getDeferredNumChildren(
|
||||
void ParsedRawSyntaxRecorder::verifyElementRanges(ArrayRef<ParsedRawSyntaxNode> elements) {
|
||||
SourceLoc prevEndLoc;
|
||||
for (const auto &elem: elements) {
|
||||
if (elem.isMissing() || elem.isNull())
|
||||
if (elem.isNull() || elem.isMissing())
|
||||
continue;
|
||||
CharSourceRange range = elem.getRange();
|
||||
if (range.isValid()) {
|
||||
|
||||
@@ -31,11 +31,11 @@ Parsed${node.name}::getDeferred${child.name}(const SyntaxParsingContext *SyntaxC
|
||||
auto RawChild = getRaw().getDeferredChild(${node.name}::Cursor::${child.name}, SyntaxContext);
|
||||
if (RawChild.isNull())
|
||||
return None;
|
||||
return Parsed${child.type_name} {RawChild.copyDeferred()};
|
||||
return Parsed${child.type_name}(std::move(RawChild));
|
||||
}
|
||||
% else:
|
||||
Parsed${child.type_name} Parsed${node.name}::getDeferred${child.name}(const SyntaxParsingContext *SyntaxContext) {
|
||||
return Parsed${child.type_name} {getRaw().getDeferredChild(${node.name}::Cursor::${child.name}, SyntaxContext).copyDeferred()};
|
||||
return Parsed${child.type_name} {getRaw().getDeferredChild(${node.name}::Cursor::${child.name}, SyntaxContext)};
|
||||
}
|
||||
% end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user