[cfe-commits] r158690 - in /cfe/trunk: lib/Frontend/InitPreprocessor.cpp test/Analysis/MissingDealloc.m tools/scan-build/ccc-analyzer

Douglas Gregor dgregor at apple.com
Tue Jun 19 16:33:54 PDT 2012


On Jun 18, 2012, at 5:37 PM, Ted Kremenek <kremenek at apple.com> wrote:

> Author: kremenek
> Date: Mon Jun 18 19:37:39 2012
> New Revision: 158690
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=158690&view=rev
> Log:
> Sink definition of IBOutlet, IBOutletCollection, and IBAction into
> the compiler predefines buffer.  These are essentially part of
> the Objective-C language.
> 
> Modified:
>    cfe/trunk/lib/Frontend/InitPreprocessor.cpp
>    cfe/trunk/test/Analysis/MissingDealloc.m
>    cfe/trunk/tools/scan-build/ccc-analyzer
> 
> Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=158690&r1=158689&r2=158690&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
> +++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Mon Jun 18 19:37:39 2012
> @@ -377,6 +377,11 @@
> 
>     if (LangOpts.NeXTRuntime)
>       Builder.defineMacro("__NEXT_RUNTIME__");
> +
> +    Builder.defineMacro("IBOutlet", "__attribute__((iboutlet))");
> +    Builder.defineMacro("IBOutletCollection(ClassName)",
> +                        "__attribute__((iboutletcollection(ClassName)))");
> +    Builder.defineMacro("IBAction", "void)__attribute__((ibaction)");
>   }

Almost makes me wonder if we should make them real keywords.

	- Doug

>   // darwin_constant_cfstrings controls this. This is also dependent
> 
> Modified: cfe/trunk/test/Analysis/MissingDealloc.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/MissingDealloc.m?rev=158690&r1=158689&r2=158690&view=diff
> ==============================================================================
> --- cfe/trunk/test/Analysis/MissingDealloc.m (original)
> +++ cfe/trunk/test/Analysis/MissingDealloc.m Mon Jun 18 19:37:39 2012
> @@ -1,4 +1,4 @@
> -// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.osx.cocoa.Dealloc '-DIBOutlet=__attribute__((iboutlet))' %s -verify
> +// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.osx.cocoa.Dealloc %s -verify
> typedef signed char BOOL;
> @protocol NSObject
> - (BOOL)isEqual:(id)object;
> @@ -53,10 +53,6 @@
> //===------------------------------------------------------------------------===
> //  Don't warn about iVars that are IBOutlets.
> 
> -#ifndef IBOutlet
> -#define IBOutlet
> -#endif
> -
> @class NSWindow;
> 
> @interface HasOutlet : NSObject {
> 
> Modified: cfe/trunk/tools/scan-build/ccc-analyzer
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/ccc-analyzer?rev=158690&r1=158689&r2=158690&view=diff
> ==============================================================================
> --- cfe/trunk/tools/scan-build/ccc-analyzer (original)
> +++ cfe/trunk/tools/scan-build/ccc-analyzer Mon Jun 18 19:37:39 2012
> @@ -182,11 +182,6 @@
>   }
>   else {
>     $Cmd = $Clang;
> -    if ($Lang eq "objective-c" || $Lang eq "objective-c++") {
> -      push @Args,'-DIBOutlet=__attribute__((iboutlet))';
> -      push @Args,'-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection)))';
> -      push @Args,'-DIBAction=void)__attribute__((ibaction)';
> -    }
> 
>     # Create arguments for doing regular parsing.
>     my $SyntaxArgs = GetCCArgs("-fsyntax-only", \@Args);
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list