diff options
author | John McCall <rjmccall@apple.com> | 2011-06-23 21:18:31 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-06-23 21:18:31 +0000 |
commit | 7b3f853c6f684c1df423e994482681844c396342 (patch) | |
tree | 6aee195c5f66d2b0b16c26420a68c593b789eb64 /lib/AST/DeclBase.cpp | |
parent | d028302b57ff14a495eaa220393ae40c14a583f4 (diff) |
Apparently at some point in the past I forgot how 'continue'
works in a 'while(false)' loop. Simplify this code; it was
complicated only in anticipation of C++0x lambdas, and it can
become complicated again when those happen. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133761 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 1766d39c14..b8d3ec60d3 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -641,12 +641,8 @@ DeclContext *Decl::getNonClosureContext() { // This is basically "while (DC->isClosure()) DC = DC->getParent();" // except that it's significantly more efficient to cast to a known // decl type and call getDeclContext() than to call getParent(). - do { - if (isa<BlockDecl>(DC)) { - DC = cast<BlockDecl>(DC)->getDeclContext(); - continue; - } - } while (false); + while (isa<BlockDecl>(DC)) + DC = cast<BlockDecl>(DC)->getDeclContext(); assert(!DC->isClosure()); return DC; |