diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2024-01-03 16:57:07 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-01-03 16:57:07 +0000 |
| commit | 77dbea07356e1ab2f37a777d4d1ddc5dd3e301c2 (patch) | |
| tree | bdb0bc8db7a91e1f8b4bb8729fc391e2adf45380 /clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp | |
| parent | 99aabd70801bd4bc72c4942747f6d62c675112f5 (diff) | |
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp b/clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp index d05298b42c55..ff479c7b0ac8 100644 --- a/clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp @@ -28,7 +28,8 @@ namespace { class DebugIteratorModeling : public Checker<eval::Call> { - std::unique_ptr<BugType> DebugMsgBugType; + const BugType DebugMsgBugType{this, "Checking analyzer assumptions", "debug", + /*SuppressOnSink=*/true}; template <typename Getter> void analyzerIteratorDataField(const CallExpr *CE, CheckerContext &C, @@ -51,19 +52,11 @@ class DebugIteratorModeling }; public: - DebugIteratorModeling(); - bool evalCall(const CallEvent &Call, CheckerContext &C) const; }; } //namespace -DebugIteratorModeling::DebugIteratorModeling() { - DebugMsgBugType.reset( - new BugType(this, "Checking analyzer assumptions", "debug", - /*SuppressOnSink=*/true)); -} - bool DebugIteratorModeling::evalCall(const CallEvent &Call, CheckerContext &C) const { const auto *CE = dyn_cast_or_null<CallExpr>(Call.getOriginExpr()); @@ -131,8 +124,8 @@ ExplodedNode *DebugIteratorModeling::reportDebugMsg(llvm::StringRef Msg, return nullptr; auto &BR = C.getBugReporter(); - BR.emitReport(std::make_unique<PathSensitiveBugReport>(*DebugMsgBugType, - Msg, N)); + BR.emitReport( + std::make_unique<PathSensitiveBugReport>(DebugMsgBugType, Msg, N)); return N; } |
