Skip to content

Simple normalizations for +1/-1 bounds scenarios #1128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f60113f
Add NormalizeUtils.h and NormalizeUtils.cpp
Jul 7, 2021
4e0ab90
Add NormalizeUtil::AddExprs helper method
Jul 7, 2021
de4c40e
Add NormalizeUtil::TransformAdditiveOp method
Jul 7, 2021
db8a01e
Fix typos
Jul 7, 2021
f0c0b14
Add ExprCreatorUtil::CreateUnaryOperator method
Jul 7, 2021
f8faae2
Add NormalizeUtil::GetAdditionOperands helper method
Jul 7, 2021
24d6c66
Rename variable in NormalizeUtil::TransformSingleAdditiveOp
Jul 7, 2021
2b4b9c9
Add ExprUtil::EnsureEqualBitWidths method
Jul 8, 2021
f6443fd
Add NormalizeUtil::GetRHSConstant helper method
Jul 8, 2021
e1a9630
Add NormalizeUtil::TransformAssocLeft method
Jul 8, 2021
7ee773e
Add NormalizeUtil::ConstantFold method
Jul 8, 2021
d6b25a6
Remove ConstantFoldUpperOffsets, GetRHSConstant, and EnsureEqualBitWi…
Jul 8, 2021
b99804d
Fix typos
Jul 12, 2021
fc09e82
Avoid creating an unnecessary binary operator in TransformAdditiveOp
Jul 12, 2021
5ca588b
Return argument expression from TransformAssocLeft if the argument is…
Jul 12, 2021
0ddfa57
Add NormalizeUpperBound method to CheckBoundsDeclarations
Jul 12, 2021
0078abd
Add CompareNormalizeBounds method to CheckBoundsDeclarations
Jul 12, 2021
b50dc1f
Remove expected warning from bounds widening test in bounds-context.c
Jul 12, 2021
ced9e4f
Add tests for comparing normalized bounds to bounds-decl-checking.c
Jul 12, 2021
cdd7b58
Merge branch 'master' of https://github.com/microsoft/checkedc-clang …
Jul 12, 2021
a375cae
Move declaration of PointerAndConst
Jul 13, 2021
ff5130b
Add comment explaining why we don't check for B - P
Jul 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add NormalizeUtil::AddExprs helper method
  • Loading branch information
kakje committed Jul 7, 2021
commit 4e0ab90f56ab51a19ef20d6033b7d20af313615c
3 changes: 3 additions & 0 deletions clang/include/clang/AST/NormalizeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace clang {

class NormalizeUtil {

private:
// AddExprs returns LHS + RHS.
static Expr *AddExprs(Sema &S, Expr *LHS, Expr *RHS);
};

} // end namespace clang
Expand Down
5 changes: 5 additions & 0 deletions clang/lib/AST/NormalizeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@
#include "clang/AST/NormalizeUtils.h"

using namespace clang;

Expr *NormalizeUtil::AddExprs(Sema &S, Expr *LHS, Expr *RHS) {
return ExprCreatorUtil::CreateBinaryOperator(S, LHS, RHS,
BinaryOperatorKind::BO_Add);
}