From f8268f67f562ff8fd49ddbdef0adbc44837c5406 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. llvm-svn: 358627 --- clang/include/clang/AST/DeclBase.h | 12 +----------- clang/lib/AST/DeclBase.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) 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 @@ 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/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 @@ 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.7.4