Move the implementation of getInnermostBlockDecl to the .cpp file to fix
failing bots.
llvm-svn: 358627
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index b358177..9fa9f00 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -1795,17 +1795,7 @@
/// Return this DeclContext if it is a BlockDecl. Otherwise, return the
/// innermost enclosing BlockDecl or null if there are no enclosing blocks.
- const BlockDecl *getInnermostBlockDecl() const {
- const DeclContext *Ctx = this;
-
- do {
- if (Ctx->isClosure())
- return cast<BlockDecl>(Ctx);
- Ctx = Ctx->getParent();
- } while (Ctx);
-
- return nullptr;
- }
+ const BlockDecl *getInnermostBlockDecl() const;
bool isObjCContainer() const {
switch (getDeclKind()) {
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 2f7bb53..e114a87 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -1057,6 +1057,18 @@
return getParent();
}
+const BlockDecl *DeclContext::getInnermostBlockDecl() const {
+ const DeclContext *Ctx = this;
+
+ do {
+ if (Ctx->isClosure())
+ return cast<BlockDecl>(Ctx);
+ Ctx = Ctx->getParent();
+ } while (Ctx);
+
+ return nullptr;
+}
+
bool DeclContext::isInlineNamespace() const {
return isNamespace() &&
cast<NamespaceDecl>(this)->isInline();