r354165 - Relax assertion to account for private framework modules, too.

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 15 12:24:26 PST 2019


Author: adrian
Date: Fri Feb 15 12:24:26 2019
New Revision: 354165

URL: http://llvm.org/viewvc/llvm-project?rev=354165&view=rev
Log:
Relax assertion to account for private framework modules, too.

rdar://problem/48116069

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/Modules/DebugInfo-fmodule-name.c

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=354165&r1=354164&r2=354165&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Feb 15 12:24:26 2019
@@ -2299,8 +2299,8 @@ CGDebugInfo::getOrCreateModuleRef(Extern
   // 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()) {

Modified: cfe/trunk/test/Modules/DebugInfo-fmodule-name.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/DebugInfo-fmodule-name.c?rev=354165&r1=354164&r2=354165&view=diff
==============================================================================
--- cfe/trunk/test/Modules/DebugInfo-fmodule-name.c (original)
+++ cfe/trunk/test/Modules/DebugInfo-fmodule-name.c Fri Feb 15 12:24:26 2019
@@ -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:




More information about the cfe-commits mailing list