summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CallGraph.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Fix typos.Anna Zaks2012-12-211-2/+2
| | | | llvm-svn: 170907
* [analyzer] Re-apply r170826 and make the dumping of the GallGraphAnna Zaks2012-12-211-13/+16
| | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 170906
* Revert r170826. The output ofRafael Espindola2012-12-211-2/+8
| | | | | | | | ./bin/clang -cc1 -internal-isystem /home/espindola/llvm/build/lib/clang/3.3/include/ -analyze -analyzer-checker=debug.DumpCallGraph /home/espindola/llvm/clang/test/Analysis/debug-CallGraph.c -fblocks changes in each run. llvm-svn: 170829
* [analyzer] Traverse the Call Graph in topological order.Anna Zaks2012-12-211-8/+2
| | | | | | | | | | | | | | | | | 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. llvm-svn: 170826
* [analyzer] Add blocks and ObjC messages to the call graph.Anna Zaks2012-12-211-14/+67
| | | | | | | | | | | This paves the road for constructing a better function dependency graph. If we analyze a function before the functions it calls and inlines, there is more opportunity for optimization. Note, we add call edges to the called methods that correspond to function definitions (declarations with bodies). llvm-svn: 170825
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+0
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Remove unused private member variables found by clang's new ↵Benjamin Kramer2012-06-061-4/+3
| | | | | | -Wunused-private-field. llvm-svn: 158086
* [analyzer] PCH deserialization optimization.Anna Zaks2012-04-121-61/+32
| | | | | | | | | | | | | | | | 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
* Do not crash in the callgraph construction when encountering deleted ↵Ted Kremenek2012-04-051-1/+2
| | | | | | function definitions. Fixes <rdar://problem/11178609>. llvm-svn: 154081
* Fix dereference of end iterator. Spotted by ASan.Matt Beaumont-Gay2012-03-141-1/+3
| | | | llvm-svn: 152738
* [analyzer] Refactor CallGraph to use Recursive AST visitor whenAnna Zaks2012-03-131-36/+32
| | | | | | collecting function Decls. llvm-svn: 152651
* CallGraph: Add getNode() method, constify.Anna Zaks2012-03-091-0/+4
| | | | llvm-svn: 152439
* Call Graph: Only the root node is allowed to have an invalid Decl*.Anna Zaks2012-03-081-1/+4
| | | | llvm-svn: 152350
* Remove stray semi-colon.Daniel Dunbar2012-03-081-1/+1
| | | | llvm-svn: 152331
* Add a basic CallGraph to Analysis.Anna Zaks2012-03-081-0/+207
| | | | | | | | | | The final graph contains a single root node, which is a parent of all externally available functions(and 'main'). As well as a list of Parentless/Unreachable functions, which are either truly unreachable or are unreachable due to our analyses imprecision. The analyzer checkers debug.DumpCallGraph or debug.ViewGraph can be used to look at the produced graph. Currently, the graph is not very precise, for example, it entirely skips edges resulted from ObjC method calls. llvm-svn: 152272
* Fix layering violation by moving Analysis/CallGraph to IndexDaniel Dunbar2009-12-031-150/+0
| | | | llvm-svn: 90424
* Adapt to the DOTGraphTraits changes in LLVM.Tobias Grosser2009-11-301-1/+3
| | | | llvm-svn: 90137
* Change *BugReport constructors to take StringRefs.Benjamin Kramer2009-11-141-1/+1
| | | | | | | | - Eliminates many calls to std::string.c_str() - Fixes an invalid read in ReturnStackAddressChecker due to an unsafe call to StringRef.data() which doesn't guarantee null-termination. llvm-svn: 88779
* make CallGraph more flexible by letting it accept ASTContext instead of ASTUnit.Zhongxing Xu2009-10-281-3/+1
| | | | | | Patch by Simone Pellegrini. llvm-svn: 85386
* Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:Argyrios Kyrtzidis2009-09-291-4/+1
| | | | | | | -A NamedDecl reference -A TypeLoc llvm-svn: 83095
* Add more const-goodness to ASTLocation.Argyrios Kyrtzidis2009-09-291-1/+1
| | | | llvm-svn: 83087
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-9/+9
| | | | llvm-svn: 81346
* Add getDecl() to CallGraph and CallGraphNode.Zhongxing Xu2009-07-241-0/+7
| | | | llvm-svn: 76940
* Add two nodes to the call graph:Zhongxing Xu2009-07-231-0/+12
| | | | | | | - Root is the main function or 0. - ExternalCallingNode has edges to all external functions. llvm-svn: 76876
* Add template specializations to view the call graph in dot format.Zhongxing Xu2009-07-231-0/+21
| | | | | | | - change the DenseMap used in callgraph to std::map, since DenseMap cannot be used with mapped_iterator and friends. llvm-svn: 76874
* Remove the ASTContext parameter from Entity::getPrintableName().Argyrios Kyrtzidis2009-07-211-3/+2
| | | | llvm-svn: 76546
* Change the semantics for Entity.Argyrios Kyrtzidis2009-07-211-6/+6
| | | | | | | | | | Entity can now refer to declarations that are not visible outside the translation unit. It is a wrapper of a pointer union, it's either a Decl* for declarations that don't "cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl. Included is a test case for handling fields across translation units. llvm-svn: 76515
* Replace stmt visitors with the fall back method.Zhongxing Xu2009-07-181-21/+1
| | | | llvm-svn: 76294
* Rename Entity::getName() to Entity::getPrintableName() to make its purposeZhongxing Xu2009-07-171-2/+3
| | | | | | more obvious. llvm-svn: 76167
* As suggested by Argyrios, revert r76159 and make "FindImmediateParent" Zhongxing Xu2009-07-171-1/+4
| | | | | | a public static method of ASTLocation. llvm-svn: 76166
* Refactor code into a new CallExpr::getDirectCallee() method. Simplify someZhongxing Xu2009-07-171-15/+4
| | | | | | code with the new method. llvm-svn: 76164
* CallGraph: add a bunch of stmt visitors.Zhongxing Xu2009-07-171-6/+20
| | | | llvm-svn: 76161
* CallGraph:Zhongxing Xu2009-07-171-6/+12
| | | | | | | | - add IfStmt visitor. - print information only when a function has callee. Otherwise its ASTContext map is NULL. llvm-svn: 76156
* Commit the initial implementation of call graph building.Zhongxing Xu2009-07-161-0/+121
llvm-svn: 75873
OpenPOWER on IntegriCloud