1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

IR: Simplify DIBuilder::trackIfUnresolved(), NFC

llvm-svn: 226487
This commit is contained in:
Duncan P. N. Exon Smith 2015-01-19 19:09:14 +00:00
parent f860907b8f
commit 19ec652214

View File

@ -54,16 +54,14 @@ DIBuilder::DIBuilder(Module &m, bool AllowUnresolvedNodes)
DeclareFn(nullptr), ValueFn(nullptr),
AllowUnresolvedNodes(AllowUnresolvedNodes) {}
static bool isUnresolved(MDNode *N) { return N && !N->isResolved(); }
void DIBuilder::trackIfUnresolved(MDNode *N) {
if (!AllowUnresolvedNodes) {
assert(!isUnresolved(N) && "Cannot handle unresolved nodes");
if (!N)
return;
}
if (isUnresolved(N))
UnresolvedNodes.emplace_back(N);
return;
if (N->isResolved())
return;
assert(AllowUnresolvedNodes && "Cannot handle unresolved nodes");
UnresolvedNodes.emplace_back(N);
}
void DIBuilder::finalize() {