[llvm-commits] [PATCH] C Bindings: Allow reading MDNode operands

Anthony Bryant antjbryant at gmail.com
Thu Sep 13 03:27:33 PDT 2012


Hi Duncan,

>> (Sorry for sending this to the wrong list earlier.)
>>
>> This patch just adds two functions: LLVMGetMDNodeNumOperands and
>> LLVMGetMDNodeOperands, which allow access to MDNode operands from the
>> C API, similarly to how named metadata can be accessed there.
>>
>> Could this be reviewed and possibly committed please?
>
> if the node isn't an MDNode shouldn't it barf (eg abort)?

I thought I checked for that - both of them do dyn_cast<MDNode> and
check whether the result is null before continuing.

Do you mean they should return some sort of error? Because the
functions that read the same things from NamedMDNodes don't.

Thanks,
Anthony.



More information about the llvm-commits mailing list