[clang] [clang] Mark `__builtin_convertvector` and `__builtin_shufflevector` as `constexpr`. (PR #112129)

via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 13 04:18:29 PDT 2024


https://github.com/c8ef created https://github.com/llvm/llvm-project/pull/112129

Closes #107985.

>From 34518391101653e9ef84d8a80b70ae2df8551b3d Mon Sep 17 00:00:00 2001
From: c8ef <c8ef at outlook.com>
Date: Sun, 13 Oct 2024 19:16:57 +0800
Subject: [PATCH] Update Builtins.td

---
 clang/include/clang/Basic/Builtins.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/include/clang/Basic/Builtins.td b/clang/include/clang/Basic/Builtins.td
index 7068473a0e12ac..362de6cfa9d0e1 100644
--- a/clang/include/clang/Basic/Builtins.td
+++ b/clang/include/clang/Basic/Builtins.td
@@ -1186,13 +1186,13 @@ def AllowRuntimeCheck : Builtin {
 
 def ShuffleVector : Builtin {
   let Spellings = ["__builtin_shufflevector"];
-  let Attributes = [NoThrow, Const, CustomTypeChecking];
+  let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
   let Prototype = "void(...)";
 }
 
 def ConvertVector : Builtin {
   let Spellings = ["__builtin_convertvector"];
-  let Attributes = [NoThrow, Const, CustomTypeChecking];
+  let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
   let Prototype = "void(...)";
 }
 



More information about the cfe-commits mailing list