]> granicus.if.org Git - clang/commitdiff
r149474 went a bit too far when combined with type caching. If we want
authorEric Christopher <echristo@apple.com>
Wed, 1 Feb 2012 23:39:00 +0000 (23:39 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 1 Feb 2012 23:39:00 +0000 (23:39 +0000)
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

lib/CodeGen/CGDebugInfo.cpp

index b793eb60df6c7ff499cf66ad920f6a8d9d76d0e2..f660e3c95e25c14c7b05b457133457a09a5d6575 100644 (file)
@@ -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);