How do I create named metadata via the llvm-c api?

房东的猫 提交于 2019-12-05 15:54:44

As at LLVM 3.0, there is no function exposed in the C API for creating or modifying named metadata. A new function (LLVMAddNamedMetadataOperand) was recently added to the API, after the 3.0 release.

If you're comfortable building LLVM from source, you can get this support from the trunk. See the Getting Started page on how to build LLVM. Otherwise you'll have to wait until LLVM 3.1 is released.

When the function is available, it'll be a simple matter of calling:

LLVMAddNamedMetadataOperand(module, "named_md_name", mdnode);

If there is no named metadata with the name "named_md_name", then one will be created. Otherwise the existing object will be updated.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!