diff options
-rw-r--r-- | lib/Frontend/InitPreprocessor.cpp | 5 | ||||
-rw-r--r-- | test/Analysis/MissingDealloc.m | 6 | ||||
-rwxr-xr-x | tools/scan-build/ccc-analyzer | 5 |
3 files changed, 6 insertions, 10 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 9eb970af26..bd08f5c09d 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -377,6 +377,11 @@ static void InitializePredefinedMacros(const TargetInfo &TI, 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)"); } // darwin_constant_cfstrings controls this. This is also dependent diff --git a/test/Analysis/MissingDealloc.m b/test/Analysis/MissingDealloc.m index 51a5912d44..589fcf57f4 100644 --- a/test/Analysis/MissingDealloc.m +++ b/test/Analysis/MissingDealloc.m @@ -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 @@ typedef struct objc_selector *SEL; //===------------------------------------------------------------------------=== // Don't warn about iVars that are IBOutlets. -#ifndef IBOutlet -#define IBOutlet -#endif - @class NSWindow; @interface HasOutlet : NSObject { diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer index 84d25ab634..86a36161f9 100755 --- a/tools/scan-build/ccc-analyzer +++ b/tools/scan-build/ccc-analyzer @@ -182,11 +182,6 @@ sub Analyze { } 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); |