aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/debug-CallGraph.c
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-12-21 17:27:01 +0000
committerAnna Zaks <ganna@apple.com>2012-12-21 17:27:01 +0000
commitbd80231672a7418aa1a99d3dbbe1774205c88f74 (patch)
tree2b0616e6d9735505ac7749b19a5a811f87c4db1d /test/Analysis/debug-CallGraph.c
parent95f38f614c8005b5cc398021e1f9e28ed233d533 (diff)
[analyzer] Re-apply r170826 and make the dumping of the GallGraph
deterministic. Commit message for r170826: [analyzer] Traverse the Call Graph in topological order. Modify the call graph by removing the parentless nodes. Instead all nodes are children of root to ensure they are all reachable. Remove the tracking of nodes that are "top level" or global. This information is not used and can be obtained from the Decls stored inside CallGraphNodes. Instead of existing ordering hacks, analyze the functions in topological order over the Call Graph. Together with the addition of devirtualizable ObjC message sends and blocks to the call graph, this gives around 6% performance improvement on several large ObjC benchmarks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/debug-CallGraph.c')
-rw-r--r--test/Analysis/debug-CallGraph.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/Analysis/debug-CallGraph.c b/test/Analysis/debug-CallGraph.c
index b7c7c8a844..4523c78935 100644
--- a/test/Analysis/debug-CallGraph.c
+++ b/test/Analysis/debug-CallGraph.c
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCallGraph %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCallGraph %s -fblocks 2>&1 | FileCheck %s
static void mmm(int y) {
if (y != 0)
y++;
- y = y/0;
+ y = y/y;
}
static int foo(int x, int y) {
@@ -17,5 +17,17 @@ void aaa() {
foo(1,2);
}
+void bbb(int y) {
+ int x = (y > 2);
+ ^ {
+ foo(x, y);
+ }();
+}
+
// CHECK:--- Call graph Dump ---
-// CHECK: Function: < root > calls: aaa
+// CHECK: Function: < root > calls: mmm foo aaa < > bbb
+// CHECK: Function: bbb calls: < >
+// CHECK: Function: < > calls: foo
+// CHECK: Function: aaa calls: foo
+// CHECK: Function: foo calls: mmm
+// CHECK: Function: mmm calls: