From 9b1c6d34e513c27c51e06cec024f106736aa4398 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 19 Jan 2015 19:09:14 +0000 Subject: [PATCH] IR: Simplify DIBuilder::trackIfUnresolved(), NFC llvm-svn: 226487 --- llvm/lib/IR/DIBuilder.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index d76fcc5..2de109b 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -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() { -- 2.7.4