================ @@ -2589,26 +2589,63 @@ SemaOpenACC::ActOnOpenACCAsteriskSizeExpr(SourceLocation AsteriskLoc) { return BuildOpenACCAsteriskSizeExpr(AsteriskLoc); } -/// Loops through a type and generates an appropriate InitListExpr to generate -/// type initialization. -static Expr *GenerateReductionInitRecipeExpr(ASTContext &Context, - SourceRange ExprRange, - QualType Ty) { +namespace { +enum class InitKind { One, AllOnes, Least, Largest }; +llvm::APFloat getInitFloatValue(ASTContext &Context, InitKind IK, QualType Ty) { + switch (IK) { + case InitKind::One: + return llvm::APFloat::getOne(Context.getFloatTypeSemantics(Ty)); + case InitKind::AllOnes: + return llvm::APFloat::getAllOnesValue(Context.getFloatTypeSemantics(Ty)); + case InitKind::Least: + return llvm::APFloat::getSmallestNormalized( ---------------- erichkeane wrote:
Ah! Good to know, thank you! https://github.com/llvm/llvm-project/pull/156535 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits