}
}
-/* Subroutine of end_compunit_symtab_from_static_block to simplify it.
- Handle the "have blockvector" case.
- See end_compunit_symtab_from_static_block for a description of the
- arguments. */
+/* Implementation of the second part of end_compunit_symtab. Pass STATIC_BLOCK
+ as value returned by end_compunit_symtab_get_static_block.
+
+ If EXPANDABLE is non-zero the GLOBAL_BLOCK dictionary is made
+ expandable. */
struct compunit_symtab *
-buildsym_compunit::end_compunit_symtab_with_blockvector
+buildsym_compunit::end_compunit_symtab_from_static_block
(struct block *static_block, int expandable)
{
struct compunit_symtab *cu = m_compunit_symtab;
struct subfile *subfile;
CORE_ADDR end_addr;
- gdb_assert (static_block != NULL);
+ if (static_block == nullptr)
+ {
+ /* Handle the "no blockvector" case.
+ When this happens there is nothing to record, so there's nothing
+ to do: memory will be freed up later.
+
+ Note: We won't be adding a compunit to the objfile's list of
+ compunits, so there's nothing to unchain. However, since each symtab
+ is added to the objfile's obstack we can't free that space.
+ We could do better, but this is believed to be a sufficiently rare
+ event. */
+ return nullptr;
+ }
+
gdb_assert (m_subfiles != NULL);
end_addr = static_block->end ();
return cu;
}
-/* Implementation of the second part of end_compunit_symtab. Pass STATIC_BLOCK
- as value returned by end_compunit_symtab_get_static_block.
-
- If EXPANDABLE is non-zero the GLOBAL_BLOCK dictionary is made
- expandable. */
-
-struct compunit_symtab *
-buildsym_compunit::end_compunit_symtab_from_static_block
- (struct block *static_block, int expandable)
-{
- struct compunit_symtab *cu;
-
- if (static_block == NULL)
- {
- /* Handle the "no blockvector" case.
- When this happens there is nothing to record, so there's nothing
- to do: memory will be freed up later.
-
- Note: We won't be adding a compunit to the objfile's list of
- compunits, so there's nothing to unchain. However, since each symtab
- is added to the objfile's obstack we can't free that space.
- We could do better, but this is believed to be a sufficiently rare
- event. */
- cu = NULL;
- }
- else
- cu = end_compunit_symtab_with_blockvector (static_block, expandable);
-
- return cu;
-}
-
/* Finish the symbol definitions for one main source file, close off
all the lexical contexts for that file (creating struct block's for
them), then make the struct symtab for that file and put it in the