r215603 - Objective-C. Handle case of multiple class methods
Fariborz Jahanian
fjahanian at apple.com
Wed Aug 13 16:38:04 PDT 2014
Author: fjahanian
Date: Wed Aug 13 18:38:04 2014
New Revision: 215603
URL: http://llvm.org/viewvc/llvm-project?rev=215603&view=rev
Log:
Objective-C. Handle case of multiple class methods
found in global pool as well. rdar://16808765
Modified:
cfe/trunk/lib/Sema/SemaExprObjC.cpp
cfe/trunk/test/SemaObjC/resolve-method-in-global-pool.m
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=215603&r1=215602&r2=215603&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Wed Aug 13 18:38:04 2014
@@ -2420,7 +2420,7 @@ ExprResult Sema::BuildInstanceMessage(Ex
receiverIsId);
if (Method)
if (ObjCMethodDecl *BestMethod =
- SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
+ SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
Method = BestMethod;
} else if (ReceiverType->isObjCClassType() ||
ReceiverType->isObjCQualifiedClassType()) {
@@ -2473,6 +2473,10 @@ ExprResult Sema::BuildInstanceMessage(Ex
<< Sel << SourceRange(LBracLoc, RBracLoc);
}
}
+ if (Method)
+ if (ObjCMethodDecl *BestMethod =
+ SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
+ Method = BestMethod;
}
}
}
Modified: cfe/trunk/test/SemaObjC/resolve-method-in-global-pool.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/resolve-method-in-global-pool.m?rev=215603&r1=215602&r2=215603&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/resolve-method-in-global-pool.m (original)
+++ cfe/trunk/test/SemaObjC/resolve-method-in-global-pool.m Wed Aug 13 18:38:04 2014
@@ -4,7 +4,9 @@
// rdar://16808765
- at interface NSObject @end
+ at interface NSObject
++ (void)clsMethod:(int*)arg;
+ at end
@class NSDictionary;
@class NSError;
@@ -18,6 +20,7 @@
@required
- (void)getDonuts:(void (^)(NSDictionary *))replyBlock;
- (void)getCake:(float*)arg, ...;
++ (void)clsMethod:(float*)arg;
@end
@implementation Foo
@@ -33,3 +36,7 @@
[(id)0 getCake: &g, 1,3.14];
}
@end
+
+void func( Class c, float g ) {
+ [c clsMethod: &g];
+}
More information about the cfe-commits
mailing list