summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-06-19 00:37:39 +0000
committerTed Kremenek <kremenek@apple.com>2012-06-19 00:37:39 +0000
commit9dcc0325de8df0624591b0501ec8f6409d0a7777 (patch)
tree7c3475017f78d422fa63aa958db4d8e77b8c410f
parent8cea63c5cd15d7ef30fa3a1103ca5a6dd2715a36 (diff)
downloadbcm5719-llvm-9dcc0325de8df0624591b0501ec8f6409d0a7777.tar.gz
bcm5719-llvm-9dcc0325de8df0624591b0501ec8f6409d0a7777.zip
Sink definition of IBOutlet, IBOutletCollection, and IBAction into
the compiler predefines buffer. These are essentially part of the Objective-C language. llvm-svn: 158690
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp5
-rw-r--r--clang/test/Analysis/MissingDealloc.m6
-rwxr-xr-xclang/tools/scan-build/ccc-analyzer5
3 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 9eb970af26c..bd08f5c09d2 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/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/clang/test/Analysis/MissingDealloc.m b/clang/test/Analysis/MissingDealloc.m
index 51a5912d444..589fcf57f40 100644
--- a/clang/test/Analysis/MissingDealloc.m
+++ b/clang/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/clang/tools/scan-build/ccc-analyzer b/clang/tools/scan-build/ccc-analyzer
index 84d25ab6348..86a36161f9f 100755
--- a/clang/tools/scan-build/ccc-analyzer
+++ b/clang/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);
OpenPOWER on IntegriCloud