[cfe-dev] [Patch] Make ParseAST() take ASTContext and TU params

Alexei Svitkine alexei.svitkine at gmail.com
Sat Jan 24 08:02:22 PST 2009


Hi,

Attached is a patch to make ParseAST() take ASTContext and
TranslationUnit as parameters, as suggested by Steve Naroff.

This makes the FreeMemory parameter obsolete, so it is removed.

The motivation is that clients are now responsible for owning those
objects, and are also able to free them themselves, rather than
leaking memory like before (when FreeMemory was false).

I've made the new parameters default to 0, and if they are null then
ParseAST will allocate them on its own and dispose of them after (the
same functionality as when FreeMemory was false previously).

-Alexei
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParseAST.diff
Type: application/octet-stream
Size: 3466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090124/88cf23d8/attachment.obj>


More information about the cfe-dev mailing list