From 7f5aa78ec0f83af1444a63d5f38dc099aaa7279a Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Thu, 18 Apr 2019 00:00:16 +0000 Subject: [PATCH] Move the implementation of getInnermostBlockDecl to the .cpp file to fix failing bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358627 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclBase.h | 12 +----------- lib/AST/DeclBase.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index b358177893..9fa9f00800 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -1795,17 +1795,7 @@ public: /// 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(Ctx); - Ctx = Ctx->getParent(); - } while (Ctx); - - return nullptr; - } + const BlockDecl *getInnermostBlockDecl() const; bool isObjCContainer() const { switch (getDeclKind()) { diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 2f7bb5333a..e114a87c8e 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -1057,6 +1057,18 @@ DeclContext *DeclContext::getLookupParent() { return getParent(); } +const BlockDecl *DeclContext::getInnermostBlockDecl() const { + const DeclContext *Ctx = this; + + do { + if (Ctx->isClosure()) + return cast(Ctx); + Ctx = Ctx->getParent(); + } while (Ctx); + + return nullptr; +} + bool DeclContext::isInlineNamespace() const { return isNamespace() && cast(this)->isInline(); -- 2.40.0