mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[interop][SwiftToCxx] pass / return Swift struct values between C/C++ and Swift
This commit is contained in:
@@ -265,6 +265,9 @@ public:
|
||||
forwardDeclare(ED);
|
||||
} else if (isa<AbstractTypeParamDecl>(TD)) {
|
||||
llvm_unreachable("should not see type params here");
|
||||
} else if (isa<StructDecl>(TD)) {
|
||||
// FIXME: add support here.
|
||||
return;
|
||||
} else {
|
||||
assert(false && "unknown local type decl");
|
||||
}
|
||||
@@ -668,6 +671,7 @@ void swift::printModuleContentsAsCxx(
|
||||
M.ValueDecl::getName().print(os);
|
||||
os << " {\n";
|
||||
os << "namespace " << cxx_synthesis::getCxxImplNamespaceName() << " {\n";
|
||||
os << "extern \"C\" {\n";
|
||||
os << "#endif\n\n";
|
||||
|
||||
os << prologueOS.str();
|
||||
@@ -675,6 +679,7 @@ void swift::printModuleContentsAsCxx(
|
||||
os << "\n#ifdef __cplusplus\n";
|
||||
os << "}\n";
|
||||
os << "}\n";
|
||||
os << "}\n";
|
||||
}
|
||||
|
||||
// Construct a C++ namespace for the module.
|
||||
|
||||
Reference in New Issue
Block a user