forked from OSchip/llvm-project
[LVI] Extract addValueHandle() method (NFC)
There will be more places registering value handles.
This commit is contained in:
parent
64ecf85f63
commit
d3d4e4bcb7
|
@ -183,6 +183,12 @@ namespace {
|
|||
return It->second.get();
|
||||
}
|
||||
|
||||
void addValueHandle(Value *Val) {
|
||||
auto HandleIt = ValueHandles.find_as(Val);
|
||||
if (HandleIt == ValueHandles.end())
|
||||
ValueHandles.insert({ Val, this });
|
||||
}
|
||||
|
||||
public:
|
||||
void insertResult(Value *Val, BasicBlock *BB,
|
||||
const ValueLatticeElement &Result) {
|
||||
|
@ -195,9 +201,7 @@ namespace {
|
|||
else
|
||||
Entry->LatticeElements.insert({ Val, Result });
|
||||
|
||||
auto HandleIt = ValueHandles.find_as(Val);
|
||||
if (HandleIt == ValueHandles.end())
|
||||
ValueHandles.insert({ Val, this });
|
||||
addValueHandle(Val);
|
||||
}
|
||||
|
||||
Optional<ValueLatticeElement> getCachedValueInfo(Value *V,
|
||||
|
|
Loading…
Reference in New Issue