Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] The best way to create IASTTranslationUnit

If you skip headers found in the index, the AST will not contain
any nodes for the code in these headers. However, all macro definitions
will be available to the preprocessor. Furthermore, for the purpose of
name 
resolution (binding resolution) declarations found in the index
will be considered.

If you decide not to skip the headers, the index will not be used
(what for?).

Please look at the java-doc of each of the constants that can be
supplied with getAST(...).

Markus.

 

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Dmitry Smirnov
> Sent: Tuesday, October 14, 2008 4:10 PM
> To: CDT General developers list.
> Subject: Re: [cdt-dev] The best way to create IASTTranslationUnit
> Importance: Low
> 
> Thank you.
> Could you please clarify that AST_SKIP_INDEXED_HEADERS since 
> it is not very clear for me.
> I did understand that headers will be pulled from index. At 
> the same time (as I undestand, maybe wrongly) index contains 
> just subset of the whole AST information.
> Am I right that I could loose some useful info (I'm mostly 
> wondering about macros) ?
> What will happen with perfromance if I use zero for second 
> argument of getAST? Will it ignore index (except parser 
> configuration)?
> 
> Dmitry
> 
> 
> 2008/10/14 Schorn, Markus <Markus.Schorn@xxxxxxxxxxxxx>:
> > I recommend to create the AST using ITranslationUnit.getAST(IIndex, 
> > int style).
> > Doing that the parser will pick up the same configuration as the 
> > indexer would.
> > With the 'style' argument you can choose to skip indexed-headers in 
> > which case they are pulled in from the index (style 
> > AST_SKIP_INDEXED_HEADERS).
> >
> > Markus.
> >
> >> -----Original Message-----
> >> From: cdt-dev-bounces@xxxxxxxxxxx
> >> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Dmitry Smirnov
> >> Sent: Tuesday, October 14, 2008 2:36 PM
> >> To: CDT General developers list.
> >> Subject: [cdt-dev] The best way to create IASTTranslationUnit
> >> Importance: Low
> >>
> >> Hi,
> >>
> >> I'm wondering what is the best way to create the 
> IASTTranslationUnit 
> >> from performance perspective?
> >>
> >> When I create it with
> >>  CCorePlugin.getDefault().getDOM().getTranslationUnit(file,
> >> false); it takes up to few seconds.
> >>
> >> At the same time, it seems I do not use the index at all though my 
> >> project has the index. Is it possible to use it for AST? Will it 
> >> speed up the ASTTranslationUnit creation process?
> >>
> >> Dmitry
> >> _______________________________________________
> >> cdt-dev mailing list
> >> cdt-dev@xxxxxxxxxxx
> >> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> >>
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> >
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top