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 | 63b45fef4578c7da044da90c88a51d26a33165fc (patch) | |
tree | 1e30f0f6b52e2c2cdf33e942d081f2949852010d /clang/lib/AST | |
parent | 08e17b506e3c96a2116c3ca708ef7277c6807ce6 (diff) | |
download | bcm5719-llvm-63b45fef4578c7da044da90c88a51d26a33165fc.tar.gz bcm5719-llvm-63b45fef4578c7da044da90c88a51d26a33165fc.zip |
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. :)
llvm-svn: 133761
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 1766d39c140..b8d3ec60d3a 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/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; |