Skip to content

Equivalent expressions: assignments [3/n] #802

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 62 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
bb1a569
Add VariableUtil class
Feb 27, 2020
fbbc6f5
Add ExprCreatorUtil
Feb 27, 2020
5a4152d
Add PruneVariableReferences
Feb 27, 2020
755758b
Add VariableOccurrenceCount
Feb 27, 2020
364bcab
Add IncludeAllMemberExprs parameter to ReadsMemoryViaPointer
Feb 27, 2020
17487fd
Add helper methods to search equality sets
Feb 27, 2020
3535348
Add IntersectUEQ and IntersectG methods
Feb 27, 2020
98d960b
Add SplitByVarCount helper method
Feb 27, 2020
a9c3922
Fix SplitByVarCount comment
Feb 27, 2020
09c7e9c
Add Inverse methods
Feb 27, 2020
a1d51b8
Add IsInvertible methods
Feb 27, 2020
f0c7bf8
Add GetOriginalValue method
Feb 27, 2020
7433053
Add UpdateAfterAssignment method
Feb 27, 2020
95523a2
Update state after initializers in CheckVarDecl
Feb 27, 2020
c97e303
Update checking state for assignments in CheckBinaryOperator
Feb 27, 2020
e09d109
Update checking state for inc/dec operators in CheckUnaryOperator
Feb 27, 2020
9f17e5e
Set the incoming checking state for a CFG block by using the intersec…
Feb 27, 2020
f92b11f
Only dump checking state after checking top-level statements
Feb 27, 2020
199534f
Add initial equiv-expr-sets test with VarDecl initializer test
Feb 27, 2020
1b71577
Add BinaryOperator assignment tests
Feb 27, 2020
ee40a16
Add UnaryOperator inc/dec operator tests
Feb 27, 2020
4a4b26e
Add tests for multiple assignments
Feb 27, 2020
550ddd6
Add tests for original values
Feb 27, 2020
fc23804
Add tests for control flow
Feb 27, 2020
792db05
Remove unexpected expression kind unreachable from CanonBounds::Compa…
Feb 27, 2020
237b117
Fix ExprCreatorUtil::CreateBinaryOperator to handle compond assignments
Feb 27, 2020
fc23bfd
Modify PruneVariableReferences to only transform expressions that use…
Feb 27, 2020
2014368
Don't add unary operators to possible derefs if diagnostics are disabled
Mar 2, 2020
b4d3e35
Change TreeTransform BlockExpr assert to compare CaptureMap counts
Mar 2, 2020
d0e9a6b
Avoid adding duplicate expressions to UEQ and G
Mar 2, 2020
b93712c
[TEMP] debugging for Sema/compound-literal.c test
Mar 3, 2020
5bf7fc5
[TEMP] debugging asserts
Mar 3, 2020
8353246
Don't transform expressions that don't use the variable in PruneVaria…
Mar 3, 2020
e8aa830
Add cases for missing expressions and reintroduce unreachable in Cano…
Mar 12, 2020
3f38354
Rename PruneVariable to ReplaceVariable
Mar 12, 2020
c6f87b8
Fix CreateBinaryOperator comment and add asserts
Mar 12, 2020
62cc6eb
Clean up IsInvertible and Inverse methods
Mar 12, 2020
38bef6a
Fix GetOriginalValue comment
Mar 12, 2020
43f8b90
Clean up set intersection methods
Mar 12, 2020
e585d00
Explicitly handle getting lvalue and rvalue variables
Mar 13, 2020
995fc71
Add non-modifying expression check to the target of a non-compound as…
Mar 13, 2020
7358af7
Handle integer constant creation for unary inc/dec operators
Mar 13, 2020
e967646
Check that the bit with and int size are equal in CreateIntegerLiteral
Mar 16, 2020
1ea75e4
Avoid adding non-comparable expressions to UEQ and G
Mar 17, 2020
7ee9ef5
Prevent StringLiterals from being added to UEQ and G
Mar 23, 2020
2bd6d6e
Allow conditional operators in equivalent expression sets
Mar 26, 2020
135410d
Update CanBeInEqualExprSet comment
Mar 26, 2020
a8d2bd1
Update CheckBinaryOperator and CheckUnaryOperator comments
Apr 2, 2020
94f7676
Set G to empty for non-integer inc/dec operators
Apr 2, 2020
c1cbae2
Fix indentation
Apr 2, 2020
7b94476
Update CheckVarDecl comments
Apr 2, 2020
b247b71
Rename CanBeInEqualExprSet to CreatesNewObject
Apr 2, 2020
58db814
Update GetEqualExprSetContainingVariable comment
Apr 2, 2020
d13f8dc
Update comments and variable names for UpdateG
Apr 2, 2020
c1b5d6b
Remove unnecessary SubExprGs updates in CheckBinaryOperator
Apr 3, 2020
16db44b
Clear G for assignments to non-variables
Apr 3, 2020
a47e887
Add nonmodifying checks to CheckCastExpr before modifying G
Apr 3, 2020
62d8b2e
Prevent UEQ from containing contradictions and tautologies for inc/de…
Apr 3, 2020
ac9e617
Remove debug code
Apr 3, 2020
5844f66
Add null check to IsInvertible
Apr 3, 2020
b334667
Merge branch 'master' of https://github.com/Microsoft/checkedc-clang …
Apr 4, 2020
89909a8
Fix logic to update G for inc/dec operators
Apr 4, 2020
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
5 changes: 3 additions & 2 deletions clang/lib/AST/CanonBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ Result Lexicographic::CompareExpr(const Expr *Arg1, const Expr *Arg2) {
case Expr::CompoundAssignOperatorClass:
Cmp = Compare<CompoundAssignOperator>(E1, E2); break;
case Expr::BinaryConditionalOperatorClass: break;
case Expr::ConditionalOperatorClass: break;
case Expr::ImplicitCastExprClass: Cmp = Compare<CastExpr>(E1, E2); break;
case Expr::CStyleCastExprClass: Cmp = Compare<CastExpr>(E1, E2); break;
case Expr::CompoundLiteralExprClass: Cmp = Compare<CompoundLiteralExpr>(E1, E2); break;
Expand All @@ -323,7 +324,7 @@ Result Lexicographic::CompareExpr(const Expr *Arg1, const Expr *Arg2) {
case Expr::PositionalParameterExprClass: Cmp = Compare<PositionalParameterExpr>(E1, E2); break;
case Expr::BoundsCastExprClass: Cmp = Compare<BoundsCastExpr>(E1, E2); break;
case Expr::BoundsValueExprClass: Cmp = Compare<BoundsValueExpr>(E1, E2); break;
// Binding of a tempoary to the result of an expression. These are
// Binding of a temporary to the result of an expression. These are
// equal if their child expressions are equal.
case Expr::CHKCBindTemporaryExprClass: break;

Expand All @@ -338,7 +339,7 @@ Result Lexicographic::CompareExpr(const Expr *Arg1, const Expr *Arg2) {
// case Expr::MSPropertySubscriptExprClass:

default:
llvm_unreachable("unexpected expression kind");
llvm_unreachable("unexpected expression kind");
}

if (Cmp != Result::Equal)
Expand Down
Loading