mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[interop][SwiftToCxx] emit Swift's stdlib inside of 'swift' namespace
This commit is contained in:
@@ -200,24 +200,27 @@ void swift::printSwiftToClangCoreScaffold(SwiftToClangInteropContext &ctx,
|
||||
PrimitiveTypeMapping &typeMapping,
|
||||
raw_ostream &os) {
|
||||
ClangSyntaxPrinter printer(os);
|
||||
printer.printNamespace("swift", [&](raw_ostream &) {
|
||||
printer.printNamespace(
|
||||
cxx_synthesis::getCxxImplNamespaceName(), [&](raw_ostream &) {
|
||||
printer.printExternC([&](raw_ostream &os) {
|
||||
printTypeMetadataResponseType(ctx, typeMapping, os);
|
||||
os << "\n";
|
||||
printValueWitnessTable(os);
|
||||
os << "\n";
|
||||
printPrimitiveGenericTypeTraits(os, astContext, typeMapping,
|
||||
/*isCForwardDefinition=*/true);
|
||||
});
|
||||
os << "\n";
|
||||
printer.printNamespace(
|
||||
cxx_synthesis::getCxxSwiftNamespaceName(),
|
||||
[&](raw_ostream &) {
|
||||
printer.printNamespace(
|
||||
cxx_synthesis::getCxxImplNamespaceName(), [&](raw_ostream &) {
|
||||
printer.printExternC([&](raw_ostream &os) {
|
||||
printTypeMetadataResponseType(ctx, typeMapping, os);
|
||||
os << "\n";
|
||||
printValueWitnessTable(os);
|
||||
os << "\n";
|
||||
printPrimitiveGenericTypeTraits(os, astContext, typeMapping,
|
||||
/*isCForwardDefinition=*/true);
|
||||
});
|
||||
os << "\n";
|
||||
});
|
||||
os << "\n";
|
||||
// C++ only supports inline variables from C++17.
|
||||
ClangSyntaxPrinter(os).printIgnoredCxx17ExtensionDiagnosticBlock([&]() {
|
||||
printPrimitiveGenericTypeTraits(os, astContext, typeMapping,
|
||||
/*isCForwardDefinition=*/false);
|
||||
});
|
||||
os << "\n";
|
||||
// C++ only supports inline variables from C++17.
|
||||
ClangSyntaxPrinter(os).printIgnoredCxx17ExtensionDiagnosticBlock([&]() {
|
||||
printPrimitiveGenericTypeTraits(os, astContext, typeMapping,
|
||||
/*isCForwardDefinition=*/false);
|
||||
});
|
||||
});
|
||||
},
|
||||
ClangSyntaxPrinter::NamespaceTrivia::AttributeSwiftPrivate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user