mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
IR: Split out countUnresolvedOperands(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226508 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b463149129
commit
0927997ce8
@ -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…
x
Reference in New Issue
Block a user