[cfe-dev] [RFC] Removing libclang APIs to traverse the comment AST

Sean Silva silvas at purdue.edu
Wed Nov 13 18:21:26 PST 2013


On Wed, Nov 13, 2013 at 9:05 PM, Dmitri Gribenko <gribozavr at gmail.com>wrote:

> On Wed, Nov 13, 2013 at 6:01 PM, Sean Silva <silvas at purdue.edu> wrote:
> >
> > On Wed, Nov 13, 2013 at 8:25 PM, Dmitri Gribenko <gribozavr at gmail.com>
> > wrote:
> >>
> >> On Wed, Nov 13, 2013 at 5:22 PM, Sean Silva <silvas at purdue.edu> wrote:
> >> >
> >> > On Wed, Nov 13, 2013 at 8:08 PM, Dmitri Gribenko <gribozavr at gmail.com
> >
> >> > wrote:
> >> >> Or we could only return the first paragraph.  Faking a paragraph
> >> >> requires creating AST nodes, which requires memory allocation on the
> >> >> ASTContext, which is permanent.
> >> >
> >> > Why not create it on demand in "freeable" storage?
> >>
> >> There is no API to free a CXComment node, because it is supposed to
> >> represent an real AST node, which is allocated on ASTContext.
> >
> >
> > Can't you allocate it on the CXTranslationUnit (or whatever the relevant
> > nearby "context" object is that is explicitly created/destroyed)?
>
> There is no difference, because the lifetime of these contexts is the same.
>

Wait then what's the big deal with just allocating them permanently? It's
not like these comments are going to be gigabytes in size.

-- Sean Silva


>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131113/656e0ddb/attachment.html>


More information about the cfe-dev mailing list