]> granicus.if.org Git - clang/commitdiff
improve of note message and minor refactoring of my last
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 15 May 2013 15:27:35 +0000 (15:27 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 15 May 2013 15:27:35 +0000 (15:27 +0000)
patch (r181847).

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

17 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExprObjC.cpp
test/Analysis/inlining/DynDispatchBifurcate.m
test/Analysis/rdar-6540084.m
test/Modules/objc-categories.m
test/PCH/chain-categories2.m
test/SemaObjC/call-super-2.m
test/SemaObjC/compare-qualified-id.m
test/SemaObjC/conditional-expr.m
test/SemaObjC/error-outof-scope-property-use.m
test/SemaObjC/instancetype.m
test/SemaObjC/message.m
test/SemaObjC/method-not-defined.m
test/SemaObjC/missing-atend-metadata.m
test/SemaObjC/property-5.m
test/SemaObjC/protocol-id-test-1.m
test/SemaObjCXX/instancetype.mm

index bac681e871396558e3cdcf8d14edf475dfb0db44..55f237736c234f694ad857722b87fa54f09a2a02 100644 (file)
@@ -500,7 +500,7 @@ def note_while_in_implementation : Note<
 def note_class_declared : Note<
   "class is declared here">;
 def note_receiver_class_declared : Note<
-  "receiver is object of the class that is declared here">;
+  "receiver is instance of class declared here">;
 def note_receiver_is_id : Note<
   "receiver is treated with 'id' type for purpose of method lookup">;
 def note_suppressed_class_declare : Note<
index 7c701ea040196923ed7c318105e8b69de1bfa9d9..23116d84addd619a4d2da03af3988d806b430607 100644 (file)
@@ -1227,11 +1227,9 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
                                                 SelectorLocs.back());
       // Find the class to which we are sending this message.
       if (ReceiverType->isObjCObjectPointerType()) {
-        QualType ClassType =
-          ReceiverType->getAs<ObjCObjectPointerType>()->getPointeeType();
-        if (const ObjCObjectType *ClassTPtr = ClassType->getAs<ObjCObjectType>())
-          if (ObjCInterfaceDecl *Class = ClassTPtr->getInterface())
-            Diag(Class->getLocation(), diag::note_receiver_class_declared);
+        if (ObjCInterfaceDecl *Class =
+              ReceiverType->getAs<ObjCObjectPointerType>()->getInterfaceDecl())
+          Diag(Class->getLocation(), diag::note_receiver_class_declared);
       }
     }
 
index d8af213a065f18503a7163dec60d006b3658ef87..0ce079654e9895ee73cca1078addd5491036952d 100644 (file)
@@ -181,7 +181,7 @@ int testPropertySynthesized(PublicClass *p) {
 }
 
 // Test definition not available edge case.
-@interface DefNotAvailClass : NSObject // expected-note {{receiver is object of the class that is declared here}}
+@interface DefNotAvailClass : NSObject // expected-note {{receiver is instance of class declared here}}
 @end
 id testDefNotAvailableInlined(DefNotAvailClass *C) {
   return [C mem]; // expected-warning {{instance method '-mem' not found}}
index d93450b5c5dd08d1615bfa5b50c98fbf954c9cf5..e928710b387d505365ca31c16f229d2bd4a7c019 100644 (file)
@@ -9,13 +9,13 @@ typedef struct _NSZone NSZone;
 @protocol NSObject  - (BOOL)isEqual:(id)object; @end
 @interface NSObject <NSObject> {} @end
 extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
-@class NSArray; // expected-note {{receiver is object of the class that is declared here}}
+@class NSArray; // expected-note {{receiver is instance of class declared here}}
 @class NSMutableArray, NSIndexSet, NSView, NSPredicate, NSString, NSViewAnimation, NSTimer; // expected-note{{forward declaration of class here}}
 @interface FooBazController : NSObject {}
 @end
 typedef struct {} TazVersion;
 @class TazNode;
-@interface TazGuttenberg : NSObject {} typedef NSUInteger BugsBunnyType; @end // expected-note {{receiver is object of the class that is declared here}}
+@interface TazGuttenberg : NSObject {} typedef NSUInteger BugsBunnyType; @end // expected-note {{receiver is instance of class declared here}}
 @interface FooBaz : NSObject {}
 @property (nonatomic) BugsBunnyType matchType;
 @property (nonatomic, retain) NSArray *papyrus; @end
index 07d1760980e80a36fd87d9b624775d45bcf541d8..f08b13a78ab2a1d47fe3981acd00bdb3e3906eb7 100644 (file)
@@ -10,7 +10,7 @@
 
 // expected-note@Inputs/category_left.h:14 {{previous definition}}
 // expected-warning@Inputs/category_right.h:11 {{duplicate definition of category}}
-// expected-note@Inputs/category_top.h:1 {{receiver is object of the class that is declared here}}
+// expected-note@Inputs/category_top.h:1 {{receiver is instance of class declared here}}
 
 @interface Foo(Source)
 -(void)source; 
index 8cb06a857cdebfc6561d2ba0737546520f68f9f8..50eea2a5606f484661a910cd273c3ae511852a4f 100644 (file)
@@ -45,7 +45,7 @@
 #else
 //===----------------------------------------------------------------------===//
 
-// expected-note@30 {{receiver is object of the class that is declared here}}
+// expected-note@30 {{receiver is instance of class declared here}}
 void f(I* i) {
   [i meth]; // expected-warning {{not found}}
 }
index 18a5f09407ee5e3935ad50d0c65b211db7de7a79..25cfbdd0879be78792e0f32e7824cd7ce61b19a5 100644 (file)
@@ -14,7 +14,7 @@ id objc_getClass(const char *s);
 - (int) instance_func0;
 @end
 
-@interface Derived: Object // expected-note {{receiver is object of the class that is declared here}}
+@interface Derived: Object // expected-note {{receiver is instance of class declared here}}
 + (int) class_func1;
 + (int) class_func2;
 + (int) class_func3;
index 0b7e106b3518e939ebd815440e9f2e84a0a5b05f..02fa86ec8d9eaf973f5e7d51ea475ac89d36c834 100644 (file)
@@ -12,7 +12,7 @@ typedef struct _NSZone NSZone;
 typedef struct {} NSFastEnumerationState;
 @protocol NSFastEnumeration  - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; @end
 @interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>  - (NSUInteger)count; @end
-@interface NSMutableDictionary : NSDictionary  - (void)removeObjectForKey:(id)aKey; @end // expected-note {{receiver is object of the class that is declared here}}
+@interface NSMutableDictionary : NSDictionary  - (void)removeObjectForKey:(id)aKey; @end // expected-note {{receiver is instance of class declared here}}
 extern NSString * const NSTaskDidTerminateNotification;
 
 @interface XCPropertyExpansionContext : NSObject <NSCopying> { // expected-note {{required for direct or indirect protocol 'NSCopying'}}
index 083453810cf15338f25d3b837b978d34384f70db..049a095ce37ca0a1b770f0dcbb63c0466ba38d08 100644 (file)
@@ -34,7 +34,7 @@
 
 // No @interface declaration for DTFilterOutputStream3
 @implementation DTFilterOutputStream3 // expected-warning {{cannot find interface declaration for 'DTFilterOutputStream3'}} \
-                                     // expected-note {{receiver is object of the class that is declared here}}
+                                     // expected-note {{receiver is instance of class declared here}}
 - (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
   id <DTOutputStreams> nextOutputStream = [self nextOutputStream]; // expected-warning {{method '-nextOutputStream' not found (return type defaults to 'id')}}
   self = nextOutputStream; // expected-warning {{assigning to 'DTFilterOutputStream3 *' from incompatible type 'id<DTOutputStreams>'}}
index 023687bbf4d2fe75ec63c0d3c81c95da7d4e9f2e..8ab9f55745563c00fb4edc578d541bb2ffb977ab 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
 // rdar://13178483
 
-@class NSMutableDictionary; // expected-note {{receiver is object of the class that is declared here}}
+@class NSMutableDictionary; // expected-note {{receiver is instance of class declared here}}
 
 @interface LaunchdJobs 
 
index 237489027151daa5094b6371d6792e0ff49fdc7d..7811d3eba583478f8da9aa403071ce4831edc20e 100644 (file)
@@ -25,7 +25,7 @@
 - (instancetype)otherMethodInProto2; // expected-note{{overridden method returns an instance of its class type}}
 @end
 
-@interface Subclass1 : Root // expected-note 4 {{receiver is object of the class that is declared here}}
+@interface Subclass1 : Root // expected-note 4 {{receiver is instance of class declared here}}
 - (instancetype)initSubclass1;
 - (void)methodOnSubclass1;
 + (instancetype)allocSubclass1;
index fc75cdbf6e202cd517bc64725a227f3598b2b468..2c4d8066f60412a271438875cc516681ede0eb9b 100644 (file)
@@ -107,7 +107,7 @@ void foo5(id p) {
                  // expected-warning {{instance method '-bar' not found}}
 }
 
-@interface I1 // expected-note {{receiver is object of the class that is declared here}}
+@interface I1 // expected-note {{receiver is instance of class declared here}}
 -(void)unavail_meth  __attribute__((unavailable)); // expected-note {{marked unavailable here}}
 @end
 
index 8f43c5daa7ebc0088c714f2c1fb4a2f53011edff..792469b719c685ae8a121f9355e2656ab945ddda 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-@interface Foo // expected-note {{receiver is object of the class that is declared here}}
+@interface Foo // expected-note {{receiver is instance of class declared here}}
 @end
 
 void test() {
index 9d0024ac65548e16e10d7758cd63297ba658bd82..f235ab94d82175bba2353557d9423e3a9e9ca3c4 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s 
 
-@interface I0  // expected-note {{receiver is object of the class that is declared here}}
+@interface I0  // expected-note {{receiver is instance of class declared here}}
 @end
 
 @implementation I0 // expected-note {{implementation started here}}
index 782f77cfeaa80b5666f261a7b7367b457f3d97d5..cf4f87392b6a1d97453e3dbee4a0d6ee7ebb9bde 100644 (file)
@@ -8,7 +8,7 @@
 
 @interface MutableNSData : NSData @end
 
-@interface Base : NSData <P1> // expected-note {{receiver is object of the class that is declared here}}
+@interface Base : NSData <P1> // expected-note {{receiver is instance of class declared here}}
 @property(readonly) id ref;
 @property(readonly) Base *p_base;
 @property(readonly) NSData *nsdata;
index 013f291ad92b0a70975c363948a0498803f3d8c9..36e23ed9f29d1853c1f9c15d6138843a503b01f7 100644 (file)
@@ -7,7 +7,7 @@
 @protocol P
 @end
 
-@interface INTF<P> // expected-note {{receiver is object of the class that is declared here}}
+@interface INTF<P> // expected-note {{receiver is instance of class declared here}}
 - (void)IMeth;
 @end
 
index 87663b971681800f6b8a5db00a991d3d5451a271..89ff2b4b0326623e7b226231f02af45eb1ffed43 100644 (file)
@@ -25,7 +25,7 @@
 - (instancetype)otherMethodInProto2; // expected-note{{overridden method returns an instance of its class type}}
 @end
 
-@interface Subclass1 : Root // expected-note 4 {{receiver is object of the class that is declared here}}
+@interface Subclass1 : Root // expected-note 4 {{receiver is instance of class declared here}}
 - (instancetype)initSubclass1;
 - (void)methodOnSubclass1;
 + (instancetype)allocSubclass1;