Skip to content

Commit 729416e

Browse files
authored
[analyzer][NFC] Remove "V2" from ArrayBoundCheckerV2.cpp (#126094)
Previously commit 6e17ed9 deleted the obsolete checker `alpha.security.ArrayBound` which was implemented in `ArrayBoundChecker.cpp` and renamed the checker `alpha.security.ArrayBoundV2` to `security.ArrayBound`. This commit concludes that consolidation by renaming the source file `ArrayBoundCheckerV2.cpp` to `ArrayBoundChecker.cpp` (which was "freed up" by the previous commit).
1 parent f796bc6 commit 729416e

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp renamed to clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//== ArrayBoundCheckerV2.cpp ------------------------------------*- C++ -*--==//
1+
//== ArrayBoundChecker.cpp -------------------------------------------------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -11,12 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
// NOTE: The name of this file ends with "V2" because previously
15-
// "ArrayBoundChecker.cpp" contained the implementation of another (older and
16-
// simpler) checker that was called `alpha.security.ArrayBound`.
17-
// TODO: Rename this file to "ArrayBoundChecker.cpp" when it won't be confused
18-
// with that older file.
19-
2014
#include "clang/AST/CharUnits.h"
2115
#include "clang/AST/ParentMapContext.h"
2216
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
@@ -297,7 +291,8 @@ static std::pair<ProgramStateRef, ProgramStateRef>
297291
compareValueToThreshold(ProgramStateRef State, NonLoc Value, NonLoc Threshold,
298292
SValBuilder &SVB, bool CheckEquality = false) {
299293
if (auto ConcreteThreshold = Threshold.getAs<nonloc::ConcreteInt>()) {
300-
std::tie(Value, Threshold) = getSimplifiedOffsets(Value, *ConcreteThreshold, SVB);
294+
std::tie(Value, Threshold) =
295+
getSimplifiedOffsets(Value, *ConcreteThreshold, SVB);
301296
}
302297

303298
// We want to perform a _mathematical_ comparison between the numbers `Value`

clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(LLVM_LINK_COMPONENTS
77
add_clang_library(clangStaticAnalyzerCheckers
88
AnalysisOrderChecker.cpp
99
AnalyzerStatsChecker.cpp
10-
ArrayBoundCheckerV2.cpp
10+
ArrayBoundChecker.cpp
1111
BasicObjCFoundationChecks.cpp
1212
BitwiseShiftChecker.cpp
1313
BlockInCriticalSectionChecker.cpp

llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Checkers/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static_library("Checkers") {
1616
sources = [
1717
"AnalysisOrderChecker.cpp",
1818
"AnalyzerStatsChecker.cpp",
19-
"ArrayBoundCheckerV2.cpp",
19+
"ArrayBoundChecker.cpp",
2020
"BasicObjCFoundationChecks.cpp",
2121
"BitwiseShiftChecker.cpp",
2222
"BlockInCriticalSectionChecker.cpp",

0 commit comments

Comments
 (0)