@@ -164,7 +164,7 @@ CSetBkeyPair ConstraintResolver::getExprConstraintVars(Expr *E) {
164
164
E = E->IgnoreParens ();
165
165
166
166
// Non-pointer (int, char, etc.) types have a special base PVConstraint.
167
- if (TypE-> isRecordType () || TypE-> isArithmeticType ( )) {
167
+ if (isNonPtrType ( TypE)) {
168
168
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) {
169
169
// If we have a DeclRef, the PVC can get a meaningful name
170
170
return pairWithEmptyBkey (getBaseVarPVConstraint (DRE));
@@ -690,11 +690,15 @@ void ConstraintResolver::constrainLocalAssign(Stmt *TSt, DeclaratorDecl *D,
690
690
}
691
691
}
692
692
693
+ bool ConstraintResolver::isNonPtrType (QualType &TE) {
694
+ return TE->isRecordType () || TE->isArithmeticType () || TE->isVectorType ();
695
+ }
696
+
693
697
CVarSet ConstraintResolver::pvConstraintFromType (QualType TypE) {
694
698
assert (" Pointer type CVs should be obtained through getExprConstraintVars." &&
695
699
!TypE->isPointerType ());
696
700
CVarSet Ret;
697
- if (TypE-> isRecordType () || TypE-> isArithmeticType ( ))
701
+ if (isNonPtrType ( TypE))
698
702
Ret.insert (PVConstraint::getNonPtrPVConstraint (Info.getConstraints ()));
699
703
else
700
704
llvm::errs () << " Warning: Returning non-base, non-wild type" ;
@@ -705,8 +709,8 @@ CVarSet ConstraintResolver::getBaseVarPVConstraint(DeclRefExpr *Decl) {
705
709
if (Info.hasPersistentConstraints (Decl, Context))
706
710
return Info.getPersistentConstraintsSet (Decl, Context);
707
711
708
- assert ( Decl->getType ()-> isRecordType () ||
709
- Decl-> getType ()-> isArithmeticType ( ));
712
+ auto T = Decl->getType ();
713
+ assert ( isNonPtrType (T ));
710
714
711
715
CVarSet Ret;
712
716
auto DN = Decl->getDecl ()->getName ();
0 commit comments