Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Public Types |Public Member Functions |Static Public Member Functions |Static Public Attributes |List of all members
llvm::AAUndefinedBehavior Struct Referenceabstract

An abstract attribute for undefined behavior.More...

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

Inheritance diagram for llvm::AAUndefinedBehavior:
Inheritance graph
[legend]

Public Types

using Base =StateWrapper<BooleanState,AbstractAttribute >
 
- Public Types inherited fromllvm::StateWrapper< BooleanState, AbstractAttribute >
using StateType =BooleanState
 Provide static access to the type of the state.
 
- Public Types inherited fromllvm::AbstractAttribute
using StateType =AbstractState
 
- Public Types inherited fromllvm::IRPosition
enum  Kind : char {
  IRP_INVALID,IRP_FLOAT,IRP_RETURNED,IRP_CALL_SITE_RETURNED,
  IRP_FUNCTION,IRP_CALL_SITE,IRP_ARGUMENT,IRP_CALL_SITE_ARGUMENT
}
 The positions we distinguish in the IR.More...
 
using CallBaseContext =CallBase
 
- Public Types inherited fromllvm::AADepGraphNode
using DepTy =PointerIntPair<AADepGraphNode *, 1 >
 
using DepSetTy =SmallSetVector<DepTy, 2 >
 
using iterator =mapped_iterator<DepSetTy::iterator, decltype(&DepGetVal)>
 
using aaiterator =mapped_iterator<DepSetTy::iterator, decltype(&DepGetValAA)>
 
- Public Types inherited fromllvm::BooleanState
using super =IntegerStateBase<bool,true, false >
 
using base_t =IntegerStateBase::base_t
 
- Public Types inherited fromllvm::IntegerStateBase< bool, true, false >
using base_t =bool
 

Public Member Functions

 AAUndefinedBehavior (constIRPosition &IRP,Attributor &A)
 
bool isAssumedToCauseUB ()const
 Return true if "undefined behavior" is assumed.
 
virtualbool isAssumedToCauseUB (Instruction *I)const =0
 Return true if "undefined behavior" is assumed for a specific instruction.
 
bool isKnownToCauseUB ()const
 Return true if "undefined behavior" is known.
 
virtualbool isKnownToCauseUB (Instruction *I)const =0
 Return true if "undefined behavior" is known for a specific instruction.
 
const std::string getName ()const override
 SeeAbstractAttribute::getName()
 
constchargetIdAddr ()const override
 SeeAbstractAttribute::getIdAddr()
 
- Public Member Functions inherited fromllvm::StateWrapper< BooleanState, AbstractAttribute >
 StateWrapper (constIRPosition &IRP, Ts... Args)
 
StateTypegetState () override
 See AbstractAttribute::getState(...).
 
constStateTypegetState ()const override
 See AbstractAttribute::getState(...).
 
- Public Member Functions inherited fromllvm::AbstractAttribute
 AbstractAttribute (constIRPosition &IRP)
 
virtual ~AbstractAttribute ()=default
 Virtual destructor.
 
virtual void initialize (Attributor &A)
 Initialize the state with the information in theAttributorA.
 
virtualbool isQueryAA ()const
 A queryAA is always scheduled as long as we do updates because it does lazy computation that cannot be determined to be done from the outside.
 
virtualStateTypegetState ()=0
 Return the internal abstract state for inspection.
 
virtualconstStateTypegetState ()const =0
 
constIRPositiongetIRPosition ()const
 Return an IR position, see structIRPosition.
 
IRPositiongetIRPosition ()
 
void print (raw_ostream &OS)const
 Helper functions, for debug purposes only.
 
void print (Attributor *,raw_ostream &OS)const override
 
virtual void printWithDeps (raw_ostream &OS)const
 
void dump ()const
 
virtualconst std::string getAsStr (Attributor *A)const =0
 This function should return the "summarized" assumed state as string.
 
virtualconst std::string getName ()const =0
 This function should return the name of theAbstractAttribute.
 
virtualconstchargetIdAddr ()const =0
 This function should return the address of the ID of theAbstractAttribute.
 
- Public Member Functions inherited fromllvm::IRPosition
 IRPosition ()
 Default constructor available to create invalid positions implicitly.
 
bool operator== (constIRPosition &RHS)const
 
bool operator!= (constIRPosition &RHS)const
 
ValuegetAnchorValue ()const
 Return the value this abstract attribute is anchored with.
 
FunctiongetAssociatedFunction ()const
 Return the associated function, if any.
 
ArgumentgetAssociatedArgument ()const
 Return the associated argument, if any.
 
bool isFnInterfaceKind ()const
 Return true if the position refers to a function interface, that is the function scope, the function return, or an argument.
 
bool isFunctionScope ()const
 Return true if this is a function or call site position.
 
FunctiongetAnchorScope ()const
 Return theFunction surrounding the anchor value.
 
InstructiongetCtxI ()const
 Return the context instruction, if any.
 
ValuegetAssociatedValue ()const
 Return the value this abstract attribute is associated with.
 
TypegetAssociatedType ()const
 Return the type this abstract attribute is associated with.
 
int getCalleeArgNo ()const
 Return the callee argument number of the associated value if it is an argument or call site argument, otherwise a negative value.
 
int getCallSiteArgNo ()const
 Return the call site argument number of the associated value if it is an argument or call site argument, otherwise a negative value.
 
unsigned getAttrIdx ()const
 Return the index in the attribute list for this position.
 
ValuegetAttrListAnchor ()const
 Return the value attributes are attached to.
 
AttributeList getAttrList ()const
 Return the attributes associated with this function or call site scope.
 
void setAttrList (constAttributeList &AttrList)const
 Update the attributes associated with this function or call site scope.
 
unsigned getNumArgs ()const
 Return the number of arguments associated with this function or call site scope.
 
ValuegetArg (unsigned ArgNo)const
 Return theargumentArgNo associated with this function or call site scope.
 
Kind getPositionKind ()const
 Return the associated position kind.
 
bool isAnyCallSitePosition ()const
 
bool isArgumentPosition ()const
 Return true if the position is an argument or call site argument.
 
IRPosition stripCallBaseContext ()const
 Return the same position without the call base context.
 
constCallBaseContextgetCallBaseContext ()const
 Get the call base context from the position.
 
bool hasCallBaseContext ()const
 Check if the position has any call base context.
 
 operator void * ()const
 }
 
- Public Member Functions inherited fromllvm::AADepGraphNode
virtual ~AADepGraphNode ()=default
 
aaiterator begin ()
 
aaiterator end ()
 
iterator child_begin ()
 
iterator child_end ()
 
void print (raw_ostream &OS)const
 
virtual void print (Attributor *,raw_ostream &OS)const
 
DepSetTygetDeps ()
 
- Public Member Functions inherited fromllvm::BooleanState
 BooleanState ()=default
 
 BooleanState (base_tAssumed)
 
void setAssumed (boolValue)
 Set the assumed value toValue but never below the known one.
 
void setKnown (boolValue)
 Set the known and asssumed value toValue.
 
bool isAssumed ()const
 Return true if the state is assumed to hold.
 
bool isKnown ()const
 Return true if the state is known to hold.
 
- Public Member Functions inherited fromllvm::IntegerStateBase< bool, true, false >
 IntegerStateBase ()=default
 
 IntegerStateBase (base_t Assumed)
 
bool isValidState ()const override
 SeeAbstractState::isValidState() NOTE: For now we simply pretend that the worst possible state is invalid.
 
bool isAtFixpoint ()const override
 SeeAbstractState::isAtFixpoint()
 
ChangeStatus indicateOptimisticFixpoint () override
 See AbstractState::indicateOptimisticFixpoint(...)
 
ChangeStatus indicatePessimisticFixpoint () override
 See AbstractState::indicatePessimisticFixpoint(...)
 
base_t getKnown ()const
 Return the known state encoding.
 
base_t getAssumed ()const
 Return the assumed state encoding.
 
bool operator== (constIntegerStateBase<base_t, BestState, WorstState > &R)const
 Equality forIntegerStateBase.
 
bool operator!= (constIntegerStateBase<base_t, BestState, WorstState > &R)const
 Inequality forIntegerStateBase.
 
void operator^= (constIntegerStateBase<base_t, BestState, WorstState > &R)
 "Clamp" this state withR.
 
void operator+= (constIntegerStateBase<base_t, BestState, WorstState > &R)
 "Clamp" this state withR.
 
void operator|= (constIntegerStateBase<base_t, BestState, WorstState > &R)
 
void operator&= (constIntegerStateBase<base_t, BestState, WorstState > &R)
 
- Public Member Functions inherited fromllvm::AbstractState
virtual ~AbstractState ()=default
 
virtualbool isValidState ()const =0
 Return if this abstract state is in a valid state.
 
virtualbool 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.
 
virtualChangeStatus indicateOptimisticFixpoint ()=0
 Indicate that the abstract state should converge to the optimistic state.
 
virtualChangeStatus indicatePessimisticFixpoint ()=0
 Indicate that the abstract state should converge to the pessimistic state.
 

Static Public Member Functions

staticAAUndefinedBehaviorcreateForPosition (constIRPosition &IRP,Attributor &A)
 Create an abstract attribute view for the positionIRP.
 
staticbool classof (constAbstractAttribute *AA)
 This function should return true if the type of theAA is AAUndefineBehavior.
 
- Static Public Member Functions inherited fromllvm::AbstractAttribute
staticbool classof (constAADepGraphNode *DGN)
 This function is used to identify if anDGN is of typeAbstractAttribute so that the dyn_cast and cast can use such information to cast anAADepGraphNode to anAbstractAttribute.
 
staticbool hasTrivialInitializer ()
 Return false if thisAA does anything non-trivial (hence not done by default) in its initializer.
 
staticbool requiresCalleeForCallBase ()
 Return true if thisAA requires a "callee" (or an associted function) for a call site positon.
 
staticbool requiresNonAsmForCallBase ()
 Return true if thisAA requires non-asm "callee" for a call site positon.
 
staticbool requiresCallersForArgOrFunction ()
 Return true if thisAA requires all callees for an argument or function positon.
 
staticbool isValidIRPositionForInit (Attributor &A,constIRPosition &IRP)
 Return false if anAA should not be created forIRP.
 
staticbool isValidIRPositionForUpdate (Attributor &A,constIRPosition &IRP)
 Return false if anAA should not be updated forIRP.
 
- Static Public Member Functions inherited fromllvm::IRPosition
staticconstIRPosition value (constValue &V,constCallBaseContext *CBContext=nullptr)
 Create a position describing the value ofV.
 
staticconstIRPosition inst (constInstruction &I,constCallBaseContext *CBContext=nullptr)
 Create a position describing the instructionI.
 
staticconstIRPosition function (constFunction &F,constCallBaseContext *CBContext=nullptr)
 Create a position describing the function scope ofF.
 
staticconstIRPosition returned (constFunction &F,constCallBaseContext *CBContext=nullptr)
 Create a position describing the returned value ofF.
 
staticconstIRPosition argument (constArgument &Arg,constCallBaseContext *CBContext=nullptr)
 Create a position describing the argumentArg.
 
staticconstIRPosition callsite_function (constCallBase &CB)
 Create a position describing the function scope ofCB.
 
staticconstIRPosition callsite_returned (constCallBase &CB)
 Create a position describing the returned value ofCB.
 
staticconstIRPosition callsite_argument (constCallBase &CB,unsigned ArgNo)
 Create a position describing the argument ofCB at positionArgNo.
 
staticconstIRPosition callsite_argument (AbstractCallSite ACS,unsigned ArgNo)
 Create a position describing the argument ofACS at positionArgNo.
 
staticconstIRPosition function_scope (constIRPosition &IRP,constCallBaseContext *CBContext=nullptr)
 Create a position with function scope matching the "context" ofIRP.
 
- Static Public Member Functions inherited fromllvm::IntegerStateBase< bool, true, false >
static constexprbase_t getBestState ()
 Return the best possible representable state.
 
static constexprbase_t getBestState (constIntegerStateBase &)
 
static constexprbase_t getWorstState ()
 Return the worst possible representable state.
 
static constexprbase_t getWorstState (constIntegerStateBase &)
 

Static Public Attributes

staticconstchar ID = 0
 Unique ID (due to the unique address)
 
- Static Public Attributes inherited fromllvm::AbstractAttribute
static constexprAttribute::AttrKind IRAttributeKind =Attribute::None
 Compile time access to the IR attribute kind.
 
- Static Public Attributes inherited fromllvm::IRPosition
staticconstIRPosition EmptyKey
 SpecialDenseMap key values.
 
staticconstIRPosition TombstoneKey
 

Additional Inherited Members

- Protected Member Functions inherited fromllvm::AbstractAttribute
ChangeStatus update (Attributor &A)
 Hook for theAttributor to trigger an update of the internal state.
 
virtualChangeStatus manifest (Attributor &A)
 Hook for theAttributor to trigger the manifestation of the information represented by the abstract attribute in the LLVM-IR.
 
virtual void trackStatistics ()const =0
 Hook to enable custom statistic tracking, called after manifest that resulted in a change if statistics are enabled.
 
virtualChangeStatus updateImpl (Attributor &A)=0
 The actual update/transfer function which has to be implemented by the derived classes.
 
- Protected Member Functions inherited fromllvm::AADepGraphNode
 operator AbstractAttribute * ()
 
- Protected Member Functions inherited fromllvm::IntegerStateBase< bool, true, false >
virtual void handleNewAssumedValue (base_tValue)=0
 Handle a new assumed valueValue. Subtype dependent.
 
virtual void handleNewKnownValue (base_tValue)=0
 Handle a new known valueValue. Subtype dependent.
 
virtual void joinOR (base_t AssumedValue,base_t KnownValue)=0
 Handle a valueValue. Subtype dependent.
 
virtual void joinAND (base_t AssumedValue,base_t KnownValue)=0
 Handle a new assumed valueValue. Subtype dependent.
 
- Static Protected Member Functions inherited fromllvm::AADepGraphNode
staticAADepGraphNodeDepGetVal (constDepTy &DT)
 
staticAbstractAttributeDepGetValAA (constDepTy &DT)
 
- Protected Attributes inherited fromllvm::AADepGraphNode
DepSetTy Deps
 Set of dependency graph nodes which should be updated if this one is updated.
 
- Protected Attributes inherited fromllvm::IntegerStateBase< bool, true, false >
base_t Known
 The known state encoding in an integer of type base_t.
 
base_t Assumed
 The assumed state encoding in an integer of type base_t.
 

Detailed Description

An abstract attribute for undefined behavior.

Definition at line3786 of fileAttributor.h.

Member Typedef Documentation

◆ Base

usingllvm::AAUndefinedBehavior::Base =StateWrapper<BooleanState,AbstractAttribute>

Definition at line3788 of fileAttributor.h.

Constructor & Destructor Documentation

◆ AAUndefinedBehavior()

llvm::AAUndefinedBehavior::AAUndefinedBehavior(constIRPositionIRP,
AttributorA 
)
inline

Definition at line3789 of fileAttributor.h.

Member Function Documentation

◆ classof()

staticbool llvm::AAUndefinedBehavior::classof(constAbstractAttributeAA)
inlinestatic

This function should return true if the type of theAA is AAUndefineBehavior.

Definition at line3815 of fileAttributor.h.

Referencesllvm::AbstractAttribute::getIdAddr().

◆ createForPosition()

staticAAUndefinedBehavior & llvm::AAUndefinedBehavior::createForPosition(constIRPositionIRP,
AttributorA 
)
static

Create an abstract attribute view for the positionIRP.

◆ getIdAddr()

constchar * llvm::AAUndefinedBehavior::getIdAddr() const
inlineoverridevirtual

SeeAbstractAttribute::getIdAddr()

Implementsllvm::AbstractAttribute.

Definition at line3811 of fileAttributor.h.

ReferencesID.

◆ getName()

const std::string llvm::AAUndefinedBehavior::getName() const
inlineoverridevirtual

SeeAbstractAttribute::getName()

Implementsllvm::AbstractAttribute.

Definition at line3808 of fileAttributor.h.

◆ isAssumedToCauseUB()[1/2]

bool llvm::AAUndefinedBehavior::isAssumedToCauseUB() const
inline

Return true if "undefined behavior" is assumed.

Definition at line3792 of fileAttributor.h.

Referencesllvm::IntegerStateBase< bool, true, false >::getAssumed().

◆ isAssumedToCauseUB()[2/2]

virtualbool llvm::AAUndefinedBehavior::isAssumedToCauseUB(InstructionI) const
pure virtual

Return true if "undefined behavior" is assumed for a specific instruction.

◆ isKnownToCauseUB()[1/2]

bool llvm::AAUndefinedBehavior::isKnownToCauseUB() const
inline

Return true if "undefined behavior" is known.

Definition at line3798 of fileAttributor.h.

Referencesllvm::IntegerStateBase< bool, true, false >::getKnown().

◆ isKnownToCauseUB()[2/2]

virtualbool llvm::AAUndefinedBehavior::isKnownToCauseUB(InstructionI) const
pure virtual

Return true if "undefined behavior" is known for a specific instruction.

Member Data Documentation

◆ ID

constchar AAUndefinedBehavior::ID = 0
static

Unique ID (due to the unique address)

Definition at line3820 of fileAttributor.h.

Referenced bygetIdAddr().


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

Generated on Sun Jul 20 2025 15:07:42 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp