On Tue, 12 May 2009 23:45:44 -0700, Chris Lattner <[email protected]> wrote: > On Apr 27, 2009, at 11:25 PM, Sebastian Redl wrote: > >> >> On Mon, 27 Apr 2009 15:10:30 -0700, Chris Lattner <[email protected]> >> wrote: >>> >>> Instead of doing this as a treewalk, how about handling this in sema >>> of a return. Just check to see if the context is a construction >>> function whose body is a try block there? >> >> I've thought about this. However, this would mean either an additional >> state variable in Sema (and it would have to be saved for members of >> local >> classes), or a non-trivial query for every return statement. >> Function-try-blocks are so rare in real-world code that I think my >> way is >> better. > > How is this query non-trivial? Isn't it just a context check?
The way I see it, I either have to walk the scope tree upwards until I get to the function scope, to discover that it's a catch, or I have to take the current function, get its body, discover that it's a try, and then somehow discover that I'm in one of the catches of the try. I don't even know how to do that, but I'm certain its cost is not negligible. Sebastian _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
