[cfe-dev] Visiting anonymous unions
Sergejs Belajevs
sergejs.belajevs at gmail.com
Mon Aug 20 02:05:42 PDT 2012
Overriding shouldVisitImplicitCode() does the trick, thanks! However,
it seems that this RAV method appears in trunk and not in clang 3.1,
so I'll wait for 3.2 to come out and meanwhile use my token-by-token
solution.
Thanks,
Sergejs
On Sat, Aug 18, 2012 at 3:18 AM, Philip Craig <philipjcraig at gmail.com> wrote:
> On Sat, Aug 18, 2012 at 6:28 AM, Manuel Klimek <klimek at google.com> wrote:
>> On Fri, Aug 17, 2012 at 9:52 PM, John McCall <rjmccall at apple.com> wrote:
>>> On Aug 17, 2012, at 6:23 AM, Sergejs Belajevs wrote:
>>>> I am writing a source-to-source transformation tool and I need a way
>>>> to check if function contains at least one anonymous union inside.
>>>
>>> You should see a DeclStmt that declares a single VarDecl whose type
>>> is a RecordType whose RecordDecl has the isAnonymousStructOrUnion()
>>> bit set.
>>
>> I have played around with that a bit - I have not found a RecordDecl
>> within the FunctionDecl (but I have found a VarDecl) - if you say that
>> should be there, that might be a problem with RAV...
>
> I think John meant that the RecordDecl is only referenced via the
> RecordType of the VarDecl. RAV currently doesn't traverse into the
> RecordType though (same as in PR13618).
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list