[LLVMdev] multiple metadata fields

Alexandru Ionut Diaconescu cyrusthevirus001x at yahoo.com
Mon Apr 29 07:09:41 PDT 2013


            

Hello everyone,

As i saw that is not possible to add metadata to a basic block, it is possible to add more metadata fields to an instruction?


I saw that in the definition of setMetadata(), it updates/replaces the metadata if already existent. As far as I understand, updates=replaces, not updates OR replaces. I add metadata using :


            LLVMContext& C = instr->getContext();
            MDNode* N = MDNode::get(C, MDString::get(C, "var"));
            instr->setMetadata("varvar", N);


Thank you in advance !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130429/3a1bbfe3/attachment.html>


More information about the llvm-dev mailing list