File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ static llvm::cl::opt<bool> EnableOSSAModules(
116116 " this is disabled we do not serialize in OSSA "
117117 " form when optimizing." ));
118118
119+ static llvm::cl::opt<llvm::cl::boolOrDefault> EnableObjCInterop (
120+ " enable-objc-interop" ,
121+ llvm::cl::desc (" Whether the Objective-C interop should be enabled. "
122+ " The value is `true` by default on Darwin platforms." ));
123+
119124// This function isn't referenced outside its translation unit, but it
120125// can't use the "static" keyword because its address is used for
121126// getMainExecutable (since some platforms don't support taking the
@@ -250,6 +255,15 @@ int main(int argc, char **argv) {
250255 Invocation.getLangOptions ().EnableAccessControl = false ;
251256 Invocation.getLangOptions ().EnableObjCAttrRequiresFoundation = false ;
252257
258+ if (EnableObjCInterop == llvm::cl::BOU_UNSET) {
259+ Invocation.getLangOptions ().EnableObjCInterop =
260+ Invocation.getLangOptions ().Target .isOSDarwin ();
261+ } else if (EnableObjCInterop == llvm::cl::BOU_TRUE) {
262+ Invocation.getLangOptions ().EnableObjCInterop = true ;
263+ } else {
264+ Invocation.getLangOptions ().EnableObjCInterop = false ;
265+ }
266+
253267 SILOptions &Opts = Invocation.getSILOptions ();
254268 Opts.EmitVerboseSIL = EmitVerboseSIL;
255269 Opts.EmitSortedSIL = EmitSortedSIL;
You can’t perform that action at this time.
0 commit comments