summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 11149f47929..4c275462d4b 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1379,7 +1379,8 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, bool Declaration) {
RecordDecl *RD = Ty->getDecl();
// Limited debug info should only remove struct definitions that can
// safely be replaced by a forward declaration in the source code.
- if (DebugKind <= CodeGenOptions::LimitedDebugInfo && Declaration) {
+ if (DebugKind <= CodeGenOptions::LimitedDebugInfo && Declaration &&
+ !RD->isCompleteDefinitionRequired()) {
// FIXME: This implementation is problematic; there are some test
// cases where we violate the above principle, such as
// test/CodeGen/debug-info-records.c .
OpenPOWER on IntegriCloud