[llvm] r226487 - IR: Simplify DIBuilder::trackIfUnresolved(), NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Jan 19 11:09:14 PST 2015
Author: dexonsmith
Date: Mon Jan 19 13:09:14 2015
New Revision: 226487
URL: http://llvm.org/viewvc/llvm-project?rev=226487&view=rev
Log:
IR: Simplify DIBuilder::trackIfUnresolved(), NFC
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=226487&r1=226486&r2=226487&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Mon Jan 19 13:09:14 2015
@@ -54,16 +54,14 @@ DIBuilder::DIBuilder(Module &m, bool All
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 (N->isResolved())
return;
- }
- if (isUnresolved(N))
- UnresolvedNodes.emplace_back(N);
- return;
+
+ assert(AllowUnresolvedNodes && "Cannot handle unresolved nodes");
+ UnresolvedNodes.emplace_back(N);
}
void DIBuilder::finalize() {
More information about the llvm-commits
mailing list