Final phase of converting BlockDecls over to DeclContext. This is unfortunately a largish/complex diff, however it was necessry to pass all the current block tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57337 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index b42950f..198bc4a 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -339,6 +339,8 @@
 DeclContext *DeclContext::getParent() const {
   if (ScopedDecl *SD = dyn_cast<ScopedDecl>(this))
     return SD->getDeclContext();
+  else if (BlockDecl *BD = dyn_cast<BlockDecl>(this))
+    return BD->getParentContext();
   else
     return NULL;
 }