summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-06-21 00:20:25 +0000
committerDouglas Gregor <dgregor@apple.com>2013-06-21 00:20:25 +0000
commit600a2f5a215619765d6f9e96e898b8dab43fb039 (patch)
tree240d12d3bde73ee6c811288b807769ef11e4377e /clang/test/Modules
parent725de3e14ff288a92bed36241cdc2c22be55ee0e (diff)
downloadbcm5719-llvm-600a2f5a215619765d6f9e96e898b8dab43fb039.tar.gz
bcm5719-llvm-600a2f5a215619765d6f9e96e898b8dab43fb039.zip
When building a module, keep *all* declared methods in the global method pool.
As an optimization, we only kept declared methods with distinct signatures in the global method pool, to keep the method lists small. Under modules, however, one could have two different methods with the same signature that occur in different (sub)modules. If only the later submodule is important, message sends to 'id' with that selector would fail because the first method (the only one that got into the method pool) was hidden. When building a module, keep *all* of the declared methods. I did a quick check of both module build time and uses of modules, and found no performance regression despite this causing us to keep more methods in the global method pool. Fixes <rdar://problem/14148896>. llvm-svn: 184504
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/MethodPoolBSub.h1
-rw-r--r--clang/test/Modules/Inputs/module.map4
-rw-r--r--clang/test/Modules/method_pool.m4
3 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/MethodPoolBSub.h b/clang/test/Modules/Inputs/MethodPoolBSub.h
index 0a7899df81b..fbfc0aa1439 100644
--- a/clang/test/Modules/Inputs/MethodPoolBSub.h
+++ b/clang/test/Modules/Inputs/MethodPoolBSub.h
@@ -1,4 +1,5 @@
@interface B (Sub)
- (char *)method3;
- (char*)method4;
+- (id)method6;
@end
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index 249700a494a..5a95ce9edc0 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/test/Modules/Inputs/module.map
@@ -131,6 +131,10 @@ module MethodPoolA {
module MethodPoolB {
header "MethodPoolB.h"
+ explicit module Sub2 {
+ header "MethodPoolBSub2.h"
+ }
+
explicit module Sub {
header "MethodPoolBSub.h"
}
diff --git a/clang/test/Modules/method_pool.m b/clang/test/Modules/method_pool.m
index 6fd74b0885f..f7d5ae700c9 100644
--- a/clang/test/Modules/method_pool.m
+++ b/clang/test/Modules/method_pool.m
@@ -47,6 +47,10 @@ void testMethod3Again(id object) {
char *str = [object method3]; // okay: only found in MethodPoolB.Sub
}
+void testMethod6(id object) {
+ [object method6];
+}
+
@import MethodPoolA.Sub;
void testMethod3AgainAgain(id object) {
OpenPOWER on IntegriCloud