From 63b45fef4578c7da044da90c88a51d26a33165fc Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 23 Jun 2011 21:18:31 +0000 Subject: 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 --- clang/lib/AST/DeclBase.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'clang/lib/AST') 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(DC)) { - DC = cast(DC)->getDeclContext(); - continue; - } - } while (false); + while (isa(DC)) + DC = cast(DC)->getDeclContext(); assert(!DC->isClosure()); return DC; -- cgit v1.2.3