summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/objc-method-coverage.m
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-04-12 22:36:48 +0000
committerAnna Zaks <ganna@apple.com>2012-04-12 22:36:48 +0000
commit8e0785286a8175cfb5315e29ca72a882e86e7d37 (patch)
treef13cb01f028351e88174995e04afc6ce009dde55 /clang/test/Analysis/objc-method-coverage.m
parent9fcb055917c4d757678895a324d78f7eb42c1037 (diff)
downloadbcm5719-llvm-8e0785286a8175cfb5315e29ca72a882e86e7d37.tar.gz
bcm5719-llvm-8e0785286a8175cfb5315e29ca72a882e86e7d37.zip
[analyzer] PCH deserialization optimization.
We should not deserialize unused declarations from the PCH file. Achieve this by storing the top level declarations during parsing (HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call graph only for those. Tested the patch on a sample ObjC file that uses PCH. With the patch, the analyzes is 17.5% faster and clang consumes 40% less memory. Got about 10% overall build/analyzes time decrease on a large Objective C project. A bit of CallGraph refactoring/cleanup as well.. llvm-svn: 154625
Diffstat (limited to 'clang/test/Analysis/objc-method-coverage.m')
-rw-r--r--clang/test/Analysis/objc-method-coverage.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Analysis/objc-method-coverage.m b/clang/test/Analysis/objc-method-coverage.m
new file mode 100644
index 00000000000..056aafe5187
--- /dev/null
+++ b/clang/test/Analysis/objc-method-coverage.m
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-ipa=inlining -analyzer-stats -fblocks %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-ipa=none -analyzer-stats -fblocks %s 2>&1 | FileCheck %s
+
+@interface I
+int f() {
+ return 0;
+}
+@end
+
+@implementation I
++ (void *)ff{
+ return (void*)0;
+}
+@end
+
+// CHECK: ... Statistics Collected ...
+// CHECK: 2 AnalysisConsumer - The # of functions analysed (as top level). \ No newline at end of file
OpenPOWER on IntegriCloud