[cfe-dev] Access to the field of a structure

Alberto Barbaro barbaro.alberto at gmail.com
Wed Feb 18 15:50:42 PST 2015


Sean
Thanks I'll do as you have suggested.

Alberto
On 18 Feb 2015 23:43, "Sean Silva" <chisophugis at gmail.com> wrote:

> You will first want to get the RecordDecl
> through TypedefNameDecl::getUnderlyingType and then use the decls_begin/end
> iterators for iterating (or the decls() range in a range-for) (note these
> methods are inherited from DeclContext).
>
> -- Sean Silva
>
> On Sat, Feb 14, 2015 at 1:15 PM, Alberto Barbaro <
> barbaro.alberto at gmail.com> wrote:
>
>> Hi All,
>> in my .c file I have a struct like this:
>>
>> typedef struct var {
>>     int x;
>>     int y;
>> } point;
>>
>>
>> Overriding the VisitTypedefDecl method I can access to the structure
>> using a TypedefNameDecl variable. How can I access to the fields of the
>> struct?
>>
>> Thanks,
>> Alberto
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150218/ff636577/attachment.html>


More information about the cfe-dev mailing list