From 6a3469f58d0c230e86043f6975f048968334dfa4 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Tue, 5 May 2020 18:51:28 -0700 Subject: [ObjC] Add compatibility mode for type checking of qualified id block parameters. Commit 73152a2ec20766ac45673a129bf1f5fc97ca9bbe fixed type checking for blocks with qualified id parameters. But there are existing APIs in Apple SDKs relying on the old type checking behavior. Specifically, these are APIs using NSItemProviderCompletionHandler in Foundation/NSItemProvider.h. To keep existing code working and to allow developers to use affected APIs introduce a compatibility mode that enables the previous and the fixed type checking. This mode is enabled only on Darwin platforms. Reviewed By: jyknight, ahatanak Differential Revision: https://reviews.llvm.org/D79511 --- clang/lib/Frontend/CompilerInvocation.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index ff2683c..7e4bb6ea 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3381,6 +3381,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.BranchTargetEnforcement = Args.hasArg(OPT_mbranch_target_enforce); Opts.SpeculativeLoadHardening = Args.hasArg(OPT_mspeculative_load_hardening); + + Opts.CompatibilityQualifiedIdBlockParamTypeChecking = + Args.hasArg(OPT_fcompatibility_qualified_id_block_param_type_checking); } static bool isStrictlyPreprocessorAction(frontend::ActionKind Action) { -- cgit v1.1