[LLVMdev] String attributes for function arguments and return values

Artur Pilipenko apilipenko at azulsystems.com
Mon Jul 13 04:45:35 PDT 2015


Hi,

I’d like to support string attributes on function arguments and return values. We are going to use them in our tree to express higher level language types.

Internally attributes framework have everything to do this, it’s even possible to generate string attributes via API right now:
Function *function;
function->setAttributes(function->getAttributes().addAttribute(context, i, "attribute"));
But because it’s not supported in LLParser if you dump the function and try to parse it back it will fail. I have a patch to fix this problem:
http://reviews.llvm.org/D11058
I consider this part as a bug fix for existing functionality.

The second patch is to add accessors to string attributes to Argument and Function classes:
http://reviews.llvm.org/D10872
This part is optional because there no code in upstream will make use of it. But if we support string attributes syntax it makes sense to provide API support as well.

Does anyone have any objections?

Thanks,
Artur


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


More information about the llvm-dev mailing list