Merge pull request #85439 from egorzhdan/egorzhdan/endif-objc

[cxx-interop] Emit `#endif // defined(__OBJC__)` with the comment consistently
This commit is contained in:
Egor Zhdan
2025-11-13 03:59:17 +00:00
committed by GitHub
5 changed files with 7 additions and 7 deletions

View File

@@ -1574,7 +1574,7 @@ private:
}
os << "\n";
if (representation.isObjCxxOnly())
os << "#endif\n";
os << "#endif // defined(__OBJC__)\n";
return representation;
}
@@ -1684,7 +1684,7 @@ private:
FD->getParameters(), funcTy->isThrowing(), funcTy);
os << "}\n";
if (result.isObjCxxOnly())
os << "#endif\n";
os << "#endif // defined(__OBJC__)\n";
}
enum class PrintLeadingSpace : bool {

View File

@@ -56,7 +56,7 @@ static void emitObjCConditional(raw_ostream &out,
out << "#else\n";
nonObjCCase();
}
out << "#endif\n";
out << "#endif // defined(__OBJC__)\n";
}
static void emitExternC(raw_ostream &out,

View File

@@ -1686,7 +1686,7 @@ void DeclAndTypeClangFunctionPrinter::printCxxMethod(
if (!isDefinition) {
os << ";\n";
if (result.isObjCxxOnly())
os << "#endif\n";
os << "#endif // defined(__OBJC__)\n";
return;
}
@@ -1699,7 +1699,7 @@ void DeclAndTypeClangFunctionPrinter::printCxxMethod(
dispatchInfo);
os << " }\n";
if (result.isObjCxxOnly())
os << "#endif\n";
os << "#endif // defined(__OBJC__)\n";
}
/// Returns true if the given property name like `isEmpty` can be remapped

View File

@@ -737,7 +737,7 @@ void ClangValueTypePrinter::printTypeGenericTraits(
os << "} // namespace\n";
os << "#pragma clang diagnostic pop\n";
if (objCxxOnly)
os << "#endif // #if defined(__OBJC__)\n";
os << "#endif // defined(__OBJC__)\n";
os << "} // namespace swift\n";
os << "\n";
printer.printModuleNamespaceStart(*moduleContext);

View File

@@ -412,7 +412,7 @@ SWIFT_CLASS("_TtC8comments13UnorderedList")
- (void)f0;
@end
#endif
#endif // defined(__OBJC__)
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif