[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jun 5 06:18:41 PDT 2025


================
@@ -5096,6 +5097,19 @@ void Verifier::visitCallsiteMetadata(Instruction &I, MDNode *MD) {
   visitCallStackMetadata(MD);
 }
 
+void Verifier::visitCalleeTypeMetadata(Instruction &I, MDNode *MD) {
+  Check(isa<CallBase>(I), "!callee_type metadata should only exist on calls",
+        &I);
+  for (const MDOperand &Op : MD->operands()) {
+    Check(isa<MDNode>(Op.get()),
+          "The callee_type metadata must be a list of type metadata nodes");
+    auto *TypeMD = cast<MDNode>(Op.get());
+    Check(TypeMD->hasGeneralizedMDString(),
+          "Only generalized type metadata can be part of the callee_type "
+          "metadata list");
----------------
nikic wrote:

The CalleeTypeMetadata.rst could be clearer on this requirement. Generalizations are mentioned, but not what this means for the metadata.

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


More information about the llvm-branch-commits mailing list