[llvm-branch-commits] [AllocToken, Clang] Infer type hints from sizeof expressions and casts (PR #156841)

Marco Elver via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 6 06:41:39 PDT 2025


================
@@ -10,7 +10,7 @@ typedef __typeof(sizeof(int)) size_t;
 void *malloc(size_t size);
 
 // CHECK-LABEL: @test_malloc(
-// CHECK: call{{.*}} ptr @__alloc_token_malloc(i64 noundef 4, i64 0)
+// CHECK: call{{.*}} ptr @__alloc_token_malloc(i64 noundef 4, i64 2689373973731826898){{.*}} !alloc_token [[META_INT:![0-9]+]]
----------------
melver wrote:

We're using a stable hash, so this should always be the same.
Or do you mean to be able to refer to the same token via e.g. `[[TOKEN_INT]]`?
Though we still want to check the exact value, given it's meant to be stable.

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


More information about the llvm-branch-commits mailing list