aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-02-01 23:39:00 +0000
committerEric Christopher <echristo@apple.com>2012-02-01 23:39:00 +0000
commit271ce5454ba525931b8b773bb3d03b1893093f9d (patch)
tree8e9550b29a5ec67c1788f7d1a254ca69060653ea /lib/CodeGen/CGDebugInfo.cpp
parent20039ae1d9f520d8395899d807473b638fb48688 (diff)
r149474 went a bit too far when combined with type caching. If we want
a full type go ahead and emit it if we currently only have a forward declaration. Fixes gdb bots for gdb1090.exp and call-ar-st.exp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index b793eb60df..f660e3c95e 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1637,9 +1637,12 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, llvm::DIFile Unit) {
// Unwrap the type as needed for debug information.
Ty = UnwrapTypeForDebugInfo(Ty);
-
+
+ // Check if we already have the type. If we've gotten here and
+ // have a forward declaration of the type we may want the full type.
+ // Go ahead and create it if that's the case.
llvm::DIType T = getTypeOrNull(Ty);
- if (T.Verify()) return T;
+ if (T.Verify() && !T.isForwardDecl()) return T;
// Otherwise create the type.
llvm::DIType Res = CreateTypeNode(Ty, Unit);