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(
116
116
" this is disabled we do not serialize in OSSA "
117
117
" form when optimizing." ));
118
118
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
+
119
124
// This function isn't referenced outside its translation unit, but it
120
125
// can't use the "static" keyword because its address is used for
121
126
// getMainExecutable (since some platforms don't support taking the
@@ -250,6 +255,15 @@ int main(int argc, char **argv) {
250
255
Invocation.getLangOptions ().EnableAccessControl = false ;
251
256
Invocation.getLangOptions ().EnableObjCAttrRequiresFoundation = false ;
252
257
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
+
253
267
SILOptions &Opts = Invocation.getSILOptions ();
254
268
Opts.EmitVerboseSIL = EmitVerboseSIL;
255
269
Opts.EmitSortedSIL = EmitSortedSIL;
You can’t perform that action at this time.
0 commit comments