Attaching metadata to / extending BasicBlock class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Attaching metadata to / extending BasicBlock class

Paweł Bylica
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

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Attaching metadata to / extending BasicBlock class

Duncan P. N. Exon Smith

> On 2015-Jun-30, at 13:39, Paweł Bylica <[hidden email]> 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.


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev