diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -3359,12 +3359,32 @@ /// force it. As for the conditions under which we force it, see /// AAPotentialValues. template > -struct PotentialValuesState : BooleanState { +struct PotentialValuesState : AbstractState { using SetTy = DenseSet; - PotentialValuesState() : BooleanState(true) {} + PotentialValuesState() : IsValidState(true) {} - PotentialValuesState(bool IsValid) : BooleanState(IsValid) {} + PotentialValuesState(bool IsValid) : IsValidState(IsValid) {} + + /// See AbstractState::isValidState(...) + bool isValidState() const { return IsValidState.isValidState(); } + + /// See AbstractState::isAtFixpoint(...) + bool isAtFixpoint() const { return IsValidState.isAtFixpoint(); } + + /// See AbstractState::indicatePessimisticFixpoint(...) + ChangeStatus indicatePessimisticFixpoint() { + return IsValidState.indicatePessimisticFixpoint(); + } + + /// See AbstractState::indicateOptimisticFixpoint(...) + ChangeStatus indicateOptimisticFixpoint() { + return IsValidState.indicateOptimisticFixpoint(); + } + + /// Return the assumed state + PotentialValuesState &getAssumed() { return *this; } + const PotentialValuesState &getAssumed() const { return *this; } /// Return this set. We should check whether this set is valid or not by /// isValidState() before calling this function. @@ -3465,6 +3485,9 @@ Set = IntersectSet; } + /// A helper state which indicate whether this state is valid or not. + BooleanState IsValidState; + /// Container for potential values SetTy Set; };