forked from OSchip/llvm-project
Parallel fix to r88951: use TrackingVH to hold forward decl.
llvm-svn: 88962
This commit is contained in:
parent
544b15cbc3
commit
00dbf4c3c6
|
@ -490,6 +490,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
|
|||
if (!Decl->getDefinition(M->getContext()))
|
||||
return FwdDecl;
|
||||
|
||||
llvm::TrackingVH<llvm::MDNode> FwdDeclNode = FwdDecl.getNode();
|
||||
// Otherwise, insert it into the TypeCache so that recursive uses will find
|
||||
// it.
|
||||
TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = FwdDecl.getNode();
|
||||
|
@ -563,7 +564,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
|
|||
|
||||
// Now that we have a real decl for the struct, replace anything using the
|
||||
// old decl with the new one. This will recursively update the debug info.
|
||||
FwdDecl.replaceAllUsesWith(RealDecl);
|
||||
llvm::DIDerivedType(FwdDeclNode).replaceAllUsesWith(RealDecl);
|
||||
|
||||
return RealDecl;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue