Author: Kazu Hirata Date: 2023-09-29T12:47:31-07:00 New Revision: 7ebf3e019488bcc6209df757e823b08f631aa897
URL: https://github.com/llvm/llvm-project/commit/7ebf3e019488bcc6209df757e823b08f631aa897 DIFF: https://github.com/llvm/llvm-project/commit/7ebf3e019488bcc6209df757e823b08f631aa897.diff LOG: [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] Added: Modified: clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp Removed: ################################################################################ diff --git a/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp index 5f37b915deb8a02..d593a6bd74cfea3 100644 --- a/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp @@ -58,21 +58,6 @@ static bool isArrayIndexOutOfBounds(CheckerContext &C, const Expr *Ex) { return StOutBound && !StInBound; } -static bool isShiftOverflow(const BinaryOperator *B, CheckerContext &C) { - return C.isGreaterOrEqual( - B->getRHS(), C.getASTContext().getIntWidth(B->getLHS()->getType())); -} - -static bool isLeftShiftResultUnrepresentable(const BinaryOperator *B, - CheckerContext &C) { - SValBuilder &SB = C.getSValBuilder(); - ProgramStateRef State = C.getState(); - const llvm::APSInt *LHS = SB.getKnownValue(State, C.getSVal(B->getLHS())); - const llvm::APSInt *RHS = SB.getKnownValue(State, C.getSVal(B->getRHS())); - assert(LHS && RHS && "Values unknown, inconsistent state"); - return (unsigned)RHS->getZExtValue() > LHS->countl_zero(); -} - void UndefResultChecker::checkPostStmt(const BinaryOperator *B, CheckerContext &C) const { if (C.getSVal(B).isUndef()) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits