r181896 - improve of note message and minor refactoring of my last

Fariborz Jahanian fjahanian at apple.com
Wed May 15 08:27:36 PDT 2013


Author: fjahanian
Date: Wed May 15 10:27:35 2013
New Revision: 181896

URL: http://llvm.org/viewvc/llvm-project?rev=181896&view=rev
Log:
improve of note message and minor refactoring of my last
patch (r181847).

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

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed May 15 10:27:35 2013
@@ -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<

Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Wed May 15 10:27:35 2013
@@ -1227,11 +1227,9 @@ bool Sema::CheckMessageArgumentTypes(Qua
                                                 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);
       }
     }
 

Modified: cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m (original)
+++ cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m Wed May 15 10:27:35 2013
@@ -181,7 +181,7 @@ int testPropertySynthesized(PublicClass
 }
 
 // Test definition not available edge case.
- at interface DefNotAvailClass : NSObject // expected-note {{receiver is object of the class that is declared here}}
+ at 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}}

Modified: cfe/trunk/test/Analysis/rdar-6540084.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/rdar-6540084.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/rdar-6540084.m (original)
+++ cfe/trunk/test/Analysis/rdar-6540084.m Wed May 15 10:27:35 2013
@@ -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);
- at class NSArray; // expected-note {{receiver is object of the class that is declared here}}
+ at 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;
- at interface TazGuttenberg : NSObject {} typedef NSUInteger BugsBunnyType; @end // expected-note {{receiver is object of the class that is declared here}}
+ at 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

Modified: cfe/trunk/test/Modules/objc-categories.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/objc-categories.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/Modules/objc-categories.m (original)
+++ cfe/trunk/test/Modules/objc-categories.m Wed May 15 10:27:35 2013
@@ -10,7 +10,7 @@
 
 // expected-note at Inputs/category_left.h:14 {{previous definition}}
 // expected-warning at Inputs/category_right.h:11 {{duplicate definition of category}}
-// expected-note at Inputs/category_top.h:1 {{receiver is object of the class that is declared here}}
+// expected-note at Inputs/category_top.h:1 {{receiver is instance of class declared here}}
 
 @interface Foo(Source)
 -(void)source; 

Modified: cfe/trunk/test/PCH/chain-categories2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/chain-categories2.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/PCH/chain-categories2.m (original)
+++ cfe/trunk/test/PCH/chain-categories2.m Wed May 15 10:27:35 2013
@@ -45,7 +45,7 @@
 #else
 //===----------------------------------------------------------------------===//
 
-// expected-note at 30 {{receiver is object of the class that is declared here}}
+// expected-note at 30 {{receiver is instance of class declared here}}
 void f(I* i) {
   [i meth]; // expected-warning {{not found}}
 }

Modified: cfe/trunk/test/SemaObjC/call-super-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/call-super-2.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/call-super-2.m (original)
+++ cfe/trunk/test/SemaObjC/call-super-2.m Wed May 15 10:27:35 2013
@@ -14,7 +14,7 @@ id objc_getClass(const char *s);
 - (int) instance_func0;
 @end
 
- at interface Derived: Object // expected-note {{receiver is object of the class that is declared here}}
+ at interface Derived: Object // expected-note {{receiver is instance of class declared here}}
 + (int) class_func1;
 + (int) class_func2;
 + (int) class_func3;

Modified: cfe/trunk/test/SemaObjC/compare-qualified-id.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/compare-qualified-id.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/compare-qualified-id.m (original)
+++ cfe/trunk/test/SemaObjC/compare-qualified-id.m Wed May 15 10:27:35 2013
@@ -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
- at interface NSMutableDictionary : NSDictionary  - (void)removeObjectForKey:(id)aKey; @end // expected-note {{receiver is object of the class that is declared here}}
+ at 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'}}

Modified: cfe/trunk/test/SemaObjC/conditional-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/conditional-expr.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/conditional-expr.m (original)
+++ cfe/trunk/test/SemaObjC/conditional-expr.m Wed May 15 10:27:35 2013
@@ -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>'}}

Modified: cfe/trunk/test/SemaObjC/error-outof-scope-property-use.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/error-outof-scope-property-use.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/error-outof-scope-property-use.m (original)
+++ cfe/trunk/test/SemaObjC/error-outof-scope-property-use.m Wed May 15 10:27:35 2013
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
 // rdar://13178483
 
- at class NSMutableDictionary; // expected-note {{receiver is object of the class that is declared here}}
+ at class NSMutableDictionary; // expected-note {{receiver is instance of class declared here}}
 
 @interface LaunchdJobs 
 

Modified: cfe/trunk/test/SemaObjC/instancetype.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/instancetype.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/instancetype.m (original)
+++ cfe/trunk/test/SemaObjC/instancetype.m Wed May 15 10:27:35 2013
@@ -25,7 +25,7 @@
 - (instancetype)otherMethodInProto2; // expected-note{{overridden method returns an instance of its class type}}
 @end
 
- at interface Subclass1 : Root // expected-note 4 {{receiver is object of the class that is declared here}}
+ at interface Subclass1 : Root // expected-note 4 {{receiver is instance of class declared here}}
 - (instancetype)initSubclass1;
 - (void)methodOnSubclass1;
 + (instancetype)allocSubclass1;

Modified: cfe/trunk/test/SemaObjC/message.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/message.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/message.m (original)
+++ cfe/trunk/test/SemaObjC/message.m Wed May 15 10:27:35 2013
@@ -107,7 +107,7 @@ void foo5(id p) {
                  // expected-warning {{instance method '-bar' not found}}
 }
 
- at interface I1 // expected-note {{receiver is object of the class that is declared here}}
+ at interface I1 // expected-note {{receiver is instance of class declared here}}
 -(void)unavail_meth  __attribute__((unavailable)); // expected-note {{marked unavailable here}}
 @end
 

Modified: cfe/trunk/test/SemaObjC/method-not-defined.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-not-defined.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/method-not-defined.m (original)
+++ cfe/trunk/test/SemaObjC/method-not-defined.m Wed May 15 10:27:35 2013
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
- at interface Foo // expected-note {{receiver is object of the class that is declared here}}
+ at interface Foo // expected-note {{receiver is instance of class declared here}}
 @end
 
 void test() {

Modified: cfe/trunk/test/SemaObjC/missing-atend-metadata.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/missing-atend-metadata.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/missing-atend-metadata.m (original)
+++ cfe/trunk/test/SemaObjC/missing-atend-metadata.m Wed May 15 10:27:35 2013
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s 
 
- at interface I0  // expected-note {{receiver is object of the class that is declared here}}
+ at interface I0  // expected-note {{receiver is instance of class declared here}}
 @end
 
 @implementation I0 // expected-note {{implementation started here}}

Modified: cfe/trunk/test/SemaObjC/property-5.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-5.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-5.m (original)
+++ cfe/trunk/test/SemaObjC/property-5.m Wed May 15 10:27:35 2013
@@ -8,7 +8,7 @@
 
 @interface MutableNSData : NSData @end
 
- at interface Base : NSData <P1> // expected-note {{receiver is object of the class that is declared here}}
+ at 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;

Modified: cfe/trunk/test/SemaObjC/protocol-id-test-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-id-test-1.m?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/protocol-id-test-1.m (original)
+++ cfe/trunk/test/SemaObjC/protocol-id-test-1.m Wed May 15 10:27:35 2013
@@ -7,7 +7,7 @@
 @protocol P
 @end
 
- at interface INTF<P> // expected-note {{receiver is object of the class that is declared here}}
+ at interface INTF<P> // expected-note {{receiver is instance of class declared here}}
 - (void)IMeth;
 @end
 

Modified: cfe/trunk/test/SemaObjCXX/instancetype.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/instancetype.mm?rev=181896&r1=181895&r2=181896&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/instancetype.mm (original)
+++ cfe/trunk/test/SemaObjCXX/instancetype.mm Wed May 15 10:27:35 2013
@@ -25,7 +25,7 @@
 - (instancetype)otherMethodInProto2; // expected-note{{overridden method returns an instance of its class type}}
 @end
 
- at interface Subclass1 : Root // expected-note 4 {{receiver is object of the class that is declared here}}
+ at interface Subclass1 : Root // expected-note 4 {{receiver is instance of class declared here}}
 - (instancetype)initSubclass1;
 - (void)methodOnSubclass1;
 + (instancetype)allocSubclass1;





More information about the cfe-commits mailing list