diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-07-02 20:21:48 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-07-02 20:21:48 +0000 |
commit | 146ef384da1428eaab5c0979418aa0daef3ed45e (patch) | |
tree | 1fbaeec768aa04c1241951c9768dbc97b6b489ad /clang/test/Analysis/traversal-algorithm.mm | |
parent | 6b963db39a3bffa12924753bf41c6be70fbe4c7f (diff) | |
download | bcm5719-llvm-146ef384da1428eaab5c0979418aa0daef3ed45e.tar.gz bcm5719-llvm-146ef384da1428eaab5c0979418aa0daef3ed45e.zip |
Fix subtle bug in AnalysisConsumer where we would not analyze functions whose parent
in the call graph had been inlined but for whatever reason we did not inline some
of its callees.
Also, fix a related traversal bug where we meant to do a BFS of the callgraph but
instead were doing a DFS.
llvm-svn: 159577
Diffstat (limited to 'clang/test/Analysis/traversal-algorithm.mm')
-rw-r--r-- | clang/test/Analysis/traversal-algorithm.mm | 208 |
1 files changed, 162 insertions, 46 deletions
diff --git a/clang/test/Analysis/traversal-algorithm.mm b/clang/test/Analysis/traversal-algorithm.mm index 49e72249e03..e8a36eafc73 100644 --- a/clang/test/Analysis/traversal-algorithm.mm +++ b/clang/test/Analysis/traversal-algorithm.mm @@ -23,43 +23,6 @@ void test(id input) { work(); } -// This ordering assumes that true cases happen before the false cases. - -// BFS: 10 IfStmt -// BFS-NEXT: 11 IfStmt -// BFS-NEXT: 16 IfStmt -// BFS-NEXT: 22 IfStmt -// BFS-NEXT: 22 IfStmt -// BFS-NEXT: 22 IfStmt -// BFS-NEXT: 22 IfStmt -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- - -// And this ordering assumes that false cases happen before the true cases. - -// DFS: 10 IfStmt -// DFS-NEXT: 16 IfStmt -// DFS-NEXT: 22 IfStmt -// DFS-NEXT: --END PATH-- -// DFS-NEXT: --END PATH-- -// DFS-NEXT: 22 IfStmt -// DFS-NEXT: --END PATH-- -// DFS-NEXT: --END PATH-- -// DFS-NEXT: 11 IfStmt -// DFS-NEXT: 22 IfStmt -// DFS-NEXT: --END PATH-- -// DFS-NEXT: --END PATH-- -// DFS-NEXT: 22 IfStmt -// DFS-NEXT: --END PATH-- -// DFS-NEXT: --END PATH-- - - void testLoops(id input) { while (a()) { work(); @@ -85,13 +48,166 @@ void testLoops(id input) { } } -// BFS: 64 WhileStmt -// BFS: 70 ForStmt -// BFS-NOT-NEXT: ObjCForCollectionStmt -// BFS: 74 ObjCForCollectionStmt -// BFS: 81 CXXForRangeStmt +// This ordering assumes that false cases happen before the true cases. + +// DFS:27 WhileStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:27 WhileStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:27 WhileStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:27 WhileStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:10 IfStmt +// DFS-next:16 IfStmt +// DFS-next:22 IfStmt +// DFS-next:--END PATH-- +// DFS-next:--END PATH-- +// DFS-next:22 IfStmt +// DFS-next:--END PATH-- +// DFS-next:--END PATH-- +// DFS-next:11 IfStmt +// DFS-next:22 IfStmt +// DFS-next:--END PATH-- +// DFS-next:--END PATH-- +// DFS-next:22 IfStmt +// DFS-next:--END PATH-- +// DFS-next:--END PATH-- -// DFS: 64 While -// DFS-NEXT: 70 ForStmt -// DFS-NEXT: 74 ObjCForCollectionStmt -// DFS-NEXT: 81 CXXForRangeStmt |