-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get variable and constant from upper bounds (#1135)
* Add NormalizeUtils.h and NormalizeUtils.cpp * Add NormalizeUtil::AddExprs helper method * Add NormalizeUtil::TransformAdditiveOp method * Fix typos * Add ExprCreatorUtil::CreateUnaryOperator method * Add NormalizeUtil::GetAdditionOperands helper method * Rename variable in NormalizeUtil::TransformSingleAdditiveOp * Add ExprUtil::EnsureEqualBitWidths method * Add NormalizeUtil::GetRHSConstant helper method * Add NormalizeUtil::TransformAssocLeft method * Add NormalizeUtil::ConstantFold method * Remove ConstantFoldUpperOffsets, GetRHSConstant, and EnsureEqualBitWidths methods from BaseRange and call utility methods instead * Fix typos * Avoid creating an unnecessary binary operator in TransformAdditiveOp * Return argument expression from TransformAssocLeft if the argument is already in the output form * Add NormalizeUpperBound method to CheckBoundsDeclarations * Add CompareNormalizeBounds method to CheckBoundsDeclarations * Remove expected warning from bounds widening test in bounds-context.c * Add tests for comparing normalized bounds to bounds-decl-checking.c * Move declaration of PointerAndConst * Add comment explaining why we don't check for B - P * Add NormalizeUtil::QueryPointerAdditiveConstant helper method * Add NormalizeUtil::AddConstants helper method * Add NormalizeUtil::GetVariableAndConstant method * Call NormalizeUtil::GetVariableAndConstant from CheckBoundsDeclarations::CompareNormalizedBounds * Remove CheckBoundsDeclarations::NormalizeUpperBound method * Add and update bounds checking tests * Don't call TransformAdditiveOp from GetVariableAndConstant * Remove unused NormalizeUtil::GetAdditionOperands method * Fix formatting
- Loading branch information
Showing
4 changed files
with
166 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters