summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-08-22 22:23:58 +0000
committerAdrian Prantl <aprantl@apple.com>2016-08-22 22:23:58 +0000
commita72972b985e4553a8e607687bfb7e32bff25aa85 (patch)
tree78b1322eadd4744c71d7e7dbb04f7341592526f9 /clang
parent9f5c83b914ff8d7094fef580cf86ecee784ad008 (diff)
downloadbcm5719-llvm-a72972b985e4553a8e607687bfb7e32bff25aa85.tar.gz
bcm5719-llvm-a72972b985e4553a8e607687bfb7e32bff25aa85.zip
Module debug info: Don't assert when encountering an incomplete definition
in isDefinedInClangModule() and assume that the incomplete definition is not defined in the module. This broke the -gmodules self host recently. rdar://problem/27894367 llvm-svn: 279485
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp3
-rw-r--r--clang/test/Modules/Inputs/DebugNestedA.h8
-rw-r--r--clang/test/Modules/Inputs/DebugNestedB.h7
-rw-r--r--clang/test/Modules/Inputs/module.map10
4 files changed, 27 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index a153193a53f..af0cd02ed2f 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1655,7 +1655,8 @@ static bool isDefinedInClangModule(const RecordDecl *RD) {
if (!RD->isExternallyVisible() && RD->getName().empty())
return false;
if (auto *CXXDecl = dyn_cast<CXXRecordDecl>(RD)) {
- assert(CXXDecl->isCompleteDefinition() && "incomplete record definition");
+ if (!CXXDecl->isCompleteDefinition())
+ return false;
auto TemplateKind = CXXDecl->getTemplateSpecializationKind();
if (TemplateKind != TSK_Undeclared) {
// This is a template, check the origin of the first member.
diff --git a/clang/test/Modules/Inputs/DebugNestedA.h b/clang/test/Modules/Inputs/DebugNestedA.h
new file mode 100644
index 00000000000..58dc2a7df74
--- /dev/null
+++ b/clang/test/Modules/Inputs/DebugNestedA.h
@@ -0,0 +1,8 @@
+/* -*- C++ -*- */
+template <typename T> class Base {};
+template <typename T> struct A : public Base<A<T>> {
+ void f();
+};
+
+class F {};
+typedef A<F> AF;
diff --git a/clang/test/Modules/Inputs/DebugNestedB.h b/clang/test/Modules/Inputs/DebugNestedB.h
new file mode 100644
index 00000000000..7f75d0946e2
--- /dev/null
+++ b/clang/test/Modules/Inputs/DebugNestedB.h
@@ -0,0 +1,7 @@
+/* -*- C++ -*- */
+#include "DebugNestedA.h"
+class C {
+ void run(AF &af) {
+ af.f();
+ }
+};
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index a683190e182..2beb942861a 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/test/Modules/Inputs/module.map
@@ -422,3 +422,13 @@ module MacroFabs1 {
module DiagOutOfDate {
header "DiagOutOfDate.h"
}
+
+module DebugNestedA {
+ header "DebugNestedA.h"
+ export *
+}
+
+module DebugNestedB {
+ header "DebugNestedB.h"
+ export *
+}
OpenPOWER on IntegriCloud