[cfe-dev] Fixing life-time issues with CompilerInstance and friends
Manuel Klimek via cfe-dev
cfe-dev at lists.llvm.org
Mon Jan 11 01:28:10 PST 2016
(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/5edfac31/attachment.html>
More information about the cfe-dev
mailing list