rjmccall added a comment.

Interesting.  That's a pretty heavyweight solution, and you're still missing 
switches, which have exactly the same "can jump into an arbitrary variable's 
scope" behavior.

I think maybe an easier solution would be to just remove the begin-lifetime 
marker completely when there's a label or case statement in its scope.  If we 
want to improve on that, there's already a jump analysis in Sema that could 
pretty easily be made to mark variables that have jumps into their lifetimes; 
we would just need to guarantee that that analysis is done.



================
Comment at: lib/CodeGen/LifetimeExtend.cpp:11
+
+class AnalyzeAST : public RecursiveASTVisitor<AnalyzeAST> {
+public:
----------------
A RecursiveASTVisitor is a rather large thing to instantiate, and we don't need 
most of its functionality.  Stmt already has a children() accessor that returns 
the range of child statements, which should be sufficient.


https://reviews.llvm.org/D27680



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to