diff options
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, |