<p dir="ltr">Hi Aaron,<br><br></p>
<p dir="ltr">I included two integers in <a href="http://attr.td">attr.td</a> file for this attribute declaration. I included the numbers by hand in the object creation<br>
(I wrote a handler in SemaDeclAttr.cpp file)<br>
and works, but I obtain error when I try to get the values form the attribute list.</p>
<p dir="ltr">Do you have any hint?</p>
<p dir="ltr">Thanks!<br>
Luis.</p>
<div class="gmail_quote">El 17/04/2015 17:23, "Aaron Ballman" <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> escribió:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Apr 17, 2015 at 11:05 AM, LUIS MIGUEL SANCHEZ GARCIA<br>
<<a href="mailto:luismiguel.sanchez@uc3m.es">luismiguel.sanchez@uc3m.es</a>> wrote:<br>
> I would like to parser the values of a C++ attribute in clang, but I don't<br>
> know how to get the information from the AttributeList class.<br>
><br>
><br>
> For example, is it better to use?<br>
><br>
> IdentifierLoc *Value1 = A.getArgAsIdent(0);<br>
> IdentifierLoc *Value2 = A.getArgAsIdent(1);<br>
><br>
> or<br>
><br>
> Expr *Value1 = A.getArgAsExpr(0);<br>
> Expr *Value2 = A.getArgAsExpr(1);<br>
><br>
> And later?<br>
<br>
A good place to look is SemaDeclAttr.cpp; that's where parsed<br>
attributes are converted into semantic attributes that attach to<br>
declarations. (SemaStmtAttr.cpp is where you'd go for statement<br>
attributes; type attributes are a bit more involved and live in<br>
SemaType.cpp).<br>
<br>
As for whether you would be using getArgAsIdent or getArgAsExpr, that<br>
depends entirely on the declaration of your attribute in Attr.td<br>
(specifically, what kind of arguments it takes). Attributes that take<br>
an IdentifierArgument, EnumArgument, or VariadicEnumArgument all use<br>
getArgAsIdent().<br>
<br>
HTH!<br>
<br>
~Aaron<br>
<br>
><br>
> Thanks!<br>
><br>
> Best regards,<br>
> Luis.<br>
> --<br>
> --<br>
> --<br>
> --------------------------------------------------<br>
> Luis Miguel Sánchez García<br>
> Computer Architecture and Technology Area.<br>
> Office 2.2.B08<br>
> Computer Science Department. UNIVERSIDAD CARLOS III DE MADRID<br>
> Universidad Carlos III de Madrid<br>
> Avda. de la Universidad, 30<br>
> 28911 Leganés - Madrid - Spain<br>
> e-mail: <a href="mailto:lmsan@arcos.inf.uc3m.es">lmsan@arcos.inf.uc3m.es</a><br>
> <a href="mailto:luismiguel.sanchez@uc3m.es">luismiguel.sanchez@uc3m.es</a><br>
><br>
> Phone: (+34) 91 624 5951<br>
><br>
> Linked-In: <a href="http://es.linkedin.com/in/lmsan" target="_blank">http://es.linkedin.com/in/lmsan</a><br>
> Twitter: <a href="http://twitter.com/lmsanchezgarcia" target="_blank">http://twitter.com/lmsanchezgarcia</a><br>
> --------------------------------------------------<br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
</blockquote></div>