[cfe-dev] A question on initListExpr() matcher

Olivier Goffart via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 25 09:34:56 PST 2016


On Freitag, 25. November 2016 13:55:06 CET Farzad Sadeghi wrote:
> I'm not sure if I understand. Could you please explain what are the
> syntactic and semantic forms for initListExpr?

>From the doc comments above the InitListExpr explains it:
http://clang.llvm.org/doxygen/classclang_1_1InitListExpr.html#details
hey contain essentially the same if there was no C99 initializer or holes.

The problem is that both form are visited while one probably is only 
interested in the syntactic form for the matcher.

-- 
Olivier

> 
> On 11/25/16, Olivier Goffart <olivier at woboq.com> wrote:
> > On Mittwoch, 23. November 2016 07:34:02 CET Manuel Klimek via cfe-dev
> > 
> > wrote:
> >> Adding Richard,
> >> 
> >> this is indeed a good question.
> >> Looking at the dumps, it seems like match 2-4 have InitListExpr nodes
> >> that
> >> do not show up in the larger InitListExpr.
> >> Richard, is that intentional in the AST?
> > 
> > That's because InitListExpr has booth a semantic and syntactic form.
> > Things like the RecursiveASTVisitor visit both forms.
> > 
> > --
> > Olivier





More information about the cfe-dev mailing list