Skip to content

Commit 2a388b5

Browse files
committed
AST: Remove SourceFile::truncateTopLevelDecls()
1 parent b81c0d6 commit 2a388b5

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

include/swift/AST/SourceFile.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class SourceFile final : public FileUnit {
172172

173173
/// The list of top-level declarations in the source file. This is \c None if
174174
/// they have not yet been parsed.
175-
/// FIXME: Once addTopLevelDecl/prependTopLevelDecl/truncateTopLevelDecls
175+
/// FIXME: Once addTopLevelDecl/prependTopLevelDecl
176176
/// have been removed, this can become an optional ArrayRef.
177177
Optional<std::vector<Decl *>> Decls;
178178

@@ -232,15 +232,6 @@ class SourceFile final : public FileUnit {
232232
return llvm::makeArrayRef(*Decls);
233233
}
234234

235-
/// Truncates the list of top-level decls so it contains \c count elements. Do
236-
/// not add any additional uses of this function.
237-
void truncateTopLevelDecls(unsigned count) {
238-
// Force decl parsing if we haven't already.
239-
(void)getTopLevelDecls();
240-
assert(count <= Decls->size() && "Can only truncate top-level decls!");
241-
Decls->resize(count);
242-
}
243-
244235
/// Retrieve the parsing options for the file.
245236
ParsingOptions getParsingOptions() const { return ParsingOpts; }
246237

0 commit comments

Comments
 (0)