diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
| commit | c192b3dcffd5e672a2b2e1730e2440febb4fb192 (patch) | |
| tree | ac719b5984165053bf83d71142e4d96b609b9784 /include/clang/StaticAnalyzer | |
| parent | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (diff) | |
Notes
Diffstat (limited to 'include/clang/StaticAnalyzer')
3 files changed, 6 insertions, 7 deletions
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h index 308ac8363bea..57c73fd6eca1 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h @@ -464,7 +464,7 @@ public: /// The reports are usually generated by the checkers. Further, they are /// folded based on the profile value, which is done to coalesce similar /// reports. - void emitReport(BugReport *R); + void emitReport(std::unique_ptr<BugReport> R); void EmitBasicReport(const Decl *DeclWithIssue, const CheckerBase *Checker, StringRef BugName, StringRef BugCategory, diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h index 68274f52a60c..a4ff133b4b93 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h @@ -232,9 +232,9 @@ public: } /// \brief Emit the diagnostics report. - void emitReport(BugReport *R) { + void emitReport(std::unique_ptr<BugReport> R) { Changed = true; - Eng.getBugReporter().emitReport(R); + Eng.getBugReporter().emitReport(std::move(R)); } /// \brief Get the declaration of the called function (path-sensitive). diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h index 6a42df20d1cb..e7ec1f497b2b 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h @@ -28,10 +28,9 @@ template <class T> bool containsStmt(const Stmt *S) { if (isa<T>(S)) return true; - for (Stmt::const_child_range I = S->children(); I; ++I) - if (const Stmt *child = *I) - if (containsStmt<T>(child)) - return true; + for (const Stmt *Child : S->children()) + if (Child && containsStmt<T>(Child)) + return true; return false; } |
