================ @@ -168,24 +168,9 @@ static bool MustVisitNullValue(const Expr *E) { return E->getType()->isNullPtrType(); } -/// If \p E is a widened promoted integer, get its base (unpromoted) type. -static std::optional<QualType> getUnwidenedIntegerType(const ASTContext &Ctx, - const Expr *E) { - const Expr *Base = E->IgnoreImpCasts(); - if (E == Base) - return std::nullopt; - - QualType BaseTy = Base->getType(); - if (!Ctx.isPromotableIntegerType(BaseTy) || - Ctx.getTypeSize(BaseTy) >= Ctx.getTypeSize(E->getType())) - return std::nullopt; - - return BaseTy; -} - /// Check if \p E is a widened promoted integer. static bool IsWidenedIntegerOp(const ASTContext &Ctx, const Expr *E) { - return getUnwidenedIntegerType(Ctx, E).has_value(); + return Ctx.getUnwidenedIntegerType(E).has_value(); ---------------- andykaylor wrote:
I love this change, but this should probably be split out as a separate patch. As we discussed earlier, let's defer this refactoring for a separate patch. https://github.com/llvm/llvm-project/pull/132420 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits