This is an archive of the discontinued LLVM Phabricator instance.

Parser support for string attributes on arguments/return values
ClosedPublic

Authored by apilipenko on Jul 9 2015, 3:53 AM.

Details

Summary

Currently string attributes on function arguments/return values can be generated using LLVM API. However they are not supported in parser. So, the following scenario will fail:

  • generate function with string attribute using API,
  • dump it in LL format,
  • try to parse.

Add parser support for string attributes to fix the issue.

Diff Detail

Event Timeline

apilipenko updated this revision to Diff 29313.Jul 9 2015, 3:53 AM
apilipenko retitled this revision from to Parser support for string attributes on arguments/return values.
apilipenko updated this object.
apilipenko added reviewers: reames, sanjoy.
apilipenko added a subscriber: llvm-commits.
hfinkel added a subscriber: hfinkel.Jul 9 2015, 7:12 PM

Currently string attributes on function arguments/return values can be generated using LLVM API.

Which API?

Which API?

Function *function;
function->setAttributes(function->getAttributes().addAttribute(context, i, "attribute"));

Which API?

Function *function;
function->setAttributes(function->getAttributes().addAttribute(context, i, "attribute"));

I think the intent was for string attributes only to appear in attribute groups (http://llvm.org/docs/LangRef.html#attribute-groups), not as parameter attributes. I don't object to extending this, but we need to have a conversation on llvmdev first about the extension.

reames edited edge metadata.Jul 21 2015, 4:01 PM
reames added a subscriber: reames.

Given the llvm-dev discussion appears to have petered out without any
objection to the patch itself, LGTM.

Philip

*shrug* I have no objections necessarily either.

-eric

hfinkel accepted this revision.Jul 21 2015, 4:09 PM
hfinkel added a reviewer: hfinkel.

LGTM too.

This revision is now accepted and ready to land.Jul 21 2015, 4:09 PM
This revision was automatically updated to reflect the committed changes.