summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-06-21 21:03:11 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-06-21 21:03:11 +0000
commit940ca4d4626bbdd8d228b34416d3b0d4ff8b004e (patch)
tree71cdfcc7aa02c8a273662f0b454ad9be5daac29d /clang/lib
parent9799cf7fb3c47b2eacec7099e1f0e78ee6b189bb (diff)
downloadbcm5719-llvm-940ca4d4626bbdd8d228b34416d3b0d4ff8b004e.tar.gz
bcm5719-llvm-940ca4d4626bbdd8d228b34416d3b0d4ff8b004e.zip
PR16214: Debug info for types first used via pointers or qualified types & later require definitions
llvm-svn: 184594
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index b2f3120ec38..58e492ea7d9 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1951,8 +1951,15 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, llvm::DIFile Unit,
llvm::DIType T = getCompletedTypeOrNull(Ty);
- if (T.Verify())
+ if (T.Verify()) {
+ // If we're looking for a definition, make sure we have definitions of any
+ // underlying types.
+ if (const TypedefType* TTy = dyn_cast<TypedefType>(Ty))
+ getOrCreateType(TTy->getDecl()->getUnderlyingType(), Unit, Declaration);
+ if (Ty.hasLocalQualifiers())
+ getOrCreateType(QualType(Ty.getTypePtr(), 0), Unit, Declaration);
return T;
+ }
// Otherwise create the type.
llvm::DIType Res = CreateTypeNode(Ty, Unit, Declaration);
OpenPOWER on IntegriCloud