@@ -532,7 +532,7 @@ void ProgramInfo::addVariable(clang::DeclaratorDecl *D,
532
532
// declared inside the same macro expansion. The first instance of the
533
533
// source location will have been constrained to WILD, so it's safe to bail
534
534
// without doing anymore work.
535
- if (!Rewriter::isRewritable (D->getLocation ())) {
535
+ if (!canRewriteLocation (D->getLocation (), PLoc )) {
536
536
// If we're not in a macro, we should make the constraint variable WILD
537
537
// anyways. This happens if the name of the variable is a macro defined
538
538
// differently is different parts of the program.
@@ -693,7 +693,7 @@ void ProgramInfo::storePersistentConstraints(Expr *E, const CVarSet &Vars,
693
693
// have been computed and cached when the expression has not in fact been
694
694
// visited before. To avoid this, the expression is not cached and instead is
695
695
// recomputed each time it's needed.
696
- if (PSL.valid () && Rewriter::isRewritable (E->getBeginLoc ())) {
696
+ if (PSL.valid () && canRewriteLocation (E->getBeginLoc (), PSL )) {
697
697
auto &ExprMap = isa<ImplicitCastExpr>(E) ? ImplicitCastConstraintVars
698
698
: ExprConstraintVars;
699
699
ExprMap[PSL].insert (Vars.begin (), Vars.end ());
@@ -709,7 +709,7 @@ void ProgramInfo::constrainWildIfMacro(ConstraintVariable *CV,
709
709
SourceLocation Location,
710
710
PersistentSourceLoc *PSL) {
711
711
std::string Rsn = " Pointer in Macro declaration." ;
712
- if (!Rewriter::isRewritable (Location))
712
+ if (!canRewriteLocation (Location, *PSL ))
713
713
CV->constrainToWild (CS, Rsn, PSL);
714
714
}
715
715
0 commit comments