diff options
| author | Donát Nagy <donat.nagy@ericsson.com> | 2023-08-25 13:23:45 +0200 |
|---|---|---|
| committer | Donát Nagy <donat.nagy@ericsson.com> | 2023-08-28 15:20:14 +0200 |
| commit | 8a5cfdf7851dcdb4e16c510b133d7d0e79e43fc4 (patch) | |
| tree | c74dfa29238b432f24059174a21b01f989f895ae /clang/unittests/StaticAnalyzer/CallEventTest.cpp | |
| parent | 89c564704e8034729088eb4be3b90ffe958bd079 (diff) | |
[analyzer][NFC] Remove useless class BuiltinBug
...because it provides no useful functionality compared to its base
class `BugType`.
A long time ago there were substantial differences between `BugType` and
`BuiltinBug`, but they were eliminated by commit 1bd58233 in 2009 (!).
Since then the only functionality provided by `BuiltinBug` was that it
specified `categories::LogicError` as the bug category and it stored an
extra data member `desc`.
This commit sets `categories::LogicError` as the default value of the
third argument (bug category) in the constructors of BugType and
replaces use of the `desc` field with simpler logic.
Note that `BugType` has a data member `Description` and a non-virtual
method `BugType::getDescription()` which queries it; these are distinct
from the member `desc` of `BuiltinBug` and the identically named method
`BuiltinBug::getDescription()` which queries it. This confusing name
collision was a major motivation for the elimination of `BuiltinBug`.
As this commit touches many files, I avoided functional changes and left
behind FIXME notes to mark minor issues that should be fixed later.
Differential Revision: https://reviews.llvm.org/D158855
Diffstat (limited to 'clang/unittests/StaticAnalyzer/CallEventTest.cpp')
| -rw-r--r-- | clang/unittests/StaticAnalyzer/CallEventTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/StaticAnalyzer/CallEventTest.cpp b/clang/unittests/StaticAnalyzer/CallEventTest.cpp index b1ae591eaf7e..5be25d2ada67 100644 --- a/clang/unittests/StaticAnalyzer/CallEventTest.cpp +++ b/clang/unittests/StaticAnalyzer/CallEventTest.cpp @@ -36,11 +36,11 @@ void reportBug(const CheckerBase *Checker, const CallEvent &Call, } class CXXDeallocatorChecker : public Checker<check::PreCall> { - std::unique_ptr<BuiltinBug> BT_uninitField; + std::unique_ptr<BugType> BT_uninitField; public: CXXDeallocatorChecker() - : BT_uninitField(new BuiltinBug(this, "CXXDeallocator")) {} + : BT_uninitField(new BugType(this, "CXXDeallocator")) {} void checkPreCall(const CallEvent &Call, CheckerContext &C) const { const auto *DC = dyn_cast<CXXDeallocatorCall>(&Call); |
