Otawa  0.10
CFGInfo.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Copyright (c) 2003-07, IRIT UPS.
4  *
5  * otawa/cfg/CFGInfo.h -- interface of CFGInfo class.
6  */
7 #ifndef OTAWA_CFG_CFG_INFO_H
8 #define OTAWA_CFG_CFG_INFO_H
9 
10 #include <elm/utility.h>
11 #include <elm/util/AutoPtr.h>
12 #include <elm/genstruct/FragTable.h>
13 #include <elm/inhstruct/DLList.h>
14 #include <otawa/cfg/BasicBlock.h>
15 #include <otawa/util/MemBlockMap.h>
16 
17 namespace otawa {
18 
19 using namespace elm;
20 
21 // Classes
22 class BasicBlock;
23 class CFG;
24 class CodeItem;
25 class WorkSpace;
26 class Inst;
27 
28 // CFGInfo class
29 class CFGInfo: public elm::Lock {
30 public:
32 
33  // Constructors
34  CFGInfo(WorkSpace *fw);
35  virtual ~CFGInfo(void);
36 
37  // Accessors
38  CFG *findCFG(Address addr);
39  CFG *findCFG(Inst *inst);
40  CFG *findCFG(const BasicBlock *bb);
41  CFG *findCFG(String label);
42 
43  // Modifiers
44  void add(CFG *cfg);
45  void add(BasicBlock *bb);
46  void clear(void);
47 
48  // Iter class
49  class Iter: public genstruct::FragTable<CFG *>::Iterator {
50  public:
51  inline Iter(CFGInfo *info)
52  : genstruct::FragTable<CFG *>::Iterator(info->_cfgs) { }
53  inline Iter(const Iter& iter)
54  : genstruct::FragTable<CFG *>::Iterator(iter) { }
55  };
56 
57 private:
62 };
63 
64 } // otawa
65 
66 #endif // OTAWA_CFG_CFG_INFO_H
struct otawa::sem::inst inst
Definition: CFGInfo.h:49
genstruct::FragTable< CFG * > _cfgs
Definition: CFGInfo.h:59
genstruct::FragTable< BasicBlock * > bbs
Definition: CFGInfo.h:60
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Iter(CFGInfo *info)
Definition: CFGInfo.h:51
Control Flow Graph representation.
Definition: CFG.h:42
MemBlockMap< BasicBlock > map
Definition: CFGInfo.h:61
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
The representation of an address in OTAWA.
Definition: base.h:54
Iter(const Iter &iter)
Definition: CFGInfo.h:53
static Identifier< CFGInfo * > & ID
This property allows to get the CFG information from the current CFG is member of.
Definition: CFGInfo.h:31
void clear(T *target, int size)
inst add(int d, int a, int b)
Definition: inst.h:163
dtd::Element cfg(dtd::make("cfg", _CFG).attr(id).content((entry,*bb, exit,*edge)))
This class represents identifier with a typed associated value.
Definition: Identifier.h:51
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
This class represents assembly instruction of a piece of code.
Definition: Inst.h:62
This class is used to retrieve quickly blocks from their containing address.
Definition: MemBlockMap.h:34
This allows storing all CFG available in a workspace.
Definition: CFGInfo.h:29
WorkSpace * fw
Definition: CFGInfo.h:58