summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Metadata.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-19 22:18:29 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-19 22:18:29 +0000
commitc5a0e2e3a7551d482fdfbeb7a5eb5923ccfc09f7 (patch)
tree27d586f7c3fd7fabd94ae17a01de986877d0d45c /llvm/lib/IR/Metadata.cpp
parent422e5c7accc42e07104678f63a85a4a65bce5285 (diff)
downloadbcm5719-llvm-c5a0e2e3a7551d482fdfbeb7a5eb5923ccfc09f7.tar.gz
bcm5719-llvm-c5a0e2e3a7551d482fdfbeb7a5eb5923ccfc09f7.zip
IR: Split out countUnresolvedOperands(), NFC
llvm-svn: 226508
Diffstat (limited to 'llvm/lib/IR/Metadata.cpp')
-rw-r--r--llvm/lib/IR/Metadata.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 01394137e8e..0e258623368 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -421,10 +421,7 @@ UniquableMDNode::UniquableMDNode(LLVMContext &C, unsigned ID,
return;
// Check whether any operands are unresolved, requiring re-uniquing.
- unsigned NumUnresolved = 0;
- for (const auto &Op : operands())
- NumUnresolved += unsigned(isOperandUnresolved(Op));
-
+ unsigned NumUnresolved = countUnresolvedOperands();
if (!NumUnresolved)
return;
@@ -432,6 +429,13 @@ UniquableMDNode::UniquableMDNode(LLVMContext &C, unsigned ID,
SubclassData32 = NumUnresolved;
}
+unsigned UniquableMDNode::countUnresolvedOperands() const {
+ unsigned NumUnresolved = 0;
+ for (const auto &Op : operands())
+ NumUnresolved += unsigned(isOperandUnresolved(Op));
+ return NumUnresolved;
+}
+
void UniquableMDNode::resolve() {
assert(isUniqued() && "Expected this to be uniqued");
assert(!isResolved() && "Expected this to be unresolved");
OpenPOWER on IntegriCloud