NoQ added a comment.

> Do we need to have one-to-one mapping between ScopeBegins and corresponding 
> ScopeEnds or is it OK to assume that ScopeEnd can terminate several nested 
> scopes?

It's fine if `ScopeEnds` terminates multiple scopes - as long as it is easy to 
find out what scopes are being terminated by looking at it. Because in the 
analyzer we need to put the scope on the stack when we enter it and pop it from 
the stack when we leave it, and those must match no matter what. So imagine 
that we look at the current `ScopeEnd` and at the stack of scopes we currently 
have. Once we have that, we should be able to figure out what scopes are 
ending, without using `ParentMap` or `CFGStmtMap` or re-visiting a large chunk 
of the AST recursively - ideally by a direct lookup.


Repository:
  rL LLVM

https://reviews.llvm.org/D16403



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

Reply via email to