[llvm] r226508 - IR: Split out countUnresolvedOperands(), NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Jan 19 14:18:29 PST 2015
Author: dexonsmith
Date: Mon Jan 19 16:18:29 2015
New Revision: 226508
URL: http://llvm.org/viewvc/llvm-project?rev=226508&view=rev
Log:
IR: Split out countUnresolvedOperands(), NFC
Modified:
llvm/trunk/include/llvm/IR/Metadata.h
llvm/trunk/lib/IR/Metadata.cpp
Modified: llvm/trunk/include/llvm/IR/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=226508&r1=226507&r2=226508&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Metadata.h (original)
+++ llvm/trunk/include/llvm/IR/Metadata.h Mon Jan 19 16:18:29 2015
@@ -843,6 +843,7 @@ private:
void resolve();
void resolveAfterOperandChange(Metadata *Old, Metadata *New);
void decrementUnresolvedOperandCount();
+ unsigned countUnresolvedOperands() const;
void deleteAsSubclass();
UniquableMDNode *uniquify();
Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=226508&r1=226507&r2=226508&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Mon Jan 19 16:18:29 2015
@@ -421,10 +421,7 @@ UniquableMDNode::UniquableMDNode(LLVMCon
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(LLVMCon
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");
More information about the llvm-commits
mailing list