[cfe-commits] [PATCH] More Docs: Mastering the Clang AST

Manuel Klimek klimek at google.com
Mon Jul 23 02:24:20 PDT 2012


On Thu, Jul 19, 2012 at 10:53 PM, Sean Silva <silvas at purdue.edu> wrote:
> I think that this document would be better titled "Introduction to the
> Clang AST", because that's really what it is. For me, "mastering"
> implies that the person reading it is already "proficient", which does
> not appear to be the target of this document.

Done.

>
> --Sean Silva
>
> On Thu, Jul 19, 2012 at 1:26 AM, Manuel Klimek <klimek at google.com> wrote:
>> Any comments on the content of the doc, or do you guys think it's fine
>> to go in? :)
>>
>> On Wed, Jul 18, 2012 at 11:50 PM, Sean Silva <silvas at purdue.edu> wrote:
>>> It may be possible to do this more simply by looking at just
>>> RecursiveASTVisitor and properly understanding the couple patterns it
>>> uses to traverse the whole AST.
>>>
>>> --Sean Silva
>>>
>>> On Wed, Jul 18, 2012 at 11:38 AM, Joshua Cranmer <pidgeot18 at gmail.com> wrote:
>>>> On 7/17/2012 11:51 PM, Sean Silva wrote:
>>>>>>
>>>>>> On the contrary, I actually like having line/column numbers so I can
>>>>>
>>>>> match things up with where they are in the source tree.
>>>>>
>>>>> This is usually unnecessary in my experience (at least while learning)
>>>>> because usually the stuff you feed it to be dumped will only contain
>>>>> one use of a give identifier or number, which uniquely tracks the node
>>>>> back to the source.
>>>>>
>>>>>> My attempt to do a similar thing for clang ended up failing extremely
>>>>>
>>>>> miserably.
>>>>>
>>>>> any diagnosis as to why it failed?
>>>>
>>>> <https://github.com/jcranmer/viewsource/tree/master/native-tools> has my
>>>> attempt to make this work. The clang tree didn't follow rigorous enough
>>>> design standards to make scraping names possible without more than a few
>>>> hacks, and the fact that half the methods start by declaring assertions
>>>> means I need to have very long guard lists or actually scrape assertion code
>>>> from building clang.
>>>>
>>>>
>>>> --
>>>> Joshua Cranmer
>>>> News submodule owner
>>>> DXR coauthor
>>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list