[llvm] [LLVM] Add C API support for handling global object metadata. (PR #104786)

Tim Besard via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 02:10:00 PDT 2024


================
@@ -1088,10 +1100,16 @@ static MDNode *extractMDNode(MetadataAsValue *MAV) {
   return MDNode::get(MAV->getContext(), MD);
 }
 
-void LLVMSetMetadata(LLVMValueRef Inst, unsigned KindID, LLVMValueRef Val) {
-  MDNode *N = Val ? extractMDNode(unwrap<MetadataAsValue>(Val)) : nullptr;
+void LLVMSetMetadata(LLVMValueRef Ref, unsigned KindID, LLVMValueRef MAV) {
----------------
maleadt wrote:

Ah, I somehow didn't know about that API. It's a shame that the Value metadata API is (partially) covered by two slightly different C APIs... I'll check if I can do what I need with the `LLVMGlobal` API.

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


More information about the llvm-commits mailing list