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

Marco Elver via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Sep 18 02:20:59 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);
----------------
melver wrote:

Yes, LLVM permits sharing MD nodes - MDNode::get should intern nodes, although if you want to skip the whole calculation involved, that needs introducing a separate lookup table.

Changing it to buildAllocToken.

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


More information about the llvm-branch-commits mailing list