LLVM  10.0.0svn
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::MustBeExecutedContextExplorer Struct Reference

A "must be executed context" for a given program point PP is the set of instructions, potentially before and after PP, that are executed always when PP is reached. More...

#include "llvm/Analysis/MustExecute.h"

Collaboration diagram for llvm::MustBeExecutedContextExplorer:
Collaboration graph
[legend]

Public Types

using iterator = MustBeExecutedIterator
 Iterator-based interface. More...
 
using const_iterator = const MustBeExecutedIterator
 

Public Member Functions

 MustBeExecutedContextExplorer (bool ExploreInterBlock)
 In the description of the parameters we use PP to denote a program point for which the must be executed context is explored, or put differently, for which the MustBeExecutedIterator is created. More...
 
 ~MustBeExecutedContextExplorer ()
 Clean up the dynamically allocated iterators. More...
 
iteratorbegin (const Instruction *PP)
 Return an iterator to explore the context around PP. More...
 
const_iteratorbegin (const Instruction *PP) const
 Return an iterator to explore the cached context around PP. More...
 
iteratorend ()
 Return an universal end iterator. More...
 
iteratorend (const Instruction *)
 
const_iteratorend () const
 
const_iteratorend (const Instruction *) const
 
llvm::iterator_range< iteratorrange (const Instruction *PP)
 } More...
 
llvm::iterator_range< const_iteratorrange (const Instruction *PP) const
 Return an iterator range to explore the cached context around PP. More...
 
const InstructiongetMustBeExecutedNextInstruction (MustBeExecutedIterator &It, const Instruction *PP)
 } More...
 

Public Attributes

const bool ExploreInterBlock
 Parameter that limit the performed exploration. More...
 

Detailed Description

A "must be executed context" for a given program point PP is the set of instructions, potentially before and after PP, that are executed always when PP is reached.

The MustBeExecutedContextExplorer an interface to explore "must be executed contexts" in a module through the use of MustBeExecutedIterator.

The explorer exposes "must be executed iterators" that traverse the must be executed context. There is little information sharing between iterators as the expected use case involves few iterators for "far apart" instructions. If that changes, we should consider caching more intermediate results.

Definition at line 368 of file MustExecute.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 388 of file MustExecute.h.

◆ iterator

Iterator-based interface.

See also
MustBeExecutedIterator. {

Definition at line 387 of file MustExecute.h.

Constructor & Destructor Documentation

◆ MustBeExecutedContextExplorer()

llvm::MustBeExecutedContextExplorer::MustBeExecutedContextExplorer ( bool  ExploreInterBlock)
inline

In the description of the parameters we use PP to denote a program point for which the must be executed context is explored, or put differently, for which the MustBeExecutedIterator is created.

Parameters
ExploreInterBlockFlag to indicate if instructions in blocks other than the parent of PP should be explored.

Definition at line 377 of file MustExecute.h.

◆ ~MustBeExecutedContextExplorer()

llvm::MustBeExecutedContextExplorer::~MustBeExecutedContextExplorer ( )
inline

Clean up the dynamically allocated iterators.

Definition at line 381 of file MustExecute.h.

References llvm::DeleteContainerSeconds().

Member Function Documentation

◆ begin() [1/2]

iterator& llvm::MustBeExecutedContextExplorer::begin ( const Instruction PP)
inline

Return an iterator to explore the context around PP.

Definition at line 391 of file MustExecute.h.

Referenced by llvm::IRPosition::getAttrs().

◆ begin() [2/2]

const_iterator& llvm::MustBeExecutedContextExplorer::begin ( const Instruction PP) const
inline

Return an iterator to explore the cached context around PP.

Definition at line 399 of file MustExecute.h.

◆ end() [1/4]

iterator& llvm::MustBeExecutedContextExplorer::end ( )
inline

Return an universal end iterator.

{

Definition at line 405 of file MustExecute.h.

Referenced by llvm::IRPosition::getAttrs().

◆ end() [2/4]

iterator& llvm::MustBeExecutedContextExplorer::end ( const Instruction )
inline

Definition at line 406 of file MustExecute.h.

◆ end() [3/4]

const_iterator& llvm::MustBeExecutedContextExplorer::end ( ) const
inline

Definition at line 408 of file MustExecute.h.

◆ end() [4/4]

const_iterator& llvm::MustBeExecutedContextExplorer::end ( const Instruction ) const
inline

Definition at line 409 of file MustExecute.h.

◆ getMustBeExecutedNextInstruction()

const Instruction * MustBeExecutedContextExplorer::getMustBeExecutedNextInstruction ( MustBeExecutedIterator It,
const Instruction PP 
)

}

Return the next instruction that is guaranteed to be executed after PP.

Parameters
ItThe iterator that is used to traverse the must be executed context.
PPThe program point for which the next instruction that is guaranteed to execute is determined.

Definition at line 447 of file MustExecute.cpp.

References assert(), llvm::dbgs(), llvm::BasicBlock::front(), getMustBeExecutedNextInstruction(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::Instruction::getNumSuccessors(), llvm::Instruction::getSuccessor(), I, llvm::isGuaranteedToTransferExecutionToSuccessor(), llvm::Instruction::isTerminator(), LLVM_DEBUG, and llvm::MustBeExecutedIterator::MustBeExecutedIterator().

Referenced by getMustBeExecutedNextInstruction().

◆ range() [1/2]

llvm::iterator_range<iterator> llvm::MustBeExecutedContextExplorer::range ( const Instruction PP)
inline

}

Return an iterator range to explore the context around PP.

Definition at line 413 of file MustExecute.h.

References llvm::sys::path::begin(), llvm::sys::path::end(), and llvm::make_range().

Referenced by llvm::createMustBeExecutedContextPrinter().

◆ range() [2/2]

llvm::iterator_range<const_iterator> llvm::MustBeExecutedContextExplorer::range ( const Instruction PP) const
inline

Return an iterator range to explore the cached context around PP.

Definition at line 418 of file MustExecute.h.

References llvm::sys::path::begin(), llvm::sys::path::end(), and llvm::make_range().

Member Data Documentation

◆ ExploreInterBlock

const bool llvm::MustBeExecutedContextExplorer::ExploreInterBlock

Parameter that limit the performed exploration.

See the constructor for their meaning. {

Definition at line 436 of file MustExecute.h.


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