clang  3.9.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::threadSafety::til::SCFG Class Reference

An SCFG is a control-flow graph. More...

#include <ThreadSafetyTIL.h>

Inheritance diagram for clang::threadSafety::til::SCFG:
[legend]
Collaboration diagram for clang::threadSafety::til::SCFG:
[legend]

Public Types

typedef SimpleArray< BasicBlock * > BlockArray
 
typedef BlockArray::iterator iterator
 
typedef BlockArray::const_iterator const_iterator
 

Public Member Functions

 SCFG (MemRegionRef A, unsigned Nblocks)
 
 SCFG (const SCFG &Cfg, BlockArray &&Ba)
 
bool valid () const
 Return true if this CFG is valid. More...
 
bool normal () const
 Return true if this CFG has been normalized. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const BasicBlockentry () const
 
BasicBlockentry ()
 
const BasicBlockexit () const
 
BasicBlockexit ()
 
size_t numBlocks () const
 Return the number of blocks in the CFG. More...
 
unsigned numInstructions ()
 Return the total number of instructions in the CFG. More...
 
void add (BasicBlock *BB)
 
void setEntry (BasicBlock *BB)
 
void setExit (BasicBlock *BB)
 
void computeNormalForm ()
 
template<class V >
V::R_SExpr traverse (V &Vs, typename V::R_Ctx Ctx)
 
template<class C >
C::CType compare (const SCFG *E, C &Cmp) const
 
- Public Member Functions inherited from clang::threadSafety::til::SExpr
TIL_Opcode opcode () const
 
void * operator new (size_t S, MemRegionRef &R)
 
void operator delete (void *)=delete
 SExpr objects cannot be deleted. More...
 
unsigned id () const
 Returns the instruction ID for this expression. More...
 
BasicBlockblock () const
 Returns the block, if this is an instruction in a basic block, otherwise returns null. More...
 
void setID (BasicBlock *B, unsigned id)
 Set the basic block and instruction ID for this expression. More...
 

Static Public Member Functions

static bool classof (const SExpr *E)
 

Additional Inherited Members

- Protected Member Functions inherited from clang::threadSafety::til::SExpr
 SExpr (TIL_Opcode Op)
 
 SExpr (const SExpr &E)
 
- Protected Attributes inherited from clang::threadSafety::til::SExpr
const unsigned char Opcode
 
unsigned char Reserved
 
unsigned short Flags
 
unsigned SExprID
 
BasicBlockBlock
 

Detailed Description

An SCFG is a control-flow graph.

It consists of a set of basic blocks, each of which terminates in a branch to another basic block. There is one entry point, and one exit point.

Definition at line 1686 of file ThreadSafetyTIL.h.

Member Typedef Documentation

Definition at line 1688 of file ThreadSafetyTIL.h.

Definition at line 1690 of file ThreadSafetyTIL.h.

Definition at line 1689 of file ThreadSafetyTIL.h.

Constructor & Destructor Documentation

clang::threadSafety::til::SCFG::SCFG ( MemRegionRef  A,
unsigned  Nblocks 
)
inline
clang::threadSafety::til::SCFG::SCFG ( const SCFG Cfg,
BlockArray &&  Ba 
)
inline

Definition at line 1705 of file ThreadSafetyTIL.h.

Member Function Documentation

void clang::threadSafety::til::SCFG::add ( BasicBlock BB)
inline
iterator clang::threadSafety::til::SCFG::begin ( )
inline
const_iterator clang::threadSafety::til::SCFG::begin ( ) const
inline

Definition at line 1722 of file ThreadSafetyTIL.h.

References cbegin().

const_iterator clang::threadSafety::til::SCFG::cbegin ( ) const
inline

Definition at line 1725 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SimpleArray< T >::cbegin().

Referenced by begin().

const_iterator clang::threadSafety::til::SCFG::cend ( ) const
inline

Definition at line 1726 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SimpleArray< T >::cend().

Referenced by end().

static bool clang::threadSafety::til::SCFG::classof ( const SExpr E)
inlinestatic

Definition at line 1692 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SExpr::opcode().

template<class C >
C::CType clang::threadSafety::til::SCFG::compare ( const SCFG E,
C &  Cmp 
) const
inline

Definition at line 1767 of file ThreadSafetyTIL.h.

void SCFG::computeNormalForm ( )
iterator clang::threadSafety::til::SCFG::end ( )
inline
const_iterator clang::threadSafety::til::SCFG::end ( ) const
inline

Definition at line 1723 of file ThreadSafetyTIL.h.

References cend().

const BasicBlock* clang::threadSafety::til::SCFG::entry ( ) const
inline

Definition at line 1728 of file ThreadSafetyTIL.h.

BasicBlock* clang::threadSafety::til::SCFG::entry ( )
inline

Definition at line 1729 of file ThreadSafetyTIL.h.

const BasicBlock* clang::threadSafety::til::SCFG::exit ( ) const
inline

Definition at line 1730 of file ThreadSafetyTIL.h.

BasicBlock* clang::threadSafety::til::SCFG::exit ( )
inline

Definition at line 1731 of file ThreadSafetyTIL.h.

bool clang::threadSafety::til::SCFG::normal ( ) const
inline

Return true if this CFG has been normalized.

After normalization, blocks are in topological order, and block and instruction IDs have been assigned.

Definition at line 1717 of file ThreadSafetyTIL.h.

size_t clang::threadSafety::til::SCFG::numBlocks ( ) const
inline

Return the number of blocks in the CFG.

Block::blockID() will return a number less than numBlocks();

Definition at line 1735 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SimpleArray< T >::size().

unsigned clang::threadSafety::til::SCFG::numInstructions ( )
inline

Return the total number of instructions in the CFG.

This is useful for building instruction side-tables; A call to SExpr::id() will return a number less than numInstructions().

Definition at line 1740 of file ThreadSafetyTIL.h.

void clang::threadSafety::til::SCFG::setEntry ( BasicBlock BB)
inline

Definition at line 1749 of file ThreadSafetyTIL.h.

void clang::threadSafety::til::SCFG::setExit ( BasicBlock BB)
inline

Definition at line 1750 of file ThreadSafetyTIL.h.

template<class V >
V::R_SExpr clang::threadSafety::til::SCFG::traverse ( V &  Vs,
typename V::R_Ctx  Ctx 
)
inline
bool clang::threadSafety::til::SCFG::valid ( ) const
inline

Return true if this CFG is valid.

Definition at line 1712 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SimpleArray< T >::size().


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