]> granicus.if.org Git - clang/commitdiff
Relax assertion to account for private framework modules, too.
authorAdrian Prantl <aprantl@apple.com>
Fri, 15 Feb 2019 20:24:26 +0000 (20:24 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 15 Feb 2019 20:24:26 +0000 (20:24 +0000)
rdar://problem/48116069

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

lib/CodeGen/CGDebugInfo.cpp
test/Modules/DebugInfo-fmodule-name.c

index ce48f8bb132505832fe6130b6ebbd3c6f4c455e7..e2da77f553452847fc5ff3d6075b41fc8510721d 100644 (file)
@@ -2299,8 +2299,8 @@ CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod,
   // When a module name is specified as -fmodule-name, that module gets a
   // clang::Module object, but it won't actually be built or imported; it will
   // be textual.
-  if (CreateSkeletonCU && IsRootModule && Mod.getASTFile().empty())
-    assert((!M || (M->Name == CGM.getLangOpts().ModuleName)) &&
+  if (CreateSkeletonCU && IsRootModule && Mod.getASTFile().empty() && M)
+    assert(StringRef(M->Name).startswith(CGM.getLangOpts().ModuleName) &&
            "clang module without ASTFile must be specified by -fmodule-name");
 
   if (CreateSkeletonCU && IsRootModule && !Mod.getASTFile().empty()) {
index 6d962bcd2740a75efc6d3d84206ed4eb5a550415..7f2730ddc97bbaefeb0569db7b4131d906b84f5b 100644 (file)
@@ -1,16 +1,16 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fmodule-format=obj -fmodule-name=F \
+// RUN: %clang_cc1 -fmodules -fmodule-format=obj -fmodule-name=MainA \
 // RUN:     -debug-info-kind=limited -dwarf-ext-refs \
 // RUN:     -fimplicit-module-maps -x c -fmodules-cache-path=%t -F %S/Inputs \
 // RUN:     %s -S -emit-llvm -debugger-tuning=lldb -o - | FileCheck %s
 
-#include "F/F.h"
+#include "MainA/MainPriv.h"
 
 // CHECK: !DICompileUnit
 // CHECK-NOT: dwoId:
 
 // We still want the import, but no skeleton CU, since no PCM was built.
 
-// CHECK: !DIModule({{.*}}, name: "F"
+// CHECK: !DIModule({{.*}}, name: "APriv"
 // CHECK-NOT: !DICompileUnit
 // CHECK-NOT: dwoId: