]> granicus.if.org Git - clang/commitdiff
Move the implementation of getInnermostBlockDecl to the .cpp file to fix
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 18 Apr 2019 00:00:16 +0000 (00:00 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 18 Apr 2019 00:00:16 +0000 (00:00 +0000)
failing bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358627 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclBase.h
lib/AST/DeclBase.cpp

index b35817789377885cfe653dd5b0f30eb0db5389b2..9fa9f0080044dde3f855b0538c3e52ce0a9e6138 100644 (file)
@@ -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()) {
index 2f7bb5333a3687564b378ad215481616861bc77b..e114a87c8e3cb0b83f9e09b8b78e7471ede1314e 100644 (file)
@@ -1057,6 +1057,18 @@ DeclContext *DeclContext::getLookupParent() {
   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();