[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:25 PDT 2025


================
@@ -3352,10 +3352,15 @@ class CodeGenFunction : public CodeGenTypeCache {
   SanitizerAnnotateDebugInfo(ArrayRef<SanitizerKind::SanitizerOrdinal> Ordinals,
                              SanitizerHandler Handler);
 
-  /// Emit additional metadata used by the AllocToken instrumentation.
+  /// Emit metadata used by the AllocToken instrumentation.
+  llvm::MDNode *EmitAllocTokenHint(QualType AllocType);
----------------
ojhunt wrote:

I think this should be something like `BuildAllocTokenHint` -- also does llvm permit multiple nodes to share this hint? 

This is basically a "can this be cached and reused?" question - For TMO we needed to cache Type->descriptor to avoid any compile time regression - though I guess the TMO descriptors are more expensive to produce.

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


More information about the llvm-branch-commits mailing list