[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 14:24:29 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();
----------------
erichkeane wrote:

This statement here is really weird... the `requiresTrailingStorage` on FPFeatures to determine whether it has features or not is a weird way to ask this question.

https://github.com/llvm/llvm-project/pull/125522


More information about the cfe-commits mailing list