Otawa  0.10
ContextualProcessor.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * ContextualProcessor class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2008, 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_PROC_CONTEXTUALPROCESSOR_H_
23 #define OTAWA_PROC_CONTEXTUALPROCESSOR_H_
24 
26 
27 namespace otawa {
28 
29 class Edge;
30 
31 // ContextualProcessor class
33 public:
37 
38 protected:
39 
40  // v1 methods
41  virtual void enteringCall(
42  WorkSpace *ws,
43  CFG *cfg,
44  BasicBlock *caller,
45  BasicBlock *callee);
46  virtual void leavingCall(WorkSpace *ws, CFG *cfg, BasicBlock *to);
47  virtual void avoidingRecursive(
48  WorkSpace *ws,
49  CFG *cfg,
50  BasicBlock *caller,
51  BasicBlock *callee);
52 
53  // v2 methods
54  virtual void enteringCall(WorkSpace *ws, CFG *cfg, Edge *edge);
55  virtual void leavingCall(WorkSpace *ws, CFG *cfg, Edge *edge);
56  virtual void avoidingRecursive(WorkSpace *ws, CFG *cfg, Edge *edge);
57 
58  virtual void processCFG (WorkSpace *fw, CFG *cfg);
59  virtual void processBB(WorkSpace *ws, CFG *cfg, BasicBlock *bb) = 0;
60 };
61 
62 } // otawa
63 
64 #endif /* OTAWA_PROC_CONTEXTUALPROCESSOR_H_ */
65 
CFG * cfg(void) const
Get the current CFG.
Definition: CFGProcessor.h:56
dtd::Element edge(dtd::make("edge", _EDGE).attr(source).attr(target).attr(called))
Definition: Registration.h:127
elm::String name(void) const
Definition: Processor.h:91
virtual void leavingCall(WorkSpace *ws, CFG *cfg, BasicBlock *to)
This function is called each time a function return is traversed.
Definition: proc_ContextualProcessor.cpp:226
Abstract class to represent the registered processors.
Definition: Registration.h:80
virtual void processCFG(WorkSpace *fw, CFG *cfg)
Definition: proc_ContextualProcessor.cpp:97
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
AbstractRegistration * _reg
Definition: Processor.h:184
A contextual processor allows to process basic block in a call-aware way even with a virtual CFG (whe...
Definition: ContextualProcessor.h:32
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
static MetaRegistration reg
Definition: ContextualProcessor.h:34
virtual void enteringCall(WorkSpace *ws, CFG *cfg, BasicBlock *caller, BasicBlock *callee)
This function is called each time a function call is traversed.
Definition: proc_ContextualProcessor.cpp:211
elm::Version version(void) const
Definition: Processor.h:92
virtual void avoidingRecursive(WorkSpace *ws, CFG *cfg, BasicBlock *caller, BasicBlock *callee)
This function is called each time a recursive function call is found.
Definition: proc_ContextualProcessor.cpp:239
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
ContextualProcessor(cstring name, const Version &version)
Build a contextual processor.
Definition: proc_ContextualProcessor.cpp:82
virtual void processBB(WorkSpace *ws, CFG *cfg, BasicBlock *bb)=0
This method is called each time a basic block is found.