How to add metadata nodes using the LLVM C Api/llvm-fs bindings
问题 I'm trying to add metadata nodes to a program, either onto the instructions or as global metadata. How do I do this with the LLVM C API? It now provides a function LLVMAddNamedMetadataOperand (as found from this question) but I can't seem to see how to use it. This is bound to addNamedMetadataOperand in the llvm-fs bindings. I tried this: addNamedMetadataOperand myModule "foobar" (mDString "cat" 3u) expecting it to make some metadata node called foobar but it doesn't work - complains about