r358627 - Move the implementation of getInnermostBlockDecl to the .cpp file to fix

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 17:00:17 PDT 2019


Author: ahatanak
Date: Wed Apr 17 17:00:16 2019
New Revision: 358627

URL: http://llvm.org/viewvc/llvm-project?rev=358627&view=rev
Log:
Move the implementation of getInnermostBlockDecl to the .cpp file to fix
failing bots.

Modified:
    cfe/trunk/include/clang/AST/DeclBase.h
    cfe/trunk/lib/AST/DeclBase.cpp

Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=358627&r1=358626&r2=358627&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Wed Apr 17 17:00:16 2019
@@ -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<BlockDecl>(Ctx);
-      Ctx = Ctx->getParent();
-    } while (Ctx);
-
-    return nullptr;
-  }
+  const BlockDecl *getInnermostBlockDecl() const;
 
   bool isObjCContainer() const {
     switch (getDeclKind()) {

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=358627&r1=358626&r2=358627&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Wed Apr 17 17:00:16 2019
@@ -1057,6 +1057,18 @@ DeclContext *DeclContext::getLookupParen
   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();




More information about the cfe-commits mailing list