[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)
Jakub Ficek via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 4 06:33:55 PST 2025
================
@@ -5439,3 +5441,21 @@ OpenACCAsteriskSizeExpr *
OpenACCAsteriskSizeExpr::CreateEmpty(const ASTContext &C) {
return new (C) OpenACCAsteriskSizeExpr({}, C.IntTy);
}
+
+ConvertVectorExpr *ConvertVectorExpr::CreateEmpty(const ASTContext &C,
+ bool hasFPFeatures) {
+ void *Mem = C.Allocate(totalSizeToAlloc<FPOptionsOverride>(hasFPFeatures),
+ alignof(ConvertVectorExpr));
+ return new (Mem) ConvertVectorExpr(hasFPFeatures, EmptyShell());
+}
+
+ConvertVectorExpr *ConvertVectorExpr::Create(
+ const ASTContext &C, Expr *SrcExpr, TypeSourceInfo *TI, QualType DstType,
+ ExprValueKind VK, ExprObjectKind OK, SourceLocation BuiltinLoc,
+ SourceLocation RParenLoc, FPOptionsOverride FPFeatures) {
+ bool HasFPFeatures = FPFeatures.requiresTrailingStorage();
----------------
ficol wrote:
All exprs that implement FPOptionsOverride do this check this way e.g.:
https://github.com/llvm/llvm-project/blob/fc40a0fddd830aa1fdfaafa1618acc5c2d0ee5fa/clang/lib/AST/Expr.cpp#L4961-L4968
https://github.com/llvm/llvm-project/pull/125522
More information about the cfe-commits
mailing list