ack/mach/proto/mcg/map.h
David Given ed67d427c9 Replaced the block splicer with a trivial block eliminator (which rewrites
jumps to blocks which contain only a jump). Don't bother storing the bb graph
in the ir nodes; we can find it on demand by walking the tree instead ---
slower, but much easier to understand and more robust. Added a terrible map
library.
2016-09-23 23:59:15 +02:00

27 lines
558 B
C

#ifndef MAP_H
#define MAP_H
struct map_node
{
void* left;
void* right;
};
#define _MAP(MODIFIER, NAME) \
MODIFIER struct map_node* NAME; \
MODIFIER int NAME##_count; \
MODIFIER int NAME##_max
#define MAP(NAME) _MAP(, NAME)
#define STATICMAP(NAME) _MAP(static, NAME)
#define MAP_SET(MAP, LEFT, RIGHT) \
map_set(&MAP, &MAP##_count, &MAP##_max, LEFT, RIGHT)
extern void map_set(struct map_node** map, int* count, int* max, void* left, void* right);
extern void map_add(struct map_node** map, int* count, int* max, void* left, void* right);
#endif