From e1e33f8e8248d73f2603a7542299fc3b405ad4a7 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 1 Nov 2013 21:58:17 +0000 Subject: ObjectiveC. Define a new cc1 flag -fobjc-subscripting-legacy-runtime which is off by default and on only when using ObjectiveC legacy runtime. Use this flag to allow array and dictionary subscripting and disallow objectiveC pointer arithmatic in ObjectiveC legacy runtime. // rdar://15363492 llvm-svn: 193889 --- clang/lib/Frontend/CompilerInvocation.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 2f64071..3da8ba7 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1218,6 +1218,10 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, if (Args.hasArg(OPT_fno_objc_infer_related_result_type)) Opts.ObjCInferRelatedResultType = 0; + + if (Args.hasArg(OPT_fobjc_subscripting_legacy_runtime)) + Opts.ObjCSubscriptingLegacyRuntime = + (Opts.ObjCRuntime.getKind() == ObjCRuntime::FragileMacOSX); } if (Args.hasArg(OPT_fgnu89_inline)) -- cgit v1.1