@@ -9620,7 +9620,7 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExpr *E) {
96209620  return ExprEvaluatorBaseTy::VisitCastExpr(E);
96219621}
96229622
9623- static CharUnits GetAlignOfType(EvalInfo &Info , QualType T,
9623+ static CharUnits GetAlignOfType(const ASTContext &Ctx , QualType T,
96249624                                UnaryExprOrTypeTrait ExprKind) {
96259625  // C++ [expr.alignof]p3:
96269626  //     When alignof is applied to a reference type, the result is the
@@ -9631,23 +9631,22 @@ static CharUnits GetAlignOfType(EvalInfo &Info, QualType T,
96319631    return CharUnits::One();
96329632
96339633  const bool AlignOfReturnsPreferred =
9634-       Info. Ctx.getLangOpts().getClangABICompat() <= LangOptions::ClangABI::Ver7;
9634+       Ctx.getLangOpts().getClangABICompat() <= LangOptions::ClangABI::Ver7;
96359635
96369636  // __alignof is defined to return the preferred alignment.
96379637  // Before 8, clang returned the preferred alignment for alignof and _Alignof
96389638  // as well.
96399639  if (ExprKind == UETT_PreferredAlignOf || AlignOfReturnsPreferred)
9640-     return Info.Ctx.toCharUnitsFromBits(
9641-       Info.Ctx.getPreferredTypeAlign(T.getTypePtr()));
9640+     return Ctx.toCharUnitsFromBits(Ctx.getPreferredTypeAlign(T.getTypePtr()));
96429641  // alignof and _Alignof are defined to return the ABI alignment.
96439642  else if (ExprKind == UETT_AlignOf)
9644-     return Info. Ctx.getTypeAlignInChars(T.getTypePtr());
9643+     return Ctx.getTypeAlignInChars(T.getTypePtr());
96459644  else
96469645    llvm_unreachable("GetAlignOfType on a non-alignment ExprKind");
96479646}
96489647
9649- static  CharUnits GetAlignOfExpr(EvalInfo &Info , const Expr *E,
9650-                                  UnaryExprOrTypeTrait ExprKind) {
9648+ CharUnits GetAlignOfExpr(const ASTContext &Ctx , const Expr *E,
9649+                          UnaryExprOrTypeTrait ExprKind) {
96519650  E = E->IgnoreParens();
96529651
96539652  // The kinds of expressions that we have special-case logic here for
@@ -9657,22 +9656,22 @@ static CharUnits GetAlignOfExpr(EvalInfo &Info, const Expr *E,
96579656  // alignof decl is always accepted, even if it doesn't make sense: we default
96589657  // to 1 in those cases.
96599658  if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E))
9660-     return Info. Ctx.getDeclAlign(DRE->getDecl(),
9661-                                   /*RefAsPointee*/true);
9659+     return Ctx.getDeclAlign(DRE->getDecl(),
9660+                             /*RefAsPointee*/  true);
96629661
96639662  if (const MemberExpr *ME = dyn_cast<MemberExpr>(E))
9664-     return Info. Ctx.getDeclAlign(ME->getMemberDecl(),
9665-                                   /*RefAsPointee*/true);
9663+     return Ctx.getDeclAlign(ME->getMemberDecl(),
9664+                             /*RefAsPointee*/  true);
96669665
9667-   return GetAlignOfType(Info , E->getType(), ExprKind);
9666+   return GetAlignOfType(Ctx , E->getType(), ExprKind);
96689667}
96699668
96709669static CharUnits getBaseAlignment(EvalInfo &Info, const LValue &Value) {
96719670  if (const auto *VD = Value.Base.dyn_cast<const ValueDecl *>())
96729671    return Info.Ctx.getDeclAlign(VD);
96739672  if (const auto *E = Value.Base.dyn_cast<const Expr *>())
9674-     return GetAlignOfExpr(Info, E, UETT_AlignOf);
9675-   return GetAlignOfType(Info, Value.Base.getTypeInfoType(), UETT_AlignOf);
9673+     return GetAlignOfExpr(Info.Ctx , E, UETT_AlignOf);
9674+   return GetAlignOfType(Info.Ctx , Value.Base.getTypeInfoType(), UETT_AlignOf);
96769675}
96779676
96789677/// Evaluate the value of the alignment argument to __builtin_align_{up,down},
@@ -14475,11 +14474,11 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr(
1447514474  case UETT_PreferredAlignOf:
1447614475  case UETT_AlignOf: {
1447714476    if (E->isArgumentType())
14478-       return Success(GetAlignOfType(Info, E->getArgumentType(), E->getKind()), 
14479-                       E);
14477+       return Success(
14478+           GetAlignOfType(Info.Ctx, E->getArgumentType(), E->getKind()),  E);
1448014479    else
14481-       return Success(GetAlignOfExpr(Info, E->getArgumentExpr(), E->getKind()), 
14482-                       E);
14480+       return Success(
14481+           GetAlignOfExpr(Info.Ctx, E->getArgumentExpr(), E->getKind()),  E);
1448314482  }
1448414483
1448514484  case UETT_PtrAuthTypeDiscriminator: {
0 commit comments