[llvm] r229521 - DIBuilder: add trackIfUnresolved() to all nodes that may be cyclic.
Adrian Prantl
aprantl at apple.com
Tue Feb 17 11:17:39 PST 2015
Author: adrian
Date: Tue Feb 17 13:17:39 2015
New Revision: 229521
URL: http://llvm.org/viewvc/llvm-project?rev=229521&view=rev
Log:
DIBuilder: add trackIfUnresolved() to all nodes that may be cyclic.
Tested in clang/test/CodeGenObjCCXX/debug-info-cyclic.mm
rdar://problem/19839612
Modified:
llvm/trunk/lib/IR/DIBuilder.cpp
Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=229521&r1=229520&r2=229521&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Tue Feb 17 13:17:39 2015
@@ -414,7 +414,6 @@ DIDerivedType DIBuilder::createInheritan
.get(VMContext),
nullptr, Ty.getRef(), BaseTy.getRef()};
auto R = DIDerivedType(MDNode::get(VMContext, Elts));
- trackIfUnresolved(R);
return R;
}
@@ -581,6 +580,7 @@ DICompositeType DIBuilder::createClassTy
"createClassType should return a DICompositeType");
if (!UniqueIdentifier.empty())
retainType(R);
+ trackIfUnresolved(R);
return R;
}
@@ -614,6 +614,7 @@ DICompositeType DIBuilder::createStructT
"createStructType should return a DICompositeType");
if (!UniqueIdentifier.empty())
retainType(R);
+ trackIfUnresolved(R);
return R;
}
@@ -642,6 +643,7 @@ DICompositeType DIBuilder::createUnionTy
DICompositeType R(MDNode::get(VMContext, Elts));
if (!UniqueIdentifier.empty())
retainType(R);
+ trackIfUnresolved(R);
return R;
}
@@ -688,6 +690,7 @@ DICompositeType DIBuilder::createEnumera
AllEnumTypes.push_back(CTy);
if (!UniqueIdentifier.empty())
retainType(CTy);
+ trackIfUnresolved(CTy);
return CTy;
}
@@ -709,7 +712,9 @@ DICompositeType DIBuilder::createArrayTy
Ty.getRef(), Subscripts, nullptr, nullptr,
nullptr // Type Identifer
};
- return DICompositeType(MDNode::get(VMContext, Elts));
+ DICompositeType R(MDNode::get(VMContext, Elts));
+ trackIfUnresolved(R);
+ return R;
}
DICompositeType DIBuilder::createVectorType(uint64_t Size, uint64_t AlignInBits,
@@ -730,7 +735,9 @@ DICompositeType DIBuilder::createVectorT
Ty.getRef(), Subscripts, nullptr, nullptr,
nullptr // Type Identifer
};
- return DICompositeType(MDNode::get(VMContext, Elts));
+ DICompositeType R(MDNode::get(VMContext, Elts));
+ trackIfUnresolved(R);
+ return R;
}
static HeaderBuilder setTypeFlagsInHeader(StringRef Header,
@@ -807,6 +814,7 @@ DIBuilder::createForwardDecl(unsigned Ta
"createForwardDecl result should be a DIType");
if (!UniqueIdentifier.empty())
retainType(RetTy);
+ trackIfUnresolved(RetTy);
return RetTy;
}
@@ -835,6 +843,7 @@ DICompositeType DIBuilder::createReplace
"createReplaceableForwardDecl result should be a DIType");
if (!UniqueIdentifier.empty())
retainType(RetTy);
+ trackIfUnresolved(RetTy);
return RetTy;
}
@@ -1025,6 +1034,7 @@ DISubprogram DIBuilder::createFunction(D
// do not lose this mdnode.
if (isDefinition)
AllSubprograms.push_back(Node);
+ trackIfUnresolved(Node);
return Node;
});
}
@@ -1080,6 +1090,7 @@ DISubprogram DIBuilder::createMethod(DID
AllSubprograms.push_back(Node);
DISubprogram S(Node);
assert(S.isSubprogram() && "createMethod should return a valid DISubprogram");
+ trackIfUnresolved(S);
return S;
}
More information about the llvm-commits
mailing list