forked from OSchip/llvm-project
IR: Split out countUnresolvedOperands(), NFC
llvm-svn: 226508
This commit is contained in:
parent
422e5c7acc
commit
c5a0e2e3a7
|
@ -843,6 +843,7 @@ private:
|
|||
void resolve();
|
||||
void resolveAfterOperandChange(Metadata *Old, Metadata *New);
|
||||
void decrementUnresolvedOperandCount();
|
||||
unsigned countUnresolvedOperands() const;
|
||||
|
||||
void deleteAsSubclass();
|
||||
UniquableMDNode *uniquify();
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue