@@ -220,20 +220,18 @@ static void writePrologue(raw_ostream &out, ASTContext &ctx,
220220 static_assert (SWIFT_MAX_IMPORTED_SIMD_ELEMENTS == 4 ,
221221 " need to add SIMD typedefs here if max elements is increased" );
222222
223- if (ctx.LangOpts .hasFeature (Feature::CDecl)) {
224- // For C compilers which don’t support nullability attributes, ignore them;
225- // for ones which do, suppress warnings about them being an extension.
226- out << " #if !__has_feature(nullability)\n "
227- " # define _Nonnull\n "
228- " # define _Nullable\n "
229- " # define _Null_unspecified\n "
230- " #elif !defined(__OBJC__)\n "
231- " # pragma clang diagnostic ignored \" -Wnullability-extension\"\n "
232- " #endif\n "
233- " #if !__has_feature(nullability_nullable_result)\n "
234- " # define _Nullable_result _Nullable\n "
235- " #endif\n " ;
236- }
223+ // For C compilers which don’t support nullability attributes, ignore them;
224+ // for ones which do, suppress warnings about them being an extension.
225+ out << " #if !__has_feature(nullability)\n "
226+ " # define _Nonnull\n "
227+ " # define _Nullable\n "
228+ " # define _Null_unspecified\n "
229+ " #elif !defined(__OBJC__)\n "
230+ " # pragma clang diagnostic ignored \" -Wnullability-extension\"\n "
231+ " #endif\n "
232+ " #if !__has_feature(nullability_nullable_result)\n "
233+ " # define _Nullable_result _Nullable\n "
234+ " #endif\n " ;
237235}
238236
239237static int compareImportModulesByName (const ImportModuleTy *left,
@@ -618,7 +616,7 @@ bool swift::printAsClangHeader(raw_ostream &os, ModuleDecl *M,
618616
619617 // C content (@c)
620618 std::string moduleContentsScratch;
621- if (M-> getASTContext (). LangOpts . hasFeature (Feature::CDecl)) {
619+ {
622620 SmallPtrSet<ImportModuleTy, 8 > imports;
623621 llvm::raw_string_ostream cModuleContents{moduleContentsScratch};
624622 printModuleContentsAsC (cModuleContents, imports, *M, interopContext,
0 commit comments