/// getLatticeState - Return the LatticeVal object that corresponds to the
/// value. If an value is not in the map, it is returned as untracked,
- /// unlike the getOrInitValueState method.
+ /// unlike the getValueState method.
LatticeVal getLatticeState(Value *V) const {
auto I = ValueState.find(V);
return I != ValueState.end() ? I->second : LatticeFunc->getUntrackedVal();
}
- /// getOrInitValueState - Return the LatticeVal object that corresponds to the
+ /// getValueState - Return the LatticeVal object that corresponds to the
/// value, initializing the value's state if it hasn't been entered into the
/// map yet. This function is necessary because not all values should start
/// out in the underdefined state... Arguments should be overdefined, and
/// constants should be marked as constants.
- LatticeVal getOrInitValueState(Value *V);
+ LatticeVal getValueState(Value *V);
/// isEdgeFeasible - Return true if the control flow edge from the 'From'
/// basic block to the 'To' basic block is currently feasible. If
// SparseSolver Implementation
//===----------------------------------------------------------------------===//
-/// getOrInitValueState - Return the LatticeVal object that corresponds to the
+/// getValueState - Return the LatticeVal object that corresponds to the
/// value, initializing the value's state if it hasn't been entered into the
/// map yet. This function is necessary because not all values should start
/// out in the underdefined state... Arguments should be overdefined, and
/// constants should be marked as constants.
template <class LatticeVal>
-LatticeVal SparseSolver<LatticeVal>::getOrInitValueState(Value *V) {
+LatticeVal SparseSolver<LatticeVal>::getValueState(Value *V) {
auto I = ValueState.find(V);
if (I != ValueState.end()) return I->second; // Common case, in the map
LatticeVal BCValue;
if (AggressiveUndef)
- BCValue = getOrInitValueState(BI->getCondition());
+ BCValue = getValueState(BI->getCondition());
else
BCValue = getLatticeState(BI->getCondition());
SwitchInst &SI = cast<SwitchInst>(TI);
LatticeVal SCValue;
if (AggressiveUndef)
- SCValue = getOrInitValueState(SI.getCondition());
+ SCValue = getValueState(SI.getCondition());
else
SCValue = getLatticeState(SI.getCondition());
return;
}
- LatticeVal PNIV = getOrInitValueState(&PN);
+ LatticeVal PNIV = getValueState(&PN);
LatticeVal Overdefined = LatticeFunc->getOverdefinedVal();
// If this value is already overdefined (common) just return.
continue;
// Merge in this value.
- LatticeVal OpVal = getOrInitValueState(PN.getIncomingValue(i));
+ LatticeVal OpVal = getValueState(PN.getIncomingValue(i));
if (OpVal != PNIV)
PNIV = LatticeFunc->MergeValues(PNIV, OpVal);