Skip to content

Commit 8cb8686

Browse files
Merge pull request #73778 from kateinoigakukun/yt/cherry-pick-wasm-modulewrap-fix
[6.0] modulewrap: Disable ObjC interop by default on non-Darwin platforms
2 parents 4546899 + 33a89a6 commit 8cb8686

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/DriverTool/modulewrap_main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class ModuleWrapInvocation {
4848
llvm::Triple TargetTriple;
4949
std::vector<std::string> InputFilenames;
5050
bool UseSharedResourceFolder = true;
51+
bool EnableObjCInterop = true;
5152

5253
public:
5354
bool hasSingleInput() const { return InputFilenames.size() == 1; }
@@ -65,6 +66,7 @@ class ModuleWrapInvocation {
6566
llvm::Triple &getTargetTriple() { return TargetTriple; }
6667

6768
bool useSharedResourceFolder() { return UseSharedResourceFolder; }
69+
bool enableObjCInterop() { return EnableObjCInterop; }
6870

6971
int parseArgs(llvm::ArrayRef<const char *> Args, DiagnosticEngine &Diags) {
7072
using namespace options;
@@ -124,6 +126,9 @@ class ModuleWrapInvocation {
124126
UseSharedResourceFolder = false;
125127
}
126128

129+
EnableObjCInterop = ParsedArgs.hasFlag(OPT_enable_objc_interop,
130+
OPT_disable_objc_interop, TargetTriple.isOSDarwin());
131+
127132
return 0;
128133
}
129134
};
@@ -184,6 +189,7 @@ int modulewrap_main(ArrayRef<const char *> Args, const char *Argv0,
184189
symbolgraphgen::SymbolGraphOptions SymbolGraphOpts;
185190
CASOptions CASOpts;
186191
LangOpts.Target = Invocation.getTargetTriple();
192+
LangOpts.EnableObjCInterop = Invocation.enableObjCInterop();
187193
ASTContext &ASTCtx = *ASTContext::get(
188194
LangOpts, TypeCheckOpts, SILOpts, SearchPathOpts, ClangImporterOpts,
189195
SymbolGraphOpts, CASOpts, SrcMgr, Instance.getDiags(),

0 commit comments

Comments
 (0)