Граф коммитов

25 Коммитов

Автор SHA1 Сообщение Дата
Matt Beaumont-Gay d53e877ddf Fix dereference of end iterator. Spotted by ASan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152738 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-14 20:21:25 +00:00
Anna Zaks a2e589e60d [analyzer] Refactor CallGraph to use Recursive AST visitor when
collecting function Decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152651 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 19:32:08 +00:00
Anna Zaks a5d531f67d CallGraph: Add getNode() method, constify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152439 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-09 21:13:53 +00:00
Anna Zaks d277661370 Call Graph: Only the root node is allowed to have an invalid Decl*.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152350 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08 23:16:26 +00:00
Daniel Dunbar a50a5cd9db Remove stray semi-colon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08 20:28:59 +00:00
Anna Zaks 196b8cfe9c Add a basic CallGraph to Analysis.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152272 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08 00:42:23 +00:00
Daniel Dunbar 8fd57fea85 Fix layering violation by moving Analysis/CallGraph to Index
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:20:04 +00:00
Tobias Grosser 006b0eb3e1 Adapt to the DOTGraphTraits changes in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 14:16:05 +00:00
Benjamin Kramer d02e232c43 Change *BugReport constructors to take StringRefs.
- 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 12:08:24 +00:00
Zhongxing Xu f20288c916 make CallGraph more flexible by letting it accept ASTContext instead of ASTUnit.
Patch by Simone Pellegrini.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 12:23:03 +00:00
Argyrios Kyrtzidis f4526e3fd4 Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:
-A NamedDecl reference
-A TypeLoc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:44:27 +00:00
Argyrios Kyrtzidis 1ebd7405be Add more const-goodness to ASTLocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:39:53 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Zhongxing Xu e3e643f12c Add getDecl() to CallGraph and CallGraphNode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 03:41:11 +00:00
Zhongxing Xu 56a5d80877 Add two nodes to the call graph:
- Root is the main function or 0.
 - ExternalCallingNode has edges to all external functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76876 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 13:39:38 +00:00
Zhongxing Xu 16a705f26d Add template specializations to view the call graph in dot format.
- change the DenseMap used in callgraph to std::map, since DenseMap cannot
   be used with mapped_iterator and friends.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 09:04:23 +00:00
Argyrios Kyrtzidis 4c7c5a1d01 Remove the ASTContext parameter from Entity::getPrintableName().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 07:52:21 +00:00
Argyrios Kyrtzidis f7cf15ca3c Change the semantics for Entity.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:07:06 +00:00
Zhongxing Xu 93cbae3bc6 Replace stmt visitors with the fall back method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 08:49:07 +00:00
Zhongxing Xu 56aac3f6c2 Rename Entity::getName() to Entity::getPrintableName() to make its purpose
more obvious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 07:49:44 +00:00
Zhongxing Xu 7f66bd28b5 As suggested by Argyrios, revert r76159 and make "FindImmediateParent"
a public static method of ASTLocation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 07:36:20 +00:00
Zhongxing Xu a00425414e Refactor code into a new CallExpr::getDirectCallee() method. Simplify some
code with the new method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 07:29:51 +00:00
Zhongxing Xu 6fc4505298 CallGraph: add a bunch of stmt visitors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76161 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 07:05:19 +00:00
Zhongxing Xu 24ff030f40 CallGraph:
- add IfStmt visitor.
 - print information only when a function has callee. Otherwise its ASTContext
   map is NULL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 05:49:16 +00:00
Zhongxing Xu 6bd8fb50ac Commit the initial implementation of call graph building.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 00:54:12 +00:00