[cfe-dev] [RFC] Removing libclang APIs to traverse the comment AST
Sean Silva
silvas at purdue.edu
Wed Nov 13 18:01:03 PST 2013
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)?
-- 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/960c5ba7/attachment.html>
More information about the cfe-dev
mailing list