diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-05-01 22:50:36 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-05-01 22:50:36 +0000 |
commit | bb77e9b908658b354b058509d3801f3aed052bec (patch) | |
tree | 0ce757f7d46d2b141ae695f9bfc14726d867cb57 /lib/Analysis/CFRefCount.cpp | |
parent | 0cca749f64ff54476df3a4fc084821b8a8d712d5 (diff) |
Do not highlight bogus ranges for leaks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 98287921d3..ea036f047b 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -1444,7 +1444,9 @@ namespace { public: CFRefBug(CFRefCount& tf) : TF(tf) {} - CFRefCount& getTF() { return TF; } + CFRefCount& getTF() { return TF; } + + virtual bool ReportRanges() const { return true; } }; class VISIBILITY_HIDDEN UseAfterRelease : public CFRefBug { @@ -1491,7 +1493,8 @@ namespace { } virtual void EmitWarnings(BugReporter& BR); - virtual void GetErrorNodes(std::vector<ExplodedNode<ValueState>*>& Nodes); + virtual void GetErrorNodes(std::vector<ExplodedNode<ValueState>*>& Nodes); + virtual bool ReportRanges() const { return false; } }; //===---------===// @@ -1506,6 +1509,24 @@ namespace { virtual ~CFRefReport() {} + CFRefBug& getBugType() { + return (CFRefBug&) RangedBugReport::getBugType(); + } + const CFRefBug& getBugType() const { + return (const CFRefBug&) RangedBugReport::getBugType(); + } + + virtual void getRanges(BugReporter& BR, const SourceRange*& beg, + const SourceRange*& end) { + + if (getBugType().ReportRanges()) + RangedBugReport::getRanges(BR, beg, end); + else { + beg = 0; + end = 0; + } + } + virtual std::pair<const char**,const char**> getExtraDescriptiveText(); virtual PathDiagnosticPiece* VisitNode(ExplodedNode<ValueState>* N, |