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
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 1766d39..b8d3ec6 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -641,12 +641,8 @@
// 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;