const struct block *static_block () const;
+ /* Return true if this block is a static block. */
+
+ bool is_static_block () const
+ {
+ const block *sup = superblock ();
+ if (sup == nullptr)
+ return false;
+ return sup->is_global_block ();
+ }
+
/* Return the static block associated with block. */
const struct block *global_block () const;
+ /* Return true if this block is a global block. */
+
+ bool is_global_block () const
+ { return superblock () == nullptr; }
+
/* Set the compunit of this block, which must be a global block. */
void set_compunit_symtab (struct compunit_symtab *);
tests that embed global/static symbols with null location lists.
We want to get <optimized out> instead of <frame required> when evaluating
them so return a frame instead of raising an error. */
- else if (var_block == var_block->global_block ()
- || var_block == var_block->static_block ())
+ else if (var_block->is_global_block () || var_block->is_static_block ())
return frame;
/* We have to handle the "my_func::my_local_var" notation. This requires us
/* If we failed to find the proper frame, fallback to the heuristic
method below. */
- else if (frame_block == frame_block->global_block ())
+ else if (frame_block->is_global_block ())
{
frame = NULL;
break;