Skip to content
Merged
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
13 changes: 13 additions & 0 deletions tools/sil-func-extractor/SILFunctionExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ static llvm::cl::opt<bool> EnableOSSAModules(
"this is disabled we do not serialize in OSSA "
"form when optimizing."));

static llvm::cl::opt<llvm::cl::boolOrDefault> EnableObjCInterop(
"enable-objc-interop",
llvm::cl::desc("Whether the Objective-C interop should be enabled. "
"The value is `true` by default on Darwin platforms."));

// This function isn't referenced outside its translation unit, but it
// can't use the "static" keyword because its address is used for
// getMainExecutable (since some platforms don't support taking the
Expand Down Expand Up @@ -250,6 +255,14 @@ int main(int argc, char **argv) {
Invocation.getLangOptions().EnableAccessControl = false;
Invocation.getLangOptions().EnableObjCAttrRequiresFoundation = false;

if (EnableObjCInterop == llvm::cl::BOU_UNSET) {
Invocation.getLangOptions().EnableObjCInterop =
Invocation.getLangOptions().Target.isOSDarwin();
} else {
Invocation.getLangOptions().EnableObjCInterop =
EnableObjCInterop == llvm::cl::BOU_TRUE;
}

SILOptions &Opts = Invocation.getSILOptions();
Opts.EmitVerboseSIL = EmitVerboseSIL;
Opts.EmitSortedSIL = EmitSortedSIL;
Expand Down