Otawa  0.10
CFGSaver.h
Go to the documentation of this file.
1 /*
2  * CFGSaver class interface
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2013, 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_CFGSAVER_H_
22 #define OTAWA_CFG_CFGSAVER_H_
23 
24 #include <elm/sys/Path.h>
25 #include <otawa/cfg/features.h>
26 #include <otawa/proc/BBProcessor.h>
27 
28 namespace elm { namespace xom {
29 class Document;
30 class Element;
31 } } // elm::xom
32 
33 namespace otawa {
34 
35 class CFGSaver: public BBProcessor {
36 public:
37  static p::declare reg;
38  CFGSaver(p::declare& r = reg);
39  virtual void configure(const PropList& props);
40 
41 protected:
42  virtual void setup(WorkSpace *ws);
43  virtual void processWorkSpace(WorkSpace *ws);
44  virtual void processCFG(WorkSpace *ws, CFG *cfg);
45  virtual void processBB(WorkSpace *ws, CFG *cfg, BasicBlock *bb);
46  virtual void cleanup(WorkSpace *ws);
47 
48 private:
54 };
55 
56 } // otawa
57 
58 #endif /* OTAWA_CFG_CFGSAVER_H_ */
This processor is dedicated to the basic block process thru proccessBB() method.
Definition: BBProcessor.h:72
CFG * cfg(void) const
Get the current CFG.
Definition: CFGProcessor.h:56
virtual void processBB(WorkSpace *ws, CFG *cfg, BasicBlock *bb)
Perform the work of the given basic block.
Definition: cfg_io.cpp:124
Class to declare simple a processor.
Definition: Registration.h:213
WorkSpace * ws
Definition: Processor.h:185
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Control Flow Graph representation.
Definition: CFG.h:42
xom::Document * doc
Definition: CFGSaver.h:51
io::OutStream * stream
Definition: CFGSaver.h:50
static p::declare reg
Definition: CFGSaver.h:37
Save the CFGs of the current task to a file.
Definition: CFGSaver.h:35
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
virtual void setup(WorkSpace *ws)
This method is called before an anlysis to let the processor do some initialization.
Definition: cfg_io.cpp:88
CFGSaver(p::declare &r=reg)
Definition: cfg_io.cpp:81
virtual void cleanup(WorkSpace *ws)
This method is called after the end of the processor analysis to let it do some clean up...
Definition: cfg_io.cpp:151
virtual void processWorkSpace(WorkSpace *ws)
Process the given framework.
Definition: cfg_io.cpp:93
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
This a list of properties.
Definition: PropList.h:63
xom::Element * root
Definition: CFGSaver.h:52
xom::Element * cfg_elt
Definition: CFGSaver.h:53
virtual void configure(const PropList &props)
Configure the current processor.
Definition: cfg_io.cpp:84
sys::Path path
Definition: CFGSaver.h:49
virtual void processCFG(WorkSpace *ws, CFG *cfg)
See CFGProcessor::processCFG()
Definition: cfg_io.cpp:111