Otawa  0.10
Dominance.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Copyright (c) 2005 IRIT-UPS
4  *
5  * include/util/Dominance.h -- Dominance class interface.
6  */
7 #ifndef OTAWA_UTIL_DOMINANCE_H
8 #define OTAWA_UTIL_DOMINANCE_H
9 
11 #include <otawa/proc/Feature.h>
12 #include <otawa/cfg/features.h>
13 
14 namespace otawa {
15 
16 // External
17 class BasicBlock;
18 class Edge;
19 namespace dfa { class BitSet; }
20 
21 // Dominance class
22 class Dominance: public CFGProcessor {
23 public:
24  static void ensure(CFG *cfg);
25  static bool dominates(BasicBlock *bb1, BasicBlock *bb2);
26  static inline bool isDominated(BasicBlock *bb1, BasicBlock *bb2);
27  static bool isLoopHeader(BasicBlock *bb);
28  static bool isBackEdge(Edge *edge);
29 
30  // Constructor
31  Dominance(void);
32 
33 protected:
34  virtual void processCFG(WorkSpace *fw, CFG *cfg);
35 private:
36  void markLoopHeaders(CFG *cfg);
37 };
38 
39 // Features
42 
43 } // otawa
44 
45 #endif // OTAWA_UTIL_DOMINANCE_H
The usual Feature class has as drawback to exhibit completely the processing of the feature and there...
Definition: SilentFeature.h:32
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))
static bool isDominated(BasicBlock *bb1, BasicBlock *bb2)
Test if the first block is dominated by the second one.
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Control Flow Graph representation.
Definition: CFG.h:42
static void ensure(CFG *cfg)
Check if the dominance informance is available.
Definition: util_Dominance.cpp:243
void markLoopHeaders(CFG *cfg)
Using a CFG where dominance relation has been computed, mark loop headers.
Definition: util_Dominance.cpp:214
static bool isBackEdge(Edge *edge)
Test if the given edge is a back edge.
Definition: util_Dominance.cpp:256
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
This CFG processor computes and hook to the CFG the dominance relation that, then, may be tested with Dominance::dominate() function.
Definition: Dominance.h:22
static bool dominates(BasicBlock *bb1, BasicBlock *bb2)
Test if the first basic block dominates the second one.
Definition: util_Dominance.cpp:164
This is a specialization of the processor class dedicated to CFG processing.
Definition: CFGProcessor.h:35
Dominance(void)
The dominance processors computes dominance relation and the loop headers on the current CFG...
Definition: util_Dominance.cpp:151
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
SilentFeature DOMINANCE_FEATURE
This feature ensures that information about domination between nodes of a CFG is vailable.
static bool isLoopHeader(BasicBlock *bb)
Test if the given basic block is a loop header.
Definition: util_Dominance.cpp:233
virtual void processCFG(WorkSpace *fw, CFG *cfg)
Computes the domination relation.
Definition: util_Dominance.cpp:194
Identifier< dfa::BitSet * > REVERSE_DOM
Identifier of annotation containing reverse-dominance information.