@@ -888,25 +888,11 @@ BoundsKey AVarBoundsInfo::getRandomBKey() {
888
888
return Ret;
889
889
}
890
890
891
- bool AVarBoundsInfo::addAssignment (clang::Decl *L, clang::Decl *R) {
892
- BoundsKey BL, BR;
893
- if (tryGetVariable (L, BL) && tryGetVariable (R, BR)) {
894
- return addAssignment (BL, BR);
895
- }
896
- return false ;
897
- }
898
-
899
- bool AVarBoundsInfo::addAssignment (clang::DeclRefExpr *L,
900
- clang::DeclRefExpr *R) {
901
- return addAssignment (L->getDecl (), R->getDecl ());
902
- }
903
-
904
- bool AVarBoundsInfo::handleAssignment (clang::Expr *L, const CVarSet &LCVars,
891
+ void AVarBoundsInfo::handleAssignment (clang::Expr *L, const CVarSet &LCVars,
905
892
const std::set<BoundsKey> &CSLKeys,
906
893
clang::Expr *R, const CVarSet &RCVars,
907
894
const std::set<BoundsKey> &CSRKeys,
908
895
ASTContext *C, ConstraintResolver *CR) {
909
- bool Ret = false ;
910
896
BoundsKey TmpK;
911
897
std::set<BoundsKey> AllLKeys = CSLKeys;
912
898
std::set<BoundsKey> AllRKeys = CSRKeys;
@@ -921,32 +907,29 @@ bool AVarBoundsInfo::handleAssignment(clang::Expr *L, const CVarSet &LCVars,
921
907
922
908
for (auto LK : AllLKeys) {
923
909
for (auto RK : AllRKeys) {
924
- Ret = addAssignment (LK, RK) || Ret ;
910
+ addAssignment (LK, RK);
925
911
}
926
912
}
927
- return Ret;
928
913
}
929
914
930
- bool AVarBoundsInfo::handleAssignment (clang::Decl *L, CVarOption LCVars,
915
+ void AVarBoundsInfo::handleAssignment (clang::Decl *L, CVarOption LCVars,
931
916
clang::Expr *R, const CVarSet &RCVars,
932
917
const std::set<BoundsKey> &CSRKeys,
933
918
ASTContext *C, ConstraintResolver *CR) {
934
919
BoundsKey LKey, RKey;
935
- bool Ret = false ;
936
920
if (CR->resolveBoundsKey (LCVars, LKey) || tryGetVariable (L, LKey)) {
937
921
std::set<BoundsKey> AllRKeys = CSRKeys;
938
922
if (AllRKeys.empty () &&
939
923
(CR->resolveBoundsKey (RCVars, RKey) || tryGetVariable (R, *C, RKey))) {
940
924
AllRKeys.insert (RKey);
941
925
}
942
926
for (auto RK : AllRKeys) {
943
- Ret = addAssignment (LKey, RK) || Ret ;
927
+ addAssignment (LKey, RK);
944
928
}
945
929
}
946
- return Ret;
947
930
}
948
931
949
- bool AVarBoundsInfo::addAssignment (BoundsKey L, BoundsKey R) {
932
+ void AVarBoundsInfo::addAssignment (BoundsKey L, BoundsKey R) {
950
933
// Before adding an edge from L to R or R to L, first verify that the source
951
934
// BoundsKey for the edge is not computed by pointer arithmetic. The pointer
952
935
// arithmetic invalidates the bounds on the pointer, so bounds should not
@@ -975,15 +958,12 @@ bool AVarBoundsInfo::addAssignment(BoundsKey L, BoundsKey R) {
975
958
if (!(PV && PV->isNumConstant ()))
976
959
AddEdgeUnlessPointerArithmetic (L, R);
977
960
}
978
- return true ;
979
961
}
980
962
981
- bool AVarBoundsInfo::handlePointerAssignment (clang::Expr *L, clang::Expr *R,
982
- ASTContext *C,
963
+ void AVarBoundsInfo::handlePointerAssignment (clang::Expr *L, clang::Expr *R,
983
964
ConstraintResolver *CR) {
984
965
if (isAssignmentPointerArithmetic (L ,R))
985
966
recordArithmeticOperation (L, CR);
986
- return true ;
987
967
}
988
968
989
969
void AVarBoundsInfo::mergeBoundsKey (BoundsKey To, BoundsKey From) {
0 commit comments