Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/IRGen/IRGenSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2564,7 +2564,7 @@ void IRGenModule::emitSILFunction(SILFunction *f) {
return;

// Type metadata for foreign references is not yet supported on Windows. Bug #76168.
if (Context.LangOpts.EnableCXXInterop &&
if (Context.LangOpts.EnableCXXInterop && !Context.LangOpts.hasFeature(Feature::Embedded) &&
f->getLinkage() == SILLinkage::Public &&
!Context.LangOpts.Target.isOSWindows())
noteUseOfMetadataByCXXInterop(IRGen, f, TypeExpansionContext(*f));
Expand Down
30 changes: 30 additions & 0 deletions test/embedded/cxx-no-metadata.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// RUN: %empty-directory(%t)
// RUN: %{python} %utils/split_file.py -o %t %s

// RUN: %target-swift-frontend -I %t %t/Main.swift -enable-experimental-feature Embedded -cxx-interoperability-mode=default -c -o %t/a.o -Rmodule-loading

// REQUIRES: swift_in_compiler
// REQUIRES: OS=macosx || OS=linux-gnu
// REQUIRES: swift_feature_Embedded

// BEGIN header.h

// C++
struct CxxStruct {
int field;
};

// BEGIN module.modulemap

module MyModule {
header "header.h"
}

// BEGIN Main.swift

import MyModule

public func foo(ptr: UnsafeMutablePointer<CxxStruct>?) {
}

foo(ptr: nil)