[LLVMdev] Inserting annotations

Gordon Henriksen gordonhenriksen at me.com
Thu Mar 5 18:11:36 PST 2009


Read about the @llvm.annotation family of intrinsics.

http://llvm.org/docs/LangRef.html#int_var_annotation

llvm::Annotatable is a deprecated means of maintaining "on the side"  
data structures internal to the compiler. Its name is misleading, and  
it has nothing to do with the sort of annotations most people are  
interested in. We would like it to go away; it is currently used only  
to attach the temporary MachineFunction data structure to a Function  
during code generation. Developers with interest Annotatable as it  
stands are advised to use a SmallPtrSet instead.

On 2009-03-05, at 19:31, kapil anand wrote:

> Hi,
>
> As far as I know, Instruction class does not inherit "Annotable"  
> Class. Only Function inherits annotable according to the  
> documentation of annotable class.
>
> What you are asking would require adding annotations at instruction  
> level, which does not seem to be possible. You can maintain external  
> maps between instructions and your annotations,
>
> --Kapil
>
> On Thu, Mar 5, 2009 at 7:17 PM, RAAD B <raad_7007 at yahoo.com> wrote:
> Hello together,
>
> how can i insert annotations in IR ?
>
> I want actually write something like:
> CallInst *call = CallInst::Create( ??? , aBasicBlock);
>
>
> in my pass.
>
>
> Regards
> Raad
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090305/65710c33/attachment.html>


More information about the llvm-dev mailing list