diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-18 03:48:14 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-18 03:48:14 +0000 |
commit | fe9e543a2a363df7fcaa899367d3b2580b63b27c (patch) | |
tree | d6a9cc6935655adbccddcac142da70264be5706e /include | |
parent | 3e030b4c04546229c81449fde66f71b23b3fc550 (diff) |
Hooked up the necessary machinery to allow the retain/release checker reference
back to the summary used when evaluating the statement associated with a
simulation node. This is now being used to help improve the checker's
diagnostics. To get things started, the checker now emits a path diagnostic
indicating that 'autorelease' is a no-op in GC mode.
Some of these changes are exposing further grossness in the interface between
BugReporter and the ExplodedGraph::Trim facilities. These really need to be
cleaned up one day.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Analysis/PathSensitive/BugReporter.h | 10 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/ExplodedGraph.h | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h index 2fda5c5a9a..0350f91a2d 100644 --- a/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/include/clang/Analysis/PathSensitive/BugReporter.h @@ -61,6 +61,13 @@ protected: } public: + class NodeResolver { + public: + virtual ~NodeResolver() {} + virtual const ExplodedNode<GRState>* + getOriginalNode(const ExplodedNode<GRState>* N) = 0; + }; + BugReport(BugType& bt, const char* desc, const ExplodedNode<GRState> *n) : BT(bt), Description(desc), EndNode(n) {} @@ -101,7 +108,8 @@ public: virtual PathDiagnosticPiece* VisitNode(const ExplodedNode<GRState>* N, const ExplodedNode<GRState>* PrevN, const ExplodedGraph<GRState>& G, - BugReporter& BR); + BugReporter& BR, + NodeResolver& NR); }; //===----------------------------------------------------------------------===// diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Analysis/PathSensitive/ExplodedGraph.h index 757efdc64c..f00e48887e 100644 --- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h +++ b/include/clang/Analysis/PathSensitive/ExplodedGraph.h @@ -300,7 +300,9 @@ public: ExplodedGraphImpl* Trim(const ExplodedNodeImpl* const * NBeg, const ExplodedNodeImpl* const * NEnd, - InterExplodedGraphMapImpl *M) const; + InterExplodedGraphMapImpl *M, + llvm::DenseMap<const void*, const void*> *InverseMap) + const; }; class InterExplodedGraphMapImpl { @@ -447,7 +449,8 @@ public: } std::pair<ExplodedGraph*, InterExplodedGraphMap<STATE>*> - Trim(const NodeTy* const* NBeg, const NodeTy* const* NEnd) const { + Trim(const NodeTy* const* NBeg, const NodeTy* const* NEnd, + llvm::DenseMap<const void*, const void*> *InverseMap = 0) const { if (NBeg == NEnd) return std::make_pair((ExplodedGraph*) 0, @@ -463,7 +466,8 @@ public: llvm::OwningPtr<InterExplodedGraphMap<STATE> > M(new InterExplodedGraphMap<STATE>()); - ExplodedGraphImpl* G = ExplodedGraphImpl::Trim(NBegImpl, NEndImpl, M.get()); + ExplodedGraphImpl* G = ExplodedGraphImpl::Trim(NBegImpl, NEndImpl, M.get(), + InverseMap); return std::make_pair(static_cast<ExplodedGraph*>(G), M.take()); } |