]> granicus.if.org Git - clang/commitdiff
Sink definition of IBOutlet, IBOutletCollection, and IBAction into
authorTed Kremenek <kremenek@apple.com>
Tue, 19 Jun 2012 00:37:39 +0000 (00:37 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 19 Jun 2012 00:37:39 +0000 (00:37 +0000)
the compiler predefines buffer.  These are essentially part of
the Objective-C language.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158690 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/InitPreprocessor.cpp
test/Analysis/MissingDealloc.m
tools/scan-build/ccc-analyzer

index 9eb970af26cf2bd13b2d768c349080770ad90c03..bd08f5c09d2ea3f8ac28a0314489484d537cffc2 100644 (file)
@@ -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
index 51a5912d444339668c37b44664f2b05062bf895b..589fcf57f40cedf898af3013a887b054fa30021e 100644 (file)
@@ -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 {
index 84d25ab6348a1a298d59eaedce9532aa39d96440..86a36161f9fc8f9545468f1eaf449305aeae8ad8 100755 (executable)
@@ -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);