[llvm-dev] Adding a function attribute with an argument

Tehila Mayzels via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 8 00:02:15 PDT 2015


Hi,

 

I'm trying to add a function attribute to clang/llvm.

I need an attribute that will have an additional information of a variable
name.

e.g. I would like to add support for something like:

 

void foo() __attribute__ ((xyz(v)) {.}

 

such that on the IR stage I can realize that the function foo has the
attribute xyz and an argument v that  marks variable v (which is a variable
inside foo) for my needs.

 

I was able to add a function attribute without an argument, but I don't
understand how to parse/save/analyze the argument.

 

I would appreciate any ideas/examples/references.

 

Thanks a lot,

Tehila. 

 

 

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


More information about the llvm-dev mailing list