[cfe-dev] Fixing life-time issues with CompilerInstance and friends

Chandler Carruth via cfe-dev cfe-dev at lists.llvm.org
Mon Jan 11 02:37:17 PST 2016


I think we should fix the bug first and address the design issue second...

...provided *someone* steps up to fix the design issue in ASTUnit. Who is
maintaining it? Who is depending on it? When we discover critical design
flaws in something like this is when it becomes really important that
someone is actually willing to commit the resources to fixing things
properly....

On Mon, Jan 11, 2016 at 1:28 AM Manuel Klimek <klimek at google.com> wrote:

> (this is a request for discussion of how to handle this problem on a
> principled level)
> Context: currently, there are bugs in clang regarding the lifetime
> handling of FileManager / vfs::FileSystem.
> Owen has started to send out patches to fix the issues by migrating the
> uses to IntrusiveRefCntPtr and shared_ptr respectively.
>
> Chandler has mentioned that he considers most uses of shared pointers in
> clang bugs; looking into it, it seems that:
> - most people would expect FileManager/vfs::FileSystem to have a larger
> scope than basically anything else in clang (hence the bugs)
> - the underlying life-time problems seem to come from design issues in
> ASTUnit, which are potentially expensive to fix
> - we currently have bugs; fixing bugs is good ...
>
> The question is: how do we proceed - is the right thing to do to fix the
> bugs as quickly as possible by introducing more use of shared pointers, or
> do we want to require addressing the underlying design problem?
> Usually I'd tend to say "let's fix the bug first, and address the design
> issue later", but I'm concerned that fixing the bugs will lead to not
> enough pain being left for anybody to ever address the design problems :(
>
> Thoughts?
> /Manuel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160111/3e15e2fc/attachment.html>


More information about the cfe-dev mailing list