[clang] 0953d8c - [NFC][analyzer] Capitalize variable names in BoundsChecking.cpp (#214530)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 7 03:12:59 PDT 2026
Author: DonĂ¡t Nagy
Date: 2026-08-07T12:12:54+02:00
New Revision: 0953d8cf3a98b8e6b5d61ae0f38abf36e794df45
URL: https://github.com/llvm/llvm-project/commit/0953d8cf3a98b8e6b5d61ae0f38abf36e794df45
DIFF: https://github.com/llvm/llvm-project/commit/0953d8cf3a98b8e6b5d61ae0f38abf36e794df45.diff
LOG: [NFC][analyzer] Capitalize variable names in BoundsChecking.cpp (#214530)
My recent commit 91dfa266cee8cb49a052531492ba4b670525278a moved this
code here from a different file. Now that it has no menaningful git
history (and it is blamed to me) let's get rid of the lowercase names.
Added:
Modified:
clang/lib/StaticAnalyzer/Checkers/BoundsChecking.cpp
Removed:
################################################################################
diff --git a/clang/lib/StaticAnalyzer/Checkers/BoundsChecking.cpp b/clang/lib/StaticAnalyzer/Checkers/BoundsChecking.cpp
index 52086254fff3a..b204155c87b86 100644
--- a/clang/lib/StaticAnalyzer/Checkers/BoundsChecking.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/BoundsChecking.cpp
@@ -36,34 +36,32 @@ using namespace ento;
// but can produce a true result when evaluated by `evalBinOp` (which follows
// the rules of C++ and casts -1 to SIZE_MAX).
static std::pair<NonLoc, nonloc::ConcreteInt>
-getSimplifiedOffsets(NonLoc offset, nonloc::ConcreteInt extent,
- SValBuilder &svalBuilder) {
- const llvm::APSInt &extentVal = extent.getValue();
- std::optional<nonloc::SymbolVal> SymVal = offset.getAs<nonloc::SymbolVal>();
+getSimplifiedOffsets(NonLoc Offset, nonloc::ConcreteInt Extent,
+ SValBuilder &SVB) {
+ const llvm::APSInt &ExtentVal = Extent.getValue();
+ std::optional<nonloc::SymbolVal> SymVal = Offset.getAs<nonloc::SymbolVal>();
if (SymVal && SymVal->isExpression()) {
if (const SymIntExpr *SIE = dyn_cast<SymIntExpr>(SymVal->getSymbol())) {
- llvm::APSInt constant = APSIntType(extentVal).convert(SIE->getRHS());
+ llvm::APSInt Num = APSIntType(ExtentVal).convert(SIE->getRHS());
switch (SIE->getOpcode()) {
case BO_Mul:
- // The constant should never be 0 here, becasue multiplication by zero
+ // The Num should never be 0 here, because multiplication by zero
// is simplified by the engine.
- if ((extentVal % constant) != 0)
- return std::pair<NonLoc, nonloc::ConcreteInt>(offset, extent);
+ if ((ExtentVal % Num) != 0)
+ return std::pair<NonLoc, nonloc::ConcreteInt>(Offset, Extent);
else
- return getSimplifiedOffsets(
- nonloc::SymbolVal(SIE->getLHS()),
- svalBuilder.makeIntVal(extentVal / constant), svalBuilder);
+ return getSimplifiedOffsets(nonloc::SymbolVal(SIE->getLHS()),
+ SVB.makeIntVal(ExtentVal / Num), SVB);
case BO_Add:
- return getSimplifiedOffsets(
- nonloc::SymbolVal(SIE->getLHS()),
- svalBuilder.makeIntVal(extentVal - constant), svalBuilder);
+ return getSimplifiedOffsets(nonloc::SymbolVal(SIE->getLHS()),
+ SVB.makeIntVal(ExtentVal - Num), SVB);
default:
break;
}
}
}
- return std::pair<NonLoc, nonloc::ConcreteInt>(offset, extent);
+ return std::pair<NonLoc, nonloc::ConcreteInt>(Offset, Extent);
}
static bool isNegative(SValBuilder &SVB, ProgramStateRef State, NonLoc Value) {
More information about the cfe-commits
mailing list