struct using_direct * block_using(const struct block *block) { const struct block *static_block = block_static_block(block); if ((static_block == NULL) || (BLOCK_NAMESPACE(static_block) == NULL)) return NULL; else return BLOCK_NAMESPACE(static_block)->usingd; }
const char * block_scope (const struct block *block) { for (; block != NULL; block = BLOCK_SUPERBLOCK (block)) { if (BLOCK_NAMESPACE (block) != NULL && BLOCK_NAMESPACE (block)->scope != NULL) return BLOCK_NAMESPACE (block)->scope; } return ""; }
static void block_initialize_namespace(struct block *block, struct obstack *obstack) { if (BLOCK_NAMESPACE(block) == NULL) { BLOCK_NAMESPACE(block) = (struct block_namespace_info *)obstack_alloc(obstack, sizeof(struct block_namespace_info)); BLOCK_NAMESPACE(block)->scope = NULL; BLOCK_NAMESPACE(block)->usingd = NULL; } }
void block_set_scope (struct block *block, const char *scope, struct obstack *obstack) { block_initialize_namespace (block, obstack); BLOCK_NAMESPACE (block)->scope = scope; }
struct using_direct * block_using (const struct block *block) { if (block == NULL || BLOCK_NAMESPACE (block) == NULL) return NULL; else return BLOCK_NAMESPACE (block)->using; }
void block_set_using(struct block *block, struct using_direct *usingd, struct obstack *obstack) { block_initialize_namespace(block, obstack); BLOCK_NAMESPACE(block)->usingd = usingd; }
struct block * allocate_block(struct obstack *obstack) { struct block *bl = (struct block *)obstack_alloc(obstack, sizeof(struct block)); BLOCK_START(bl) = 0; BLOCK_END(bl) = 0; BLOCK_FUNCTION(bl) = NULL; BLOCK_SUPERBLOCK(bl) = NULL; BLOCK_DICT(bl) = NULL; BLOCK_NAMESPACE(bl) = NULL; BLOCK_GCC_COMPILED(bl) = 0; /* APPLE LOCAL begin address ranges */ BLOCK_RANGES(bl) = NULL; /* APPLE LOCAL end address ranges */ return bl; }