Skip to content

Commit a38dc1a

Browse files
committed
[libSyntax] Remove unnecessary getOpaqueNode and takeOpaqueNode from ParsedRawSyntaxNode
They are superseded by getData/takeData
1 parent 439b44b commit a38dc1a

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

include/swift/Parse/ParsedRawSyntaxNode.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,6 @@ class ParsedRawSyntaxNode {
163163
/// Returns the range of this node including leading and trailing trivia.
164164
CharSourceRange getRange() const { return Range; }
165165

166-
// Recorded Data ===========================================================//
167-
168-
OpaqueSyntaxNode getOpaqueNode() const {
169-
assert(isRecorded());
170-
return Data.getOpaque();
171-
}
172-
OpaqueSyntaxNode takeOpaqueNode() {
173-
assert(isRecorded());
174-
auto opaque = Data.getOpaque();
175-
reset();
176-
return opaque;
177-
}
178-
179166
// Deferred Layout Data ====================================================//
180167

181168
/// If this node is a deferred layout node, return the child at index \p

lib/Parse/SyntaxParsingContext.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ OpaqueSyntaxNode SyntaxParsingContext::finalizeRoot() {
329329
// the root context.
330330
getStorage().clear();
331331

332-
return root.takeOpaqueNode();
332+
assert(root.isRecorded() && "Root of syntax tree should be recorded");
333+
return root.takeData();
333334
}
334335

335336
void SyntaxParsingContext::synthesize(tok Kind, SourceLoc Loc) {

0 commit comments

Comments
 (0)