/// arguments etc.
Scope *TheScope;
- /// PrevFunctionScope - This is the scope for the enclosing function.
- /// For global blocks, this will be null.
- Scope *PrevFunctionScope;
-
/// ReturnType - This will get set to block result type, by looking at
/// return types, if any, in the block body.
Type *ReturnType;
// Add BSI to CurBlock.
BSI->PrevBlockInfo = CurBlock;
- BSI->PrevFunctionScope = ActiveScope;
CurBlock = BSI;
ActiveScope = BlockScope;
PopDeclContext();
- ActiveScope = CurBlock->PrevFunctionScope;
-
+ // Before poping CurBlock, set ActiveScope to this scopes parent.
+ ActiveScope = CurBlock->TheScope->getParent();
+
// Pop off CurBlock, handle nested blocks.
CurBlock = CurBlock->PrevBlockInfo;