Remove the macro, replace with an equivalent method.
Change-Id: Id6fe2a79c04bcd6c69ccaefb7a69bc06a476288c
     symtab = NULL;
 
   if (symtab != NULL)
-    result = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), STATIC_BLOCK);
+    result = BLOCKVECTOR_BLOCK (symtab->blockvector (), STATIC_BLOCK);
   else if (syms.empty () || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK)
     {
       if (context == NULL)
 
      the symbol is local or not, we check the block where we found it
      against the global and static blocks of its associated symtab.  */
   if (sym
-      && BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symbol_symtab (sym)),
+      && BLOCKVECTOR_BLOCK (symbol_symtab (sym)->blockvector (),
                            GLOBAL_BLOCK) != block
-      && BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symbol_symtab (sym)),
+      && BLOCKVECTOR_BLOCK (symbol_symtab (sym)->blockvector (),
                            STATIC_BLOCK) != block)
     return;
 
 
          symtab = lookup_symtab (copy.c_str ());
          if (symtab)
            {
-             yylval.bval = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab),
+             yylval.bval = BLOCKVECTOR_BLOCK (symtab->blockvector (),
                                               STATIC_BLOCK);
              return FILENAME;
            }
 
   struct symbol *real_sym;
 
   /* Go through the per-file symbols only.  */
-  b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), STATIC_BLOCK);
+  b = BLOCKVECTOR_BLOCK (s->blockvector (), STATIC_BLOCK);
   ALL_BLOCK_SYMBOLS (b, iter, real_sym)
     {
       /* Find completed typedefs to use to fix opaque ones.
 
   lookup_name_info func_matcher (GCC_FE_WRAPPER_FUNCTION,
                                 symbol_name_match_type::SEARCH_NAME);
 
-  bv = SYMTAB_BLOCKVECTOR (func_sym->owner.symtab);
+  bv = func_sym->owner.symtab->blockvector ();
   nblocks = BLOCKVECTOR_NBLOCKS (bv);
 
   gdb_ptr_type_sym = NULL;
 
       struct symtab_and_line cursal = get_current_source_symtab_and_line ();
 
       if (cursal.symtab)
-       block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (cursal.symtab),
+       block = BLOCKVECTOR_BLOCK (cursal.symtab->blockvector (),
                                   STATIC_BLOCK);
       if (block != NULL)
        *pc = BLOCK_ENTRY_PC (block);
 
   const struct blockvector *blockvector;
   const struct block *block;
 
-  blockvector = SYMTAB_BLOCKVECTOR (symtab);
+  blockvector = symtab->blockvector ();
   block = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
 
   return bkscm_scm_from_block (block, SYMTAB_OBJFILE (symtab));
   const struct blockvector *blockvector;
   const struct block *block;
 
-  blockvector = SYMTAB_BLOCKVECTOR (symtab);
+  blockvector = symtab->blockvector ();
   block = BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK);
 
   return bkscm_scm_from_block (block, SYMTAB_OBJFILE (symtab));
 
                  int i;
 
                  for (i = FIRST_LOCAL_BLOCK;
-                      i < BLOCKVECTOR_NBLOCKS (SYMTAB_BLOCKVECTOR (symtab));
+                      i < BLOCKVECTOR_NBLOCKS (symtab->blockvector ());
                       i++)
                    {
-                     block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), i);
+                     block = BLOCKVECTOR_BLOCK (symtab->blockvector (), i);
                      state->language->iterate_over_symbols
                        (block, lookup_name, name_domain,
                         [&] (block_symbol *bsym)
 {
   const struct block *block;
 
-  for (block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), STATIC_BLOCK);
+  for (block = BLOCKVECTOR_BLOCK (symtab->blockvector (), STATIC_BLOCK);
        block != NULL;
        block = BLOCK_SUPERBLOCK (block))
     current_language->iterate_over_symbols (block, name, domain, callback);
 
       break;
 
     case stGlobal:             /* External symbol, goes into global block.  */
-      b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (top_stack->cur_st),
+      b = BLOCKVECTOR_BLOCK (top_stack->cur_st->blockvector (),
                             GLOBAL_BLOCK);
       s = new_symbol (name);
       SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
       if (sh->st == stProc)
        {
          const struct blockvector *bv
-           = SYMTAB_BLOCKVECTOR (top_stack->cur_st);
+           = top_stack->cur_st->blockvector ();
 
          /* The next test should normally be true, but provides a
             hook for nested functions (which we don't want to make
        {
          /* Finished with procedure */
          const struct blockvector *bv
-           = SYMTAB_BLOCKVECTOR (top_stack->cur_st);
+           = top_stack->cur_st->blockvector ();
          struct mdebug_extra_func_info *e;
          struct block *cblock = top_stack->cur_block;
          struct type *ftype = top_stack->cur_type;
         FIXME, Maybe quit once we have found the right number of ext's?  */
       top_stack->cur_st = cust->primary_filetab ();
       top_stack->cur_block
-       = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (top_stack->cur_st),
+       = BLOCKVECTOR_BLOCK (top_stack->cur_st->blockvector (),
                             GLOBAL_BLOCK);
       top_stack->blocktype = stFile;
 
 {
   /* Cast away "const", but that's ok because we're building the
      symtab and blockvector here.  */
-  struct blockvector *bv = (struct blockvector *) SYMTAB_BLOCKVECTOR (s);
+  struct blockvector *bv = (struct blockvector *) s->blockvector ();
 
   bv = (struct blockvector *) xrealloc ((void *) bv,
                                        (sizeof (struct blockvector)
                                         + BLOCKVECTOR_NBLOCKS (bv)
                                         * sizeof (bv->block)));
-  if (bv != SYMTAB_BLOCKVECTOR (s))
+  if (bv != s->blockvector ())
     s->compunit ()->set_blockvector (bv);
 
   BLOCKVECTOR_BLOCK (bv, BLOCKVECTOR_NBLOCKS (bv)++) = b;
 {
   /* We have to cast away const here, but this is ok because we're
      constructing the blockvector in this code.  */
-  struct blockvector *bv = (struct blockvector *) SYMTAB_BLOCKVECTOR (s);
+  struct blockvector *bv = (struct blockvector *) s->blockvector ();
 
   if (BLOCKVECTOR_NBLOCKS (bv) <= FIRST_LOCAL_BLOCK)
     {
 
                              struct symtab *tem =
                                  lookup_symtab (copy.c_str ());
                              if (tem)
-                               $$ = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (tem),
+                               $$ = BLOCKVECTOR_BLOCK (tem->blockvector (),
                                                        STATIC_BLOCK);
                              else
                                error (_("No file or function \"%s\"."),
 
       struct symtab_and_line cursal = get_current_source_symtab_and_line ();
       if (cursal.symtab)
        expression_context_block
-         = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (cursal.symtab),
+         = BLOCKVECTOR_BLOCK (cursal.symtab->blockvector (),
                               STATIC_BLOCK);
       if (expression_context_block)
        expression_context_pc = BLOCK_ENTRY_PC (expression_context_block);
 
 
   STPY_REQUIRE_VALID (self, symtab);
 
-  blockvector = SYMTAB_BLOCKVECTOR (symtab);
+  blockvector = symtab->blockvector ();
   block = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
   return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
 }
 
   STPY_REQUIRE_VALID (self, symtab);
 
-  blockvector = SYMTAB_BLOCKVECTOR (symtab);
+  blockvector = symtab->blockvector ();
   block = BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK);
   return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
 }
 
   if (is_main_symtab_of_compunit_symtab (symtab))
     {
       fprintf_filtered (outfile, "\nBlockvector:\n\n");
-      bv = SYMTAB_BLOCKVECTOR (symtab);
+      bv = symtab->blockvector ();
       len = BLOCKVECTOR_NBLOCKS (bv);
       for (i = 0; i < len; i++)
        {
 
     m_language = language;
   }
 
+  const struct blockvector *blockvector () const;
+
   /* Unordered chain of all filetabs in the compunit,  with the exception
      that the "main" source file is the first entry in the list.  */
 
 
 using symtab_range = next_range<symtab>;
 
-#define SYMTAB_BLOCKVECTOR(symtab) \
-  (symtab->compunit ()->blockvector ())
 #define SYMTAB_OBJFILE(symtab) \
   (symtab->compunit ()->objfile ())
 #define SYMTAB_PSPACE(symtab) (SYMTAB_OBJFILE (symtab)->pspace)
 
 using compunit_symtab_range = next_range<compunit_symtab>;
 
+inline const struct blockvector *
+symtab::blockvector () const
+{
+  return this->compunit ()->blockvector ();
+}
+
 /* Return the language of CUST.  */
 
 extern enum language compunit_language (const struct compunit_symtab *cust);