aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-17 00:09:08 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-17 00:09:08 +0000
commite7a77727804c12750cb39e8732e26f2a26e4ce0f (patch)
tree0495705ef5f494d3dd5e65439c3c89bd13b5f84f /test/SemaObjC
parent685d10462b875f8c056d27488c0a1b4e13ef680f (diff)
Use the extra info in global method pool to speed up looking for ObjC overridden methods.
When we are in a implementation, we check the global method pool whether there were category methods with the same selector. If there were none (common case) we don't need to do lookups for overridden methods again. Note that for an interface method (if we don't encounter its implementation), it is considered that it overrides methods that were declared before it, not for category methods introduced after it. This is tradeoff in favor of performance, since it is expensive to do lookups in case there was a category, and moving the global method pool to ASTContext (so we can check it) would increase complexity. rdar://13508196 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC')
-rw-r--r--test/SemaObjC/arc-repeated-weak.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/SemaObjC/arc-repeated-weak.mm b/test/SemaObjC/arc-repeated-weak.mm
index eb818a8737..b5d9002130 100644
--- a/test/SemaObjC/arc-repeated-weak.mm
+++ b/test/SemaObjC/arc-repeated-weak.mm
@@ -345,8 +345,12 @@ void test1(Sub1 *s) {
@end
void test2(Sub1 *s) {
- use([s prop]); // expected-warning{{weak property 'prop' is accessed multiple times}}
- use([s prop]); // expected-note{{also accessed here}}
+ // This does not warn because the "prop" in "Base1(cat)" was introduced
+ // after the method declaration and we don't find it as overridden.
+ // Always looking for overridden methods after the method declaration is expensive
+ // and it's not clear it is worth it currently.
+ use([s prop]);
+ use([s prop]);
}