[llvm-branch-commits] [llvm] [AllocToken, Clang] Implement __builtin_alloc_token_infer() and llvm.alloc.token.id (PR #156842)

Oliver Hunt via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 9 22:54:26 PDT 2025


================
@@ -1274,6 +1274,12 @@ def AllocaWithAlignUninitialized : Builtin {
   let Prototype = "void*(size_t, _Constant size_t)";
 }
 
+def AllocTokenInfer : Builtin {
+  let Spellings = ["__builtin_alloc_token_infer"];
----------------
ojhunt wrote:

I think `__builtin_infer_alloc_token` sounds better? I can't think of a way to easily infer from returns :-/

A developer can work with out parameters though - at least in the macro use case `infer(*out_param_expr)`

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


More information about the llvm-branch-commits mailing list