Skip to content

Commit 7ebf3e0

Browse files
[StaticAnalyzer] Remove isShiftOverflow and isLeftShiftResultUnrepresentable
This patch fixes: clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:61:13: error: unused function 'isShiftOverflow' [-Werror,-Wunused-function] clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:66:13: error: unused function 'isLeftShiftResultUnrepresentable' [-Werror,-Wunused-function]
1 parent c19183c commit 7ebf3e0

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,6 @@ static bool isArrayIndexOutOfBounds(CheckerContext &C, const Expr *Ex) {
5858
return StOutBound && !StInBound;
5959
}
6060

61-
static bool isShiftOverflow(const BinaryOperator *B, CheckerContext &C) {
62-
return C.isGreaterOrEqual(
63-
B->getRHS(), C.getASTContext().getIntWidth(B->getLHS()->getType()));
64-
}
65-
66-
static bool isLeftShiftResultUnrepresentable(const BinaryOperator *B,
67-
CheckerContext &C) {
68-
SValBuilder &SB = C.getSValBuilder();
69-
ProgramStateRef State = C.getState();
70-
const llvm::APSInt *LHS = SB.getKnownValue(State, C.getSVal(B->getLHS()));
71-
const llvm::APSInt *RHS = SB.getKnownValue(State, C.getSVal(B->getRHS()));
72-
assert(LHS && RHS && "Values unknown, inconsistent state");
73-
return (unsigned)RHS->getZExtValue() > LHS->countl_zero();
74-
}
75-
7661
void UndefResultChecker::checkPostStmt(const BinaryOperator *B,
7762
CheckerContext &C) const {
7863
if (C.getSVal(B).isUndef()) {

0 commit comments

Comments
 (0)