Otawa  0.10
SubCFGBuilder.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * SubCFGBuilder class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2009, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef OTAWA_CFG_SUBCFGBUILDER_H_
23 #define OTAWA_CFG_SUBCFGBUILDER_H_
24 
25 #include <elm/genstruct/Vector.h>
27 #include <otawa/proc/Processor.h>
28 #include <otawa/prop/Identifier.h>
29 #include <otawa/cfg/CFGAdapter.h>
30 
31 namespace otawa {
32 
33 // predeclaration
34 class VirtualCFG;
35 
36 
37 // SubCFGBuilder class
38 class SubCFGBuilder: public Processor {
39 public:
40  SubCFGBuilder(void);
42  virtual void configure(const PropList &props);
43 protected:
44  virtual void processWorkSpace(WorkSpace *ws);
45  virtual void cleanup (WorkSpace *fw);
46 private:
52  CFG *cfg;
53  void floodForward();
54  void floodBackward();
55  static const char BOTTOM = -1,
56  FALSE = 0,
57  TRUE = 1;
58  inline static char toString(char c) {
59  switch(c) {
60  case BOTTOM: return '_';
61  case FALSE: return 'F';
62  case TRUE: return 'T';
63  default: return '?';
64  }
65  }
66 
67 };
68 
69 extern Identifier<Address> CFG_START;
70 extern Identifier<Address> CFG_STOP;
71 
72 } // otawa
73 
74 #endif /* OTAWA_CFG_SUBCFGBUILDER_H_ */
75 
76 
elm::genstruct::Vector< BasicBlock * > _stop_bbs
Definition: SubCFGBuilder.h:50
static const char BOTTOM
Definition: SubCFGBuilder.h:55
virtual void processWorkSpace(WorkSpace *ws)
Process the given framework.
Definition: cfg_SubCFGBuilder.cpp:201
BasicBlock * _start_bb
Definition: SubCFGBuilder.h:49
Address start
Definition: SubCFGBuilder.h:47
VirtualCFG * vcfg
Definition: SubCFGBuilder.h:51
Definition: Registration.h:138
static char toString(char c)
Definition: SubCFGBuilder.h:58
void floodBackward()
Definition: cfg_SubCFGBuilder.cpp:180
virtual void cleanup(WorkSpace *fw)
This method is called after the end of the processor analysis to let it do some clean up...
Definition: cfg_SubCFGBuilder.cpp:342
WorkSpace * ws
Definition: Processor.h:185
static const char TRUE
Definition: SubCFGBuilder.h:57
Control Flow Graph representation.
Definition: CFG.h:42
The processor class is implemented by all code processor.
Definition: Processor.h:49
Identifier< Address > CFG_STOP
Configuration of otawa::SubCFGBuilder specifying a end of the sub-CFG to process. ...
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
Build a sub-CFG starting at the given otawa::START address and ending at the multiple otawa::STOP add...
Definition: SubCFGBuilder.h:38
The representation of an address in OTAWA.
Definition: base.h:54
SubCFGBuilder(void)
Definition: cfg_SubCFGBuilder.cpp:39
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
Identifier< Address > CFG_START
Configuration of otawa::SubCFGBuilder specifying the start of the sub-CFG to process.
CFG * cfg
Definition: SubCFGBuilder.h:52
static Registration< SubCFGBuilder > reg
Definition: SubCFGBuilder.h:41
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
void floodForward()
Definition: cfg_SubCFGBuilder.cpp:163
elm::genstruct::Vector< Address > stops
Definition: SubCFGBuilder.h:48
This a list of properties.
Definition: PropList.h:63
static const char FALSE
Definition: SubCFGBuilder.h:56
virtual void configure(const PropList &props)
This method may be called for configuring a processor thanks to information passed in the property li...
Definition: cfg_SubCFGBuilder.cpp:153