forked from OSchip/llvm-project
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
This commit is contained in:
parent
08e17b506e
commit
63b45fef45
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue