[cfe-commits] r54364 - in /cfe/trunk: Driver/ASTConsumers.cpp Driver/ASTConsumers.h Driver/clang.cpp include/clang/CodeGen/ModuleBuilder.h lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h lib/CodeGen/ModuleBuilder.cpp
Ted Kremenek
kremenek at apple.com
Thu Aug 7 19:48:56 PDT 2008
On Aug 7, 2008, at 4:56 PM, Daniel Dunbar wrote:
> I don't particularly care for the conditional deletion an argument.
> Just from
> a semantic view it complicates ownership and makes the code less
> obviously
> correct on a quick visual inspection.
>
> I think we should just pull the deletion out of ParseAST(). Its
> almost simpler
> for the caller to use an owning pointer anyway.
After also discussing this with Daniel in person, I definitely think
this is the right approach. Clients should be free to interrogate the
ASTConsumer after ParseAST has completed, and it is easy to make it
the client's responsibility to delete the ASTConsumer. It will also
force people not to put logic in the destructor of an ASTConsumer
other than necessary cleanup.
The following patch implements this change:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080804/006869.html
More information about the cfe-commits
mailing list