mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Remove IfConfigDecl from the AST
The swift-syntax tree retains information about the parsed #if regions. Drop it from the semantic AST.
This commit is contained in:
@@ -2027,7 +2027,6 @@ static bool shouldSerializeMember(Decl *D) {
|
||||
case DeclKind::BuiltinTuple:
|
||||
llvm_unreachable("BuiltinTupleDecl should not show up here");
|
||||
|
||||
case DeclKind::IfConfig:
|
||||
case DeclKind::PoundDiagnostic:
|
||||
return false;
|
||||
|
||||
@@ -5061,10 +5060,6 @@ public:
|
||||
llvm_unreachable("import decls should not be serialized");
|
||||
}
|
||||
|
||||
void visitIfConfigDecl(const IfConfigDecl *) {
|
||||
llvm_unreachable("#if block declarations should not be serialized");
|
||||
}
|
||||
|
||||
void visitPoundDiagnosticDecl(const PoundDiagnosticDecl *) {
|
||||
llvm_unreachable("#warning/#error declarations should not be serialized");
|
||||
}
|
||||
@@ -6713,9 +6708,8 @@ void Serializer::writeAST(ModuleOrSourceFile DC) {
|
||||
nextFile->getTopLevelDeclsWithAuxiliaryDecls(fileDecls);
|
||||
|
||||
for (auto D : fileDecls) {
|
||||
if (isa<ImportDecl>(D) || isa<IfConfigDecl>(D) ||
|
||||
isa<PoundDiagnosticDecl>(D) || isa<TopLevelCodeDecl>(D) ||
|
||||
isa<MacroExpansionDecl>(D)) {
|
||||
if (isa<ImportDecl>(D) || isa<MacroExpansionDecl>(D) ||
|
||||
isa<PoundDiagnosticDecl>(D) || isa<TopLevelCodeDecl>(D)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user