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

A basic block is part of an SCFG. More...

#include <ThreadSafetyTIL.h>

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

Classes

struct  TopologyNode
 

Public Types

typedef SimpleArray< SExpr * > InstrArray
 
typedef SimpleArray< BasicBlock * > BlockArray
 

Public Member Functions

 BasicBlock (MemRegionRef A)
 
 BasicBlock (BasicBlock &B, MemRegionRef A, InstrArray &&As, InstrArray &&Is, Terminator *T)
 
int blockID () const
 Returns the block ID. Every block has a unique ID in the CFG. More...
 
size_t numPredecessors () const
 Returns the number of predecessors. More...
 
size_t numSuccessors () const
 
const SCFGcfg () const
 
SCFGcfg ()
 
const BasicBlockparent () const
 
BasicBlockparent ()
 
const InstrArrayarguments () const
 
InstrArrayarguments ()
 
InstrArrayinstructions ()
 
const InstrArrayinstructions () const
 
BlockArraypredecessors ()
 Returns a list of predecessors. More...
 
const BlockArraypredecessors () const
 
ArrayRef< BasicBlock * > successors ()
 
ArrayRef< BasicBlock * > successors () const
 
const Terminatorterminator () const
 
Terminatorterminator ()
 
void setTerminator (Terminator *E)
 
bool Dominates (const BasicBlock &Other)
 
bool PostDominates (const BasicBlock &Other)
 
void addArgument (Phi *V)
 Add a new argument. More...
 
void addInstruction (SExpr *V)
 Add a new instruction. More...
 
unsigned addPredecessor (BasicBlock *Pred)
 
void reserveArguments (unsigned Nargs)
 
void reserveInstructions (unsigned Nins)
 
void reservePredecessors (unsigned NumPreds)
 
unsigned findPredecessorIndex (const BasicBlock *BB) const
 Return the index of BB, or Predecessors.size if BB is not a predecessor. More...
 
template<class V >
V::R_BasicBlock traverse (V &Vs, typename V::R_Ctx Ctx)
 
template<class C >
C::CType compare (const BasicBlock *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)
 

Friends

class SCFG
 

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

A basic block is part of an SCFG.

It can be treated as a function in continuation passing style. A block consists of a sequence of phi nodes, which are "arguments" to the function, followed by a sequence of instructions. It ends with a Terminator, which is a Branch or Goto to another basic block in the same SCFG.

Definition at line 1520 of file ThreadSafetyTIL.h.

Member Typedef Documentation

Definition at line 1523 of file ThreadSafetyTIL.h.

Definition at line 1522 of file ThreadSafetyTIL.h.

Constructor & Destructor Documentation

clang::threadSafety::til::BasicBlock::BasicBlock ( MemRegionRef  A)
inlineexplicit

Definition at line 1549 of file ThreadSafetyTIL.h.

clang::threadSafety::til::BasicBlock::BasicBlock ( BasicBlock B,
MemRegionRef  A,
InstrArray &&  As,
InstrArray &&  Is,
Terminator T 
)
inline

Definition at line 1552 of file ThreadSafetyTIL.h.

Member Function Documentation

void clang::threadSafety::til::BasicBlock::addArgument ( Phi V)
inline
void clang::threadSafety::til::BasicBlock::addInstruction ( SExpr V)
inline
unsigned BasicBlock::addPredecessor ( BasicBlock Pred)
const InstrArray& clang::threadSafety::til::BasicBlock::arguments ( ) const
inline
InstrArray& clang::threadSafety::til::BasicBlock::arguments ( )
inline

Definition at line 1571 of file ThreadSafetyTIL.h.

int clang::threadSafety::til::BasicBlock::blockID ( ) const
inline
const SCFG* clang::threadSafety::til::BasicBlock::cfg ( ) const
inline

Definition at line 1564 of file ThreadSafetyTIL.h.

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

Definition at line 1565 of file ThreadSafetyTIL.h.

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

Definition at line 1547 of file ThreadSafetyTIL.h.

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

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

Definition at line 1652 of file ThreadSafetyTIL.h.

bool clang::threadSafety::til::BasicBlock::Dominates ( const BasicBlock Other)
inline
unsigned clang::threadSafety::til::BasicBlock::findPredecessorIndex ( const BasicBlock BB) const
inline

Return the index of BB, or Predecessors.size if BB is not a predecessor.

Definition at line 1622 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::SimpleArray< T >::cbegin(), clang::threadSafety::til::SimpleArray< T >::cend(), distance(), and I.

InstrArray& clang::threadSafety::til::BasicBlock::instructions ( )
inline
const InstrArray& clang::threadSafety::til::BasicBlock::instructions ( ) const
inline

Definition at line 1574 of file ThreadSafetyTIL.h.

size_t clang::threadSafety::til::BasicBlock::numPredecessors ( ) const
inline

Returns the number of predecessors.

Definition at line 1561 of file ThreadSafetyTIL.h.

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

size_t clang::threadSafety::til::BasicBlock::numSuccessors ( ) const
inline

Definition at line 1562 of file ThreadSafetyTIL.h.

References successors().

const BasicBlock* clang::threadSafety::til::BasicBlock::parent ( ) const
inline
BasicBlock* clang::threadSafety::til::BasicBlock::parent ( )
inline
bool clang::threadSafety::til::BasicBlock::PostDominates ( const BasicBlock Other)
inline
BlockArray& clang::threadSafety::til::BasicBlock::predecessors ( )
inline

Returns a list of predecessors.

The order of predecessors in the list is important; each phi node has exactly one argument for each precessor, in the same order.

Definition at line 1579 of file ThreadSafetyTIL.h.

const BlockArray& clang::threadSafety::til::BasicBlock::predecessors ( ) const
inline

Definition at line 1580 of file ThreadSafetyTIL.h.

void clang::threadSafety::til::BasicBlock::reserveArguments ( unsigned  Nargs)
inline
void clang::threadSafety::til::BasicBlock::reserveInstructions ( unsigned  Nins)
inline
void BasicBlock::reservePredecessors ( unsigned  NumPreds)

Definition at line 70 of file ThreadSafetyTIL.cpp.

References E, and clang::threadSafety::til::SimpleArray< T >::reserve().

void clang::threadSafety::til::BasicBlock::setTerminator ( Terminator E)
inline

Definition at line 1588 of file ThreadSafetyTIL.h.

References E.

Referenced by clang::threadSafety::til::SCFG::SCFG().

ArrayRef<BasicBlock*> clang::threadSafety::til::BasicBlock::successors ( )
inline

Definition at line 1582 of file ThreadSafetyTIL.h.

References clang::threadSafety::til::Terminator::successors().

Referenced by numSuccessors().

ArrayRef<BasicBlock*> clang::threadSafety::til::BasicBlock::successors ( ) const
inline
const Terminator* clang::threadSafety::til::BasicBlock::terminator ( ) const
inline
Terminator* clang::threadSafety::til::BasicBlock::terminator ( )
inline

Definition at line 1586 of file ThreadSafetyTIL.h.

template<class V >
V::R_BasicBlock clang::threadSafety::til::BasicBlock::traverse ( V &  Vs,
typename V::R_Ctx  Ctx 
)
inline

Definition at line 1628 of file ThreadSafetyTIL.h.

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

Friends And Related Function Documentation

friend class SCFG
friend

Definition at line 1658 of file ThreadSafetyTIL.h.


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