Otawa  0.10
VirtualCFG.h
Go to the documentation of this file.
1 /*
2  * VirtualCFG class interface
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2005, IRIT UPS.
6  *
7  * OTAWA is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * OTAWA is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OTAWA; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 #ifndef OTAWA_CFG_VIRTUAL_CFG_H
22 #define OTAWA_CFG_VIRTUAL_CFG_H
23 
24 #include <otawa/cfg/CFG.h>
25 
26 namespace otawa {
27 
28 // VirtualCFG class
29 class VirtualCFG: public CFG {
31  void virtualize(struct call_t *stack, CFG *cfg,
33 protected:
34  virtual void scan(void);
35 public:
36  VirtualCFG(CFG *cfg, bool inlined = true);
37  VirtualCFG(bool addEntryExit = true);
38  inline CFG *cfg(void) const { return _cfg; }
39  void addBB(BasicBlock *bb);
40  void removeBB(BasicBlock *bb);
41  void numberBBs(void);
42 };
43 
44 } // otawa
45 
46 #endif // OTAWA_CFG_VIRTUAL_CFG_H
virtual void scan(void)
Scan the CFG for finding exit and builds virtual edges with entry and exit.
Definition: cfg_VirtualCFG.cpp:195
void addBB(BasicBlock *bb)
Adds a basic block.
Definition: cfg_VirtualCFG.cpp:53
BasicBlock * entry(void)
Get the entry basic block of the CFG.
Definition: CFG.h:63
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
void removeBB(BasicBlock *bb)
Remove a basic block.
Definition: cfg_VirtualCFG.cpp:65
Control Flow Graph representation.
Definition: CFG.h:42
BasicBlock * exit(void)
Get the exit basic block of the CFG.
Definition: CFG.h:65
A virtual CFG is a CFG not-mapped to real code, that is, it may contains virtual nodes for inlining f...
Definition: VirtualCFG.h:29
struct otawa::call_t call_t
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
void numberBBs(void)
Give a number to each basic block of the virtual CFG.
Definition: cfg_VirtualCFG.cpp:90
VirtualCFG(CFG *cfg, bool inlined=true)
Build a new virtual CFG from the given CFG.
Definition: cfg_VirtualCFG.cpp:218
void virtualize(struct call_t *stack, CFG *cfg, BasicBlock *entry, BasicBlock *exit)
Build the virtual CFG.
Definition: cfg_VirtualCFG.cpp:101
CFG * _cfg
Definition: VirtualCFG.h:30
CFG * cfg(void) const
Get the base CFG of the current virtual CFG.
Definition: VirtualCFG.h:38