On Mar 3, 2015, at 1:28 AM, Chandler Carruth <[email protected]> wrote:

> 
> On Mon, Mar 2, 2015 at 12:43 PM, Fariborz Jahanian <[email protected]> 
> wrote:
> Author: fjahanian
> Date: Mon Mar  2 14:43:32 2015
> New Revision: 231008
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=231008&view=rev
> Log:
> [SDK modernizer]. Patch fixes driver's lack of
> recognition of mernizer's -objcmt-migrate-property-dot-syntax
> option. rdar://19994452
> 
> Modified:
>     cfe/trunk/lib/Driver/Tools.cpp
>     cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m
>     cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result
> 
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=231008&r1=231007&r2=231008&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Mon Mar  2 14:43:32 2015
> @@ -3448,6 +3448,7 @@ void Clang::ConstructJob(Compilation &C,
>      Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_all);
>      Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readonly_property);
>      Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readwrite_property);
> +    Args.AddLastArg(CmdArgs, 
> options::OPT_objcmt_migrate_property_dot_syntax);
>      Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_annotation);
>      Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_instancetype);
>      Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_nsmacros);
> 
> Modified: cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m?rev=231008&r1=231007&r2=231008&view=diff
> ==============================================================================
> --- cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m (original)
> +++ cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m Mon Mar  2 14:43:32 2015
> @@ -2,6 +2,8 @@
>  // RUN: %clang_cc1 -objcmt-migrate-property-dot-syntax -mt-migrate-directory 
> %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple 
> x86_64-apple-darwin11
>  // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test 
> -verify-transformed-files %s.result
>  // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x 
> objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
> +// RUN: rm -rf %t.1
> +// RUN: %clang -fsyntax-only -objcmt-migrate-property-dot-syntax -Xclang 
> -mt-migrate-directory -Xclang %t.1 %s -fobjc-arc -Xclang -triple -Xclang 
> x86_64-apple-darwin11
> 
>  // rdar://18498572
>  @interface NSObject @end
> 
> Modified: cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result?rev=231008&r1=231007&r2=231008&view=diff
> ==============================================================================
> --- cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result (original)
> +++ cfe/trunk/test/ARCMT/objcmt-property-dot-syntax.m.result Mon Mar  2 
> 14:43:32 2015
> @@ -2,6 +2,8 @@
>  // RUN: %clang_cc1 -objcmt-migrate-property-dot-syntax -mt-migrate-directory 
> %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple 
> x86_64-apple-darwin11
>  // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test 
> -verify-transformed-files %s.result
>  // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x 
> objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
> +// RUN: rm -rf %t.1
> +// RUN: %clang -fsyntax-only -objcmt-migrate-property-dot-syntax -Xclang 
> -mt-migrate-directory -Xclang %t.1 %s -fobjc-arc -Xclang -triple -Xclang 
> x86_64-apple-darwin11
> 
> This isn't really the right way to test the driver.
> 
> We usually test changes to the driver by adding a test under 'test/Driver' 
> and using '-###' in conjunction with FileCheck to assert on the commandline 
> formed by the driver.
> 
> Among other things, by using the driver here rather than the cc1 layer you 
> have the following problems:
> 
> - you have to carefully manage the -fobc-arc flags as you've already had to 
> tweak in subsequent commits
> - on non-x86 platforms the driver may end up producing very flawed cc1 
> invocations in conjunction with the hard-coded cc1 flags of '-Xclang -triple 
> -Xclang x86_64-apple-darwin11'
> 
> At least for non-x86 platforms, this is actually a breaking change and we 
> need to revert it to get builds green again.

Yes. I noticed it was reverted. Thanks, will come up with a more rational test.
- Fariborz


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to