LLVM  14.0.0git
Public Types | Public Member Functions | List of all members
llvm::BooleanState Struct Reference

Simple wrapper for a single bit (boolean) state. More...

#include "llvm/Transforms/IPO/Attributor.h"

Inheritance diagram for llvm::BooleanState:
Inheritance graph
[legend]
Collaboration diagram for llvm::BooleanState:
Collaboration graph
[legend]

Public Types

using super = IntegerStateBase< bool, 1, 0 >
 
using base_t = IntegerStateBase::base_t
 
- Public Types inherited from llvm::IntegerStateBase< bool, 1, 0 >
using base_t = bool
 

Public Member Functions

 BooleanState ()
 
 BooleanState (base_t Assumed)
 
void setAssumed (bool Value)
 Set the assumed value to Value but never below the known one. More...
 
void setKnown (bool Value)
 Set the known and asssumed value to Value. More...
 
bool isAssumed () const
 Return true if the state is assumed to hold. More...
 
bool isKnown () const
 Return true if the state is known to hold. More...
 
- Public Member Functions inherited from llvm::IntegerStateBase< bool, 1, 0 >
 IntegerStateBase ()
 
 IntegerStateBase (base_t Assumed)
 
bool isValidState () const override
 See AbstractState::isValidState() NOTE: For now we simply pretend that the worst possible state is invalid. More...
 
bool isAtFixpoint () const override
 See AbstractState::isAtFixpoint() More...
 
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(...) More...
 
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(...) More...
 
base_t getKnown () const
 Return the known state encoding. More...
 
base_t getAssumed () const
 Return the assumed state encoding. More...
 
bool operator== (const IntegerStateBase< base_t, BestState, WorstState > &R) const
 Equality for IntegerStateBase. More...
 
bool operator!= (const IntegerStateBase< base_t, BestState, WorstState > &R) const
 Inequality for IntegerStateBase. More...
 
void operator^= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 "Clamp" this state with R. More...
 
void operator+= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 "Clamp" this state with R. More...
 
void operator|= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 
void operator&= (const IntegerStateBase< base_t, BestState, WorstState > &R)
 
- Public Member Functions inherited from llvm::AbstractState
virtual ~AbstractState ()
 
virtual bool isValidState () const =0
 Return if this abstract state is in a valid state. More...
 
virtual bool isAtFixpoint () const =0
 Return if this abstract state is fixed, thus does not need to be updated if information changes as it cannot change itself. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::IntegerStateBase< bool, 1, 0 >
static constexpr base_t getBestState ()
 Return the best possible representable state. More...
 
static constexpr base_t getBestState (const IntegerStateBase &)
 
static constexpr base_t getWorstState ()
 Return the worst possible representable state. More...
 
static constexpr base_t getWorstState (const IntegerStateBase &)
 
- Protected Member Functions inherited from llvm::IntegerStateBase< bool, 1, 0 >
virtual void handleNewAssumedValue (base_t Value)=0
 Handle a new assumed value Value. Subtype dependent. More...
 
virtual void handleNewKnownValue (base_t Value)=0
 Handle a new known value Value. Subtype dependent. More...
 
virtual void joinOR (base_t AssumedValue, base_t KnownValue)=0
 Handle a value Value. Subtype dependent. More...
 
virtual void joinAND (base_t AssumedValue, base_t KnownValue)=0
 Handle a new assumed value Value. Subtype dependent. More...
 
- Protected Attributes inherited from llvm::IntegerStateBase< bool, 1, 0 >
base_t Known
 The known state encoding in an integer of type base_t. More...
 
base_t Assumed
 The assumed state encoding in an integer of type base_t. More...
 

Detailed Description

Simple wrapper for a single bit (boolean) state.

Definition at line 2356 of file Attributor.h.

Member Typedef Documentation

◆ base_t

Definition at line 2358 of file Attributor.h.

◆ super

Definition at line 2357 of file Attributor.h.

Constructor & Destructor Documentation

◆ BooleanState() [1/2]

llvm::BooleanState::BooleanState ( )
inline

Definition at line 2360 of file Attributor.h.

◆ BooleanState() [2/2]

llvm::BooleanState::BooleanState ( base_t  Assumed)
inline

Definition at line 2361 of file Attributor.h.

Member Function Documentation

◆ isAssumed()

bool llvm::BooleanState::isAssumed ( ) const
inline

Return true if the state is assumed to hold.

Definition at line 2373 of file Attributor.h.

References llvm::IntegerStateBase< bool, 1, 0 >::getAssumed().

◆ isKnown()

bool llvm::BooleanState::isKnown ( ) const
inline

Return true if the state is known to hold.

Definition at line 2376 of file Attributor.h.

References llvm::IntegerStateBase< bool, 1, 0 >::getKnown().

◆ setAssumed()

void llvm::BooleanState::setAssumed ( bool  Value)
inline

Set the assumed value to Value but never below the known one.

Definition at line 2364 of file Attributor.h.

References llvm::IntegerStateBase< bool, 1, 0 >::Assumed, and llvm::IntegerStateBase< bool, 1, 0 >::Known.

◆ setKnown()

void llvm::BooleanState::setKnown ( bool  Value)
inline

Set the known and asssumed value to Value.

Definition at line 2367 of file Attributor.h.

References llvm::IntegerStateBase< bool, 1, 0 >::Assumed, and llvm::IntegerStateBase< bool, 1, 0 >::Known.


The documentation for this struct was generated from the following file: