[llvm-dev] getMetadata for function

Mohammad Norouzi via llvm-dev llvm-dev at lists.llvm.org
Thu Feb 16 08:54:21 PST 2017


Dear All,

I have the following piece of code, which gives an ID to every openmp
outlined region.




*Metadata *Ops[1] = {ConstantAsMetadata::get(ConstantInt::get(Int64,
ompRegionsUID++))};         MDNode *N =
MDNode::get(currentRegion->getContext(), Ops);
currentRegion->setMetadata("omp.region.ID <http://omp.region.ID>", N);*


Later, I would like to retrieve given IDs to regions, but I do not know how!

I am using the following code which is not working:


*currentRegion->getMetadata("omp.region.ID
<http://omp.region.ID>")->getOperand(0)*

Thank you very much for your help.

Best,
Mohammad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170216/21820361/attachment.html>


More information about the llvm-dev mailing list