Otawa  0.10
EdgeProcessor.h
Go to the documentation of this file.
1 /*
2  * EdgeProcessor 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_PROC_EDGEPROCESSOR_H_
22 #define OTAWA_PROC_EDGEPROCESSOR_H_
23 
25 #include <otawa/cfg/Edge.h>
26 
27 namespace otawa {
28 
29 class EdgeProcessor: public CFGProcessor {
30 public:
31  EdgeProcessor(void);
34  EdgeProcessor(cstring name, const Version& version, AbstractRegistration& reg);
35 
36 protected:
37  virtual void processCFG(WorkSpace *ws, CFG *cfg);
38  virtual void processEdge(WorkSpace *ws, CFG *cfg, Edge *edge) = 0;
39  virtual void cleanupCFG(WorkSpace *ws, CFG *cfg);
40  virtual void cleanupBB(WorkSpace *ws, CFG *cfg, BasicBlock *bb);
41  virtual void cleanupEdge(WorkSpace *ws, CFG *cfg, Edge *edge);
42 };
43 
44 } // otawa
45 
46 #endif /* OTAWA_PROC_EDGEPROCESSOR_H_ */
CFG * cfg(void) const
Get the current CFG.
Definition: CFGProcessor.h:56
EdgeProcessor(void)
Definition: proc_EdgeProcessor.cpp:36
dtd::Element edge(dtd::make("edge", _EDGE).attr(source).attr(target).attr(called))
elm::String name(void) const
Definition: Processor.h:91
Abstract class to represent the registered processors.
Definition: Registration.h:80
virtual void cleanupEdge(WorkSpace *ws, CFG *cfg, Edge *edge)
When the function doCleanup() is called, this function is called for each edge of the task...
Definition: proc_EdgeProcessor.cpp:100
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
virtual void cleanupCFG(WorkSpace *ws, CFG *cfg)
This function may be overridden by a subclass to provide custom cleanup for a CFG.
Definition: proc_EdgeProcessor.cpp:68
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
This is a specialization of the processor class dedicated to CFG processing.
Definition: CFGProcessor.h:35
elm::Version version(void) const
Definition: Processor.h:92
This class represents edges in the CFG representation.
Definition: Edge.h:33
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
Abstract processor providing simple traversal of edges of the CFG.
Definition: EdgeProcessor.h:29
virtual void processEdge(WorkSpace *ws, CFG *cfg, Edge *edge)=0
This function is called once for each edge and must be overridden by the subclass.
virtual void processCFG(WorkSpace *ws, CFG *cfg)
Definition: proc_EdgeProcessor.cpp:56
static MetaRegistration reg
Definition: CFGProcessor.h:43
virtual void cleanupBB(WorkSpace *ws, CFG *cfg, BasicBlock *bb)
When the function doCleanup() is called, this function is called for each basic block of the task...
Definition: proc_EdgeProcessor.cpp:84