diff options
| author | Adrian Prantl <aprantl@apple.com> | 2016-03-07 20:58:52 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2016-03-07 20:58:52 +0000 |
| commit | 45b0585fa2e7c9c467a938ce8838c9b3ceb01ca8 (patch) | |
| tree | cbceff21e63a7ae57d13043f63bc8ada8b6273ba /lib/CodeGen/ObjectFilePCHContainerOperations.cpp | |
| parent | b84780f731a6af1b37536fbd7f3ffffef57c64a6 (diff) | |
| download | clang-45b0585fa2e7c9c467a938ce8838c9b3ceb01ca8.tar.gz | |
Module Debugging: Fix a crash when emitting debug info for nested tag types
whose DeclContext is not yet complete by deferring their emission.
rdar://problem/24918680
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
| -rw-r--r-- | lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 96752528d7..d609cf2648 100644 --- a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -201,6 +201,15 @@ public: if (D->getName().empty()) return; + // Defer tag decls until their declcontext is complete. + auto *DeclCtx = D->getDeclContext(); + while (DeclCtx) { + if (auto *D = dyn_cast<TagDecl>(DeclCtx)) + if (!D->isCompleteDefinition()) + return; + DeclCtx = DeclCtx->getParent(); + } + DebugTypeVisitor DTV(*Builder->getModuleDebugInfo(), *Ctx); DTV.TraverseDecl(D); Builder->UpdateCompletedType(D); |
