Skip to content

Commit dcca587

Browse files
committed
Revert "PrintAsClang: Ignore nullability attributes for C clients"
This reverts commit 20e1ac6.
1 parent 21e8619 commit dcca587

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

lib/PrintAsClang/PrintAsClang.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -218,21 +218,6 @@ static void writePrologue(raw_ostream &out, ASTContext &ctx,
218218

219219
static_assert(SWIFT_MAX_IMPORTED_SIMD_ELEMENTS == 4,
220220
"need to add SIMD typedefs here if max elements is increased");
221-
222-
if (ctx.LangOpts.hasFeature(Feature::CDecl)) {
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";
235-
}
236221
}
237222

238223
static int compareImportModulesByName(const ImportModuleTy *left,

0 commit comments

Comments
 (0)