Commit Graph

18 Commits

Author SHA1 Message Date
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