Lines Matching refs:block

23 #include "block.h"
29 /* This is used by struct block to store namespace-related info for
39 static void block_initialize_namespace (struct block *block,
42 /* Return Nonzero if block a is lexically nested within block b,
47 contained_in (const struct block *a, const struct block *b)
57 lexical block, described by a struct block BL. */
60 block_function (const struct block *bl)
68 /* Return the blockvector immediately containing the innermost lexical block
70 PINDEX is a pointer to the index value of the block. If PINDEX
77 struct block *b;
92 /* Then search that symtab for the smallest block that wins. */
93 /* Use binary search to find the last block that starts before PC. */
108 /* Now search backward for a block that ends after PC. */
124 /* Return the blockvector immediately containing the innermost lexical block
135 /* Return the innermost lexical block containing the specified pc value
138 struct block *
150 /* Return the innermost lexical block containing the specified pc value,
153 struct block *
167 block_scope (const struct block *block)
169 for (; block != NULL; block = BLOCK_SUPERBLOCK (block))
171 if (BLOCK_NAMESPACE (block) != NULL
172 && BLOCK_NAMESPACE (block)->scope != NULL)
173 return BLOCK_NAMESPACE (block)->scope;
184 block_set_scope (struct block *block, const char *scope,
187 block_initialize_namespace (block, obstack);
189 BLOCK_NAMESPACE (block)->scope = scope;
202 block_using (const struct block *block)
204 const struct block *static_block = block_static_block (block);
218 block_set_using (struct block *block,
222 block_initialize_namespace (block, obstack);
224 BLOCK_NAMESPACE (block)->using = using;
227 /* If BLOCK_NAMESPACE (block) is NULL, allocate it via OBSTACK and
231 block_initialize_namespace (struct block *block, struct obstack *obstack)
233 if (BLOCK_NAMESPACE (block) == NULL)
235 BLOCK_NAMESPACE (block)
237 BLOCK_NAMESPACE (block)->scope = NULL;
238 BLOCK_NAMESPACE (block)->using = NULL;
242 /* Return the static block associated to BLOCK. Return NULL if block
243 is NULL or if block is a global block. */
245 const struct block *
246 block_static_block (const struct block *block)
248 if (block == NULL || BLOCK_SUPERBLOCK (block) == NULL)
251 while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) != NULL)
252 block = BLOCK_SUPERBLOCK (block);
254 return block;
257 /* Return the static block associated to BLOCK. Return NULL if block
260 const struct block *
261 block_global_block (const struct block *block)
263 if (block == NULL)
266 while (BLOCK_SUPERBLOCK (block) != NULL)
267 block = BLOCK_SUPERBLOCK (block);
269 return block;
272 /* Allocate a block on OBSTACK, and initialize its elements to
276 Warning: it sets the block's BLOCK_DICT to NULL, which isn't a
277 valid value. If you really don't want the block to have a
281 struct block *
284 struct block *bl = obstack_alloc (obstack, sizeof (struct block));