systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
systemc_clang::SplitCFGBlock Class Reference

#include <SplitCFGBlock.h>

Classes

struct  SuccessorIterator
 

Public Types

using VectorCFGElementPtr = llvm::SmallVector<const clang::CFGElement *>
 
using VectorCFGElementPtrImpl
 
using VectorSplitCFGBlockPtr = llvm::SmallVector<const SplitCFGBlock *>
 
using VectorSplitCFGBlockPtrImpl = llvm::SmallVector<const SplitCFGBlock *>
 
using succ_iterator = SuccessorIterator
 
using const_succ_iterator = SuccessorIterator::const_iterator
 
using succ_iterator_range = llvm::iterator_range<succ_iterator>
 
using const_succ_iterator_range = llvm::iterator_range<const_succ_iterator>
 

Public Member Functions

bool succ_empty () const
 
SuccessorIterator::const_iterator succ_begin () const
 
SuccessorIterator::const_iterator succ_end () const
 
const_succ_iterator_range const_succs ()
 
 SplitCFGBlock ()
 Constructor.
 
 SplitCFGBlock (const SplitCFGBlock &from)
 Copy constructor.
 
const clang::CFGBlock * getCFGBlock () const
 Returns the pointer to the original CFGBlock from which the SplitCFGBlock was created.
 
std::size_t getNumOfElements () const
 Returns the number of CFGElements in this block.
 
const VectorCFGElementPtrImplgetElements () const
 Returns the elements in this block.
 
const VectorSplitCFGBlockPtrImplgetSuccessors () const
 Returns the successors for the block.
 
const VectorSplitCFGBlockPtrImplgetPredecessors () const
 Returns the predecessors for the block.
 
bool hasWait () const
 Returns whether the SplitCFGBlock is a wait block or not.
 
bool isConditional () const
 Return whether the SplitCFGBlock is an IF CFGBlock.
 
bool isLoopWithTwoSuccessors () const
 Return whether the SplitCFGBlock is a loop CFGBlock with two succesors.
 
bool hasTerminatorBreak () const
 Return whether the terminator for this block has a break statement in it.
 
bool hasTerminatorWait () const
 Return whether the terminator for this block has a wait statement in it.
 
unsigned int getBlockID () const
 Returns the block ID for the SplitCFGBlock.
 
unsigned int getNextState () const
 Returns the next state. Only pertinent for blocks that have waits in them.
 
llvm::APInt getWaitArg () const
 Returns the integer value of the argument supplied to the wait().
 
void insertElements (VectorCFGElementPtr &elements)
 The elements are added to this SplitCFGBlock.
 
void identifyBreaks (clang::ASTContext &context)
 Identify if the terminator of a CFGBlock has a break in it.
 
void dump () const
 
void dumpColored () const
 

Private Member Functions

void setNextState (unsigned int state)
 

Private Attributes

const clang::CFGBlock * block_
 A pointer to the original CFGBlock.
 
bool has_wait_
 
bool is_conditional_
 
bool is_loop_with_two_succ_
 
bool terminator_has_break_
 The terminator has break.
 
bool terminator_has_wait_
 The terminator has break.
 
unsigned int id_
 The block id.
 
unsigned int next_state_
 The next state that the wait would transform to.
 
llvm::APInt wait_arg_
 The wait argument.
 
llvm::SmallVector< unsigned int > wait_element_ids_
 
VectorCFGElementPtr elements_
 CFG Elements.
 
llvm::SmallVector< const SplitCFGBlock * > predecessors_
 Predecessors and successors.
 
llvm::SmallVector< const SplitCFGBlock * > successors_
 

Friends

class SplitCFG
 

Detailed Description

This class represents information that is stored to split a single CFGBlock into elements that are wait() calls versus others.

Definition at line 79 of file SplitCFGBlock.h.

Member Typedef Documentation

◆ const_succ_iterator

Definition at line 147 of file SplitCFGBlock.h.

◆ const_succ_iterator_range

Definition at line 149 of file SplitCFGBlock.h.

◆ succ_iterator

Definition at line 146 of file SplitCFGBlock.h.

◆ succ_iterator_range

Definition at line 148 of file SplitCFGBlock.h.

◆ VectorCFGElementPtr

using systemc_clang::SplitCFGBlock::VectorCFGElementPtr = llvm::SmallVector<const clang::CFGElement *>

Definition at line 81 of file SplitCFGBlock.h.

◆ VectorCFGElementPtrImpl

Initial value:
llvm::SmallVectorImpl<const clang::CFGElement *>

Definition at line 82 of file SplitCFGBlock.h.

◆ VectorSplitCFGBlockPtr

Definition at line 84 of file SplitCFGBlock.h.

◆ VectorSplitCFGBlockPtrImpl

Definition at line 85 of file SplitCFGBlock.h.

Constructor & Destructor Documentation

◆ SplitCFGBlock() [1/2]

SplitCFGBlock::SplitCFGBlock ( )

Constructor.

Definition at line 7 of file SplitCFGBlock.cpp.

◆ SplitCFGBlock() [2/2]

SplitCFGBlock::SplitCFGBlock ( const SplitCFGBlock & from)

Copy constructor.

Definition at line 18 of file SplitCFGBlock.cpp.

Member Function Documentation

◆ const_succs()

const_succ_iterator_range systemc_clang::SplitCFGBlock::const_succs ( )
inline

Definition at line 160 of file SplitCFGBlock.h.

◆ dump()

void SplitCFGBlock::dump ( ) const

Print the terminator.

Definition at line 88 of file SplitCFGBlock.cpp.

◆ dumpColored()

void SplitCFGBlock::dumpColored ( ) const

Definition at line 127 of file SplitCFGBlock.cpp.

◆ getBlockID()

unsigned int SplitCFGBlock::getBlockID ( ) const

Returns the block ID for the SplitCFGBlock.

Definition at line 69 of file SplitCFGBlock.cpp.

◆ getCFGBlock()

const clang::CFGBlock * SplitCFGBlock::getCFGBlock ( ) const

Returns the pointer to the original CFGBlock from which the SplitCFGBlock was created.

Definition at line 45 of file SplitCFGBlock.cpp.

◆ getElements()

const SplitCFGBlock::VectorCFGElementPtrImpl & SplitCFGBlock::getElements ( ) const

Returns the elements in this block.

Definition at line 47 of file SplitCFGBlock.cpp.

◆ getNextState()

unsigned int SplitCFGBlock::getNextState ( ) const

Returns the next state. Only pertinent for blocks that have waits in them.

Definition at line 71 of file SplitCFGBlock.cpp.

◆ getNumOfElements()

std::size_t SplitCFGBlock::getNumOfElements ( ) const

Returns the number of CFGElements in this block.

Definition at line 63 of file SplitCFGBlock.cpp.

◆ getPredecessors()

const SplitCFGBlock::VectorSplitCFGBlockPtrImpl & SplitCFGBlock::getPredecessors ( ) const

Returns the predecessors for the block.

Definition at line 57 of file SplitCFGBlock.cpp.

◆ getSuccessors()

const SplitCFGBlock::VectorSplitCFGBlockPtrImpl & SplitCFGBlock::getSuccessors ( ) const

Returns the successors for the block.

Definition at line 52 of file SplitCFGBlock.cpp.

◆ getWaitArg()

llvm::APInt SplitCFGBlock::getWaitArg ( ) const

Returns the integer value of the argument supplied to the wait().

Definition at line 73 of file SplitCFGBlock.cpp.

◆ hasTerminatorBreak()

bool SplitCFGBlock::hasTerminatorBreak ( ) const

Return whether the terminator for this block has a break statement in it.

Definition at line 39 of file SplitCFGBlock.cpp.

◆ hasTerminatorWait()

bool SplitCFGBlock::hasTerminatorWait ( ) const

Return whether the terminator for this block has a wait statement in it.

Definition at line 41 of file SplitCFGBlock.cpp.

◆ hasWait()

bool SplitCFGBlock::hasWait ( ) const

Returns whether the SplitCFGBlock is a wait block or not.

Definition at line 61 of file SplitCFGBlock.cpp.

◆ identifyBreaks()

void SplitCFGBlock::identifyBreaks ( clang::ASTContext & context)

Identify if the terminator of a CFGBlock has a break in it.

See if we can iterate through all the terminator code.

Definition at line 75 of file SplitCFGBlock.cpp.

◆ insertElements()

void SplitCFGBlock::insertElements ( VectorCFGElementPtr & elements)

The elements are added to this SplitCFGBlock.

Definition at line 65 of file SplitCFGBlock.cpp.

◆ isConditional()

bool SplitCFGBlock::isConditional ( ) const

Return whether the SplitCFGBlock is an IF CFGBlock.

Definition at line 37 of file SplitCFGBlock.cpp.

◆ isLoopWithTwoSuccessors()

bool SplitCFGBlock::isLoopWithTwoSuccessors ( ) const

Return whether the SplitCFGBlock is a loop CFGBlock with two succesors.

Definition at line 33 of file SplitCFGBlock.cpp.

◆ setNextState()

void SplitCFGBlock::setNextState ( unsigned int state)
private

Definition at line 43 of file SplitCFGBlock.cpp.

◆ succ_begin()

SuccessorIterator::const_iterator systemc_clang::SplitCFGBlock::succ_begin ( ) const
inline

Definition at line 152 of file SplitCFGBlock.h.

◆ succ_empty()

bool systemc_clang::SplitCFGBlock::succ_empty ( ) const
inline

Definition at line 151 of file SplitCFGBlock.h.

◆ succ_end()

SuccessorIterator::const_iterator systemc_clang::SplitCFGBlock::succ_end ( ) const
inline

Definition at line 155 of file SplitCFGBlock.h.

Friends And Related Symbol Documentation

◆ SplitCFG

SplitCFG
friend

Definition at line 88 of file SplitCFGBlock.h.

Member Data Documentation

◆ block_

const clang::CFGBlock* systemc_clang::SplitCFGBlock::block_
private

A pointer to the original CFGBlock.

Definition at line 91 of file SplitCFGBlock.h.

◆ elements_

VectorCFGElementPtr systemc_clang::SplitCFGBlock::elements_
private

CFG Elements.

Definition at line 119 of file SplitCFGBlock.h.

◆ has_wait_

bool systemc_clang::SplitCFGBlock::has_wait_
private

Whether this SplitCFGBlock is a wait block or not. Only one element if it is a wait block.

Definition at line 94 of file SplitCFGBlock.h.

◆ id_

unsigned int systemc_clang::SplitCFGBlock::id_
private

The block id.

Definition at line 107 of file SplitCFGBlock.h.

◆ is_conditional_

bool systemc_clang::SplitCFGBlock::is_conditional_
private

Definition at line 96 of file SplitCFGBlock.h.

◆ is_loop_with_two_succ_

bool systemc_clang::SplitCFGBlock::is_loop_with_two_succ_
private

Definition at line 98 of file SplitCFGBlock.h.

◆ next_state_

unsigned int systemc_clang::SplitCFGBlock::next_state_
private

The next state that the wait would transform to.

Definition at line 109 of file SplitCFGBlock.h.

◆ predecessors_

llvm::SmallVector<const SplitCFGBlock *> systemc_clang::SplitCFGBlock::predecessors_
private

Predecessors and successors.

Definition at line 121 of file SplitCFGBlock.h.

◆ successors_

llvm::SmallVector<const SplitCFGBlock *> systemc_clang::SplitCFGBlock::successors_
private

Definition at line 122 of file SplitCFGBlock.h.

◆ terminator_has_break_

bool systemc_clang::SplitCFGBlock::terminator_has_break_
private

The terminator has break.

Definition at line 101 of file SplitCFGBlock.h.

◆ terminator_has_wait_

bool systemc_clang::SplitCFGBlock::terminator_has_wait_
private

The terminator has break.

Definition at line 104 of file SplitCFGBlock.h.

◆ wait_arg_

llvm::APInt systemc_clang::SplitCFGBlock::wait_arg_
private

The wait argument.

Definition at line 111 of file SplitCFGBlock.h.

◆ wait_element_ids_

llvm::SmallVector<unsigned int> systemc_clang::SplitCFGBlock::wait_element_ids_
private

This holds the ids in split_elements_ that correspond to the wait statements. This will be a single vector with just the wait() element.

Definition at line 116 of file SplitCFGBlock.h.


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