23 #ifndef OTAWA_UTIL_MEMBLOCKMAP_H_
24 #define OTAWA_UTIL_MEMBLOCKMAP_H_
53 for(
node_t *cur =
nodes[i], *next; cur; cur = next) {
61 void add(
const T *block) {
62 ASSERT(block->size());
63 ot::size top = (block->topAddress().offset() - 1) >>
pow;
66 for(
ot::size ptr = block->address().offset() >>
pow; ptr <= top; ptr++) {
75 if(
address >= node->block->address() &&
address < node->block->topAddress())
var x(Var *v)
Convert an ilp::Var * to a var.
Definition: expr.h:40
~MemBlockMap(void)
Definition: MemBlockMap.h:49
MemBlockMap(ot::size block_size=32, t::size table_size=211)
Build a memory block map.
Definition: MemBlockMap.h:43
ot::size leastGreaterLog2(ot::size x)
Compute the least greater logarithm of 2 for the given value.
Definition: util_MemBlockMap.cpp:32
struct otawa::MemBlockMap::node_t node_t
ot::size pow
Definition: MemBlockMap.h:81
elm::io::IntFormat address(Address addr)
Build a format to display addresses.
Definition: base.cpp:213
t::uint32 size
Definition: base.h:46
dtd::Element entry(dtd::make("entry", _ENTRY).attr(id))
ot::size tsize
Definition: MemBlockMap.h:81
The representation of an address in OTAWA.
Definition: base.h:54
struct node_t * next
Definition: MemBlockMap.h:38
const T * block
Definition: MemBlockMap.h:39
node_t ** nodes
Definition: MemBlockMap.h:82
void clear(void)
Clear the content of map.
Definition: MemBlockMap.h:51
This class is used to retrieve quickly blocks from their containing address.
Definition: MemBlockMap.h:34
Definition: MemBlockMap.h:36
node_t(const T *b, node_t *n)
Definition: MemBlockMap.h:37
ot::size bsize
Definition: MemBlockMap.h:81
void add(const T *block)
Add a block to the map.
Definition: MemBlockMap.h:61