Paweł Bylica
2015-Jun-30 20:39 UTC
[LLVMdev] Attaching metadata to / extending BasicBlock class
Hi, Is there any way to attach some extended data to an instance of IR BasicBlock class? I tried to extend the class by inheritance but had some problems around destructor (?). Looks like the module is the owner of basic blocks but it does not expect it to be extended. The best idea I have is to attach IR Metadata to the first instructions of the basic block. That is however quite restrictive as the construction an instance of a metadata node is unnecessary complex for this case. - PB -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150630/a6ac1ea9/attachment.html>
Duncan P. N. Exon Smith
2015-Jul-01 01:41 UTC
[LLVMdev] Attaching metadata to / extending BasicBlock class
> On 2015-Jun-30, at 13:39, Paweł Bylica <chfast at gmail.com> wrote: > > Hi, > > Is there any way to attach some extended data to an instance of IR BasicBlock class? I tried to extend the class by inheritance but had some problems around destructor (?). Looks like the module is the owner of basic blocks but it does not expect it to be extended. > > The best idea I have is to attach IR Metadata to the first instructions of the basic block. That is however quite restrictive as the construction an instance of a metadata node is unnecessary complex for this case.For profiling data, we attach metadata to the terminator of the BasicBlock. I don't think there's another way.