[clang] [clang][bytecode] Use tailcalls via `[[clang::musttail]]` (PR #173756)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 16 06:54:15 PST 2026


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/173756 at github.com>


================
@@ -28,7 +28,17 @@
 using namespace clang;
 using namespace clang::interp;
 
-static bool RetValue(InterpState &S, CodePtr &Pt) {
+#if __has_cpp_attribute(clang::musttail)
+#define MUSTTAIL [[clang::musttail]]
+#elif __has_cpp_attribute(msvc::musttail)
+#define MUSTTAIL [[msvc::musttail]]
+#elif __has_cpp_attribute(musttail)
+#define MUSTTAIL [[musttail]]
----------------
tbaederr wrote:

GCC supports the `clang::` spelling (if it supports the attribute at all), so the `__attribute__` spelling is just theory I guess. But I added it.

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


More information about the cfe-commits mailing list