diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | |
parent | 30d791273d07fac9c0c1641a0731191bca6e8606 (diff) | |
download | src-06d4ba388873e6d1cfa9cd715a8935ecc8cd2097.tar.gz src-06d4ba388873e6d1cfa9cd715a8935ecc8cd2097.zip |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):vendor/clang/clang-release_360-r226102
Notes
Notes:
svn path=/vendor/clang/dist/; revision=277325
svn path=/vendor/clang/clang-release_360-r226102/; revision=277326; tag=vendor/clang/clang-release_360-r226102
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h index 53712319253c..b03371ccee9c 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_GR_BUGREPORTER -#define LLVM_CLANG_GR_BUGREPORTER +#ifndef LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_BUGREPORTER_H +#define LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_BUGREPORTER_H #include "clang/Basic/SourceLocation.h" #include "clang/StaticAnalyzer/Core/AnalyzerOptions.h" @@ -63,7 +63,7 @@ public: }; typedef const SourceRange *ranges_iterator; - typedef SmallVector<BugReporterVisitor *, 8> VisitorList; + typedef SmallVector<std::unique_ptr<BugReporterVisitor>, 8> VisitorList; typedef VisitorList::iterator visitor_iterator; typedef SmallVector<StringRef, 2> ExtraTextList; @@ -179,9 +179,9 @@ public: const ExplodedNode *getErrorNode() const { return ErrorNode; } - const StringRef getDescription() const { return Description; } + StringRef getDescription() const { return Description; } - const StringRef getShortDescription(bool UseFallback = true) const { + StringRef getShortDescription(bool UseFallback = true) const { if (ShortDescription.empty() && UseFallback) return Description; return ShortDescription; @@ -299,9 +299,9 @@ public: /// \sa registerConditionVisitor(), registerTrackNullOrUndefValue(), /// registerFindLastStore(), registerNilReceiverVisitor(), and /// registerVarDeclsLastStore(). - void addVisitor(BugReporterVisitor *visitor); + void addVisitor(std::unique_ptr<BugReporterVisitor> visitor); - /// Iterators through the custom diagnostic visitors. + /// Iterators through the custom diagnostic visitors. visitor_iterator visitor_begin() { return Callbacks.begin(); } visitor_iterator visitor_end() { return Callbacks.end(); } @@ -345,9 +345,12 @@ class BugReportEquivClass : public llvm::FoldingSetNode { llvm::ilist<BugReport> Reports; friend class BugReporter; - void AddReport(BugReport* R) { Reports.push_back(R); } + void AddReport(std::unique_ptr<BugReport> R) { + Reports.push_back(R.release()); + } + public: - BugReportEquivClass(BugReport* R) { Reports.push_back(R); } + BugReportEquivClass(std::unique_ptr<BugReport> R) { AddReport(std::move(R)); } ~BugReportEquivClass(); void Profile(llvm::FoldingSetNodeID& ID) const { |