clang
3.9.0
|
A basic block is part of an SCFG. More...
#include <ThreadSafetyTIL.h>
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 SCFG * | cfg () const |
SCFG * | cfg () |
const BasicBlock * | parent () const |
BasicBlock * | parent () |
const InstrArray & | arguments () const |
InstrArray & | arguments () |
InstrArray & | instructions () |
const InstrArray & | instructions () const |
BlockArray & | predecessors () |
Returns a list of predecessors. More... | |
const BlockArray & | predecessors () const |
ArrayRef< BasicBlock * > | successors () |
ArrayRef< BasicBlock * > | successors () const |
const Terminator * | terminator () const |
Terminator * | terminator () |
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 |
![]() | |
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... | |
BasicBlock * | block () 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 | |
![]() | |
SExpr (TIL_Opcode Op) | |
SExpr (const SExpr &E) | |
![]() | |
const unsigned char | Opcode |
unsigned char | Reserved |
unsigned short | Flags |
unsigned | SExprID |
BasicBlock * | Block |
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.
Definition at line 1523 of file ThreadSafetyTIL.h.
Definition at line 1522 of file ThreadSafetyTIL.h.
|
inlineexplicit |
Definition at line 1549 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 1552 of file ThreadSafetyTIL.h.
|
inline |
Add a new argument.
Definition at line 1599 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SimpleArray< T >::push_back(), and clang::threadSafety::til::SimpleArray< T >::reserveCheck().
Referenced by clang::threadSafety::til::SCFG::SCFG().
|
inline |
Add a new instruction.
Definition at line 1604 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SimpleArray< T >::push_back(), and clang::threadSafety::til::SimpleArray< T >::reserveCheck().
unsigned BasicBlock::addPredecessor | ( | BasicBlock * | Pred | ) |
Definition at line 56 of file ThreadSafetyTIL.cpp.
References E, clang::threadSafety::til::SimpleArray< T >::push_back(), clang::threadSafety::til::SimpleArray< T >::reserveCheck(), and clang::threadSafety::til::SimpleArray< T >::size().
|
inline |
Definition at line 1570 of file ThreadSafetyTIL.h.
Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printBasicBlock().
|
inline |
Definition at line 1571 of file ThreadSafetyTIL.h.
|
inline |
Returns the block ID. Every block has a unique ID in the CFG.
Definition at line 1558 of file ThreadSafetyTIL.h.
Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printBasicBlock(), and clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printBlockLabel().
|
inline |
Definition at line 1564 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 1565 of file ThreadSafetyTIL.h.
Definition at line 1547 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SExpr::opcode().
|
inline |
Definition at line 1652 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 1590 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::BasicBlock::TopologyNode::isParentOfOrEqual().
|
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.
|
inline |
Definition at line 1573 of file ThreadSafetyTIL.h.
Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printBasicBlock().
|
inline |
Definition at line 1574 of file ThreadSafetyTIL.h.
|
inline |
Returns the number of predecessors.
Definition at line 1561 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SimpleArray< T >::size().
|
inline |
Definition at line 1562 of file ThreadSafetyTIL.h.
References successors().
|
inline |
Definition at line 1567 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::BasicBlock::TopologyNode::Parent.
Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printBasicBlock().
|
inline |
Definition at line 1568 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::BasicBlock::TopologyNode::Parent.
|
inline |
Definition at line 1594 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::BasicBlock::TopologyNode::isParentOfOrEqual().
|
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.
|
inline |
Definition at line 1580 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 1613 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SimpleArray< T >::reserve().
|
inline |
Definition at line 1616 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::SimpleArray< T >::reserve().
void BasicBlock::reservePredecessors | ( | unsigned | NumPreds | ) |
Definition at line 70 of file ThreadSafetyTIL.cpp.
References E, and clang::threadSafety::til::SimpleArray< T >::reserve().
|
inline |
Definition at line 1588 of file ThreadSafetyTIL.h.
References E.
Referenced by clang::threadSafety::til::SCFG::SCFG().
|
inline |
Definition at line 1582 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::Terminator::successors().
Referenced by numSuccessors().
|
inline |
Definition at line 1583 of file ThreadSafetyTIL.h.
References clang::threadSafety::til::Terminator::successors().
|
inline |
Definition at line 1585 of file ThreadSafetyTIL.h.
Referenced by clang::threadSafety::til::PrettyPrinter< StdPrinter, std::ostream >::printBasicBlock().
|
inline |
Definition at line 1586 of file ThreadSafetyTIL.h.
|
inline |
Definition at line 1628 of file ThreadSafetyTIL.h.
References E, and clang::threadSafety::til::SimpleArray< T >::size().
|
friend |
Definition at line 1658 of file ThreadSafetyTIL.h.