diff options
author | Eric Christopher <echristo@apple.com> | 2012-02-20 18:05:24 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-02-20 18:05:24 +0000 |
commit | 86211df4d28f6fb3c48ab09f02a011e8570d8b1c (patch) | |
tree | ee5de01927a3f0e3c468176fd6c1c0836ce65390 /lib/CodeGen/CGDebugInfo.cpp | |
parent | 917bc8d55e9c172b5985a7cc57ccf02d8439464f (diff) |
Remove the type retaining from the clang frontend. This is now
handled by the caching and rauw. Also fix one cache that wasn't
being added to highlighted by this patch. Update all testcases
accordingly.
This should fix the deall failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 428bfb4740..1771abf9b2 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -551,7 +551,9 @@ llvm::DIType CGDebugInfo::CreatePointeeType(QualType PointeeTy, RecordDecl *RD = RTy->getDecl(); llvm::DIDescriptor FDContext = getContextDescriptor(cast<Decl>(RD->getDeclContext())); - return createRecordFwdDecl(RD, FDContext); + llvm::DIType RetTy = createRecordFwdDecl(RD, FDContext); + TypeCache[QualType(RTy, 0).getAsOpaquePtr()] = RetTy; + return RetTy; } return getOrCreateType(PointeeTy, Unit); @@ -1118,7 +1120,6 @@ CollectVTableInfo(const CXXRecordDecl *RD, llvm::DIFile Unit, llvm::DIType CGDebugInfo::getOrCreateRecordType(QualType RTy, SourceLocation Loc) { llvm::DIType T = getOrCreateType(RTy, getOrCreateFile(Loc)); - DBuilder.retainType(T); return T; } @@ -1767,7 +1768,7 @@ llvm::DIType CGDebugInfo::CreateLimitedType(const RecordType *Ty) { // than C++ class type, but needs llvm metadata changes first. RealDecl = DBuilder.createClassType(RDContext, RDName, DefUnit, Line, Size, Align, 0, 0, llvm::DIType(), - llvm::DIArray(), NULL, + llvm::DIArray(), llvm::DIType(), llvm::DIArray()); } else RealDecl = DBuilder.createStructType(RDContext, RDName, DefUnit, Line, @@ -2577,8 +2578,9 @@ void CGDebugInfo::finalize(void) { RepTy = llvm::DIType(cast<llvm::MDNode>(it->second)); } - if (Ty.Verify() && RepTy.Verify()) + if (Ty.Verify() && Ty.isForwardDecl() && RepTy.Verify()) { Ty.replaceAllUsesWith(RepTy); + } } DBuilder.finalize(); } |