22 #ifndef OTAWA_CFG_CFG_H
23 #define OTAWA_CFG_CFG_H
25 #include <elm/assert.h>
26 #include <elm/genstruct/FragTable.h>
38 extern Identifier<CFG *>
ENTRY;
86 virtual void scan(
void);
124 #endif // OTAWA_CFG_CFG_H
string format(const Address &addr)
Format the display of the given address relativelt to the given CFG.
Definition: CFG.cpp:295
void numberBB(void)
Number the basic block of the CFG, that is, hook a property with ID_Index identifier and the integer ...
Definition: CFG.cpp:516
void print(io::Output &out)
Print a reference for the CFG.
Definition: CFG.cpp:572
Segment * _seg
Definition: CFG.h:94
static const unsigned long FLAG_Scanned
Definition: CFG.h:80
EndBasicBlock _entry
Definition: CFG.h:79
address_t address(void)
Get the address of the first instruction of the CFG.
Definition: CFG.cpp:404
static const unsigned long FLAG_Virtual
Definition: CFG.h:81
int number(void)
Definition: CFG.h:111
BBIterator(const BBIterator &iter)
Definition: CFG.h:51
BasicBlock * entry(void)
Get the entry basic block of the CFG.
Definition: CFG.h:63
Identifier< int > INDEX
Identifier used for storing in each basic block from the CFG its index.
Definition: CFG.h:39
elm::io::Output & operator<<(elm::io::Output &out, Address addr)
Definition: base.cpp:188
Control Flow Graph representation.
Definition: CFG.h:42
unsigned long flags
Definition: CFG.h:78
In usual file format like ELF, COFF and so on, the program file is divided in segment according platf...
Definition: Segment.h:40
BasicBlock * exit(void)
Get the exit basic block of the CFG.
Definition: CFG.h:65
bool isInlined(void) const
Definition: CFG.h:118
static const unsigned long FLAG_Inlined
Definition: CFG.h:82
string name(void)
Build a name that identifies this CFG and is valid C name.
Definition: CFG.cpp:392
Definition: BasicBlock.h:203
virtual ~CFG(void)
Definition: CFG.cpp:524
EndBasicBlock _exit
Definition: CFG.h:79
Segment * segment(void) const
Definition: CFG.h:101
The representation of an address in OTAWA.
Definition: base.h:54
const bbs_t & getBBS(void)
Definition: CFG.h:89
sys::SystemOutStream & out
BasicBlock * ent
Definition: CFG.h:95
genstruct::FragTable< BasicBlock * > bbs_t
Definition: CFG.h:43
dtd::Element cfg(dtd::make("cfg", _CFG).attr(id).content((entry,*bb, exit,*edge)))
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
string label(void)
Get some label to identify the CFG.
Definition: CFG.cpp:368
This class represents assembly instruction of a piece of code.
Definition: Inst.h:62
This allows storing all CFG available in a workspace.
Definition: CFGInfo.h:29
This a list of properties.
Definition: PropList.h:63
CFG(void)
Build an empty CFG.
Definition: CFG.cpp:333
BBIterator(CFG *cfg)
Definition: CFG.h:50
BasicBlock * firstBB(void)
Get the first basic block of the CFG.
Definition: CFG.cpp:548
bbs_t _bbs
Definition: CFG.h:83
virtual void scan(void)
Scan the CFG for finding exit and builds virtual edges with entry and exit.
Definition: CFG.cpp:428
bool isVirtual(void) const
Definition: CFG.h:115
Identifier< CFG * > ENTRY
Identifier used for storing and retrieving the CFG on its entry BB.
Inst * firstInst(void)
Get the first instruction of the CFG.
Definition: CFG.cpp:559
int countBB(void)
Definition: CFG.h:105