summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index c91b7a97443..2ad750b46a7 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1435,6 +1435,9 @@ void CGDebugInfo::completeType(const RecordDecl *RD) {
}
void CGDebugInfo::completeRequiredType(const RecordDecl *RD) {
+ if (DebugKind <= CodeGenOptions::DebugLineTablesOnly)
+ return;
+
if (const CXXRecordDecl *CXXDecl = dyn_cast<CXXRecordDecl>(RD))
if (CXXDecl->isDynamicClass())
return;
@@ -2042,6 +2045,9 @@ llvm::DIType CGDebugInfo::getCompletedTypeOrNull(QualType Ty) {
void CGDebugInfo::completeTemplateDefinition(
const ClassTemplateSpecializationDecl &SD) {
+ if (DebugKind <= CodeGenOptions::DebugLineTablesOnly)
+ return;
+
completeClassData(&SD);
// In case this type has no member function definitions being emitted, ensure
// it is retained
@@ -3341,8 +3347,7 @@ void CGDebugInfo::finalize() {
// up the final type in the type cache.
for (std::vector<void *>::const_iterator RI = RetainedTypes.begin(),
RE = RetainedTypes.end(); RI != RE; ++RI)
- if (llvm::Value *V = TypeCache[*RI])
- DBuilder.retainType(llvm::DIType(cast<llvm::MDNode>(V)));
+ DBuilder.retainType(llvm::DIType(cast<llvm::MDNode>(TypeCache[*RI])));
DBuilder.finalize();
}
OpenPOWER on IntegriCloud