mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[interop][SwiftToCxx] Gather initial struct layout information and emit struct stubs with storage in C++
This change extends the clang header printer to start emitting C++ classes for Swift struct types with the correct struct layout in them (size + alignment)
This commit is contained in:
@@ -180,13 +180,14 @@ static bool writeSIL(SILModule &SM, const PrimarySpecificPaths &PSPs,
|
||||
/// \see swift::printAsClangHeader
|
||||
static bool printAsClangHeaderIfNeeded(StringRef outputPath, ModuleDecl *M,
|
||||
StringRef bridgingHeader,
|
||||
bool ExposePublicDeclsInClangHeader) {
|
||||
bool ExposePublicDeclsInClangHeader,
|
||||
const IRGenOptions &irGenOpts) {
|
||||
if (outputPath.empty())
|
||||
return false;
|
||||
return withOutputFile(
|
||||
M->getDiags(), outputPath, [&](raw_ostream &out) -> bool {
|
||||
return printAsClangHeader(out, M, bridgingHeader,
|
||||
ExposePublicDeclsInClangHeader);
|
||||
ExposePublicDeclsInClangHeader, irGenOpts);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -859,7 +860,7 @@ static bool emitAnyWholeModulePostTypeCheckSupplementaryOutputs(
|
||||
hadAnyError |= printAsClangHeaderIfNeeded(
|
||||
Invocation.getClangHeaderOutputPathForAtMostOnePrimary(),
|
||||
Instance.getMainModule(), BridgingHeaderPathForPrint,
|
||||
opts.ExposePublicDeclsInClangHeader);
|
||||
opts.ExposePublicDeclsInClangHeader, Invocation.getIRGenOptions());
|
||||
}
|
||||
|
||||
// Only want the header if there's been any errors, ie. there's not much
|
||||
|
||||
Reference in New Issue
Block a user