diff options
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 7c54f24..0a0ff70 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -362,7 +362,6 @@ public: and NULL otherwise. */ static inline symtab_node *get (const_tree decl) { -#ifdef ENABLE_CHECKING /* Check that we are called for sane type of object - functions and static or external variables. */ gcc_checking_assert (TREE_CODE (decl) == FUNCTION_DECL @@ -374,7 +373,6 @@ public: memcpy/memset on the tree nodes. */ gcc_checking_assert (!decl->decl_with_vis.symtab_node || decl->decl_with_vis.symtab_node->decl == decl); -#endif return decl->decl_with_vis.symtab_node; } @@ -398,6 +396,9 @@ public: /* Verify symbol table for internal consistency. */ static DEBUG_FUNCTION void verify_symtab_nodes (void); + /* Perform internal consistency checks, if they are enabled. */ + static inline void checking_verify_symtab_nodes (void); + /* Type of the symbol. */ ENUM_BITFIELD (symtab_type) type : 8; @@ -558,6 +559,13 @@ private: symtab_node *ultimate_alias_target_1 (enum availability *avail = NULL); }; +inline void +symtab_node::checking_verify_symtab_nodes (void) +{ + if (flag_checking) + symtab_node::verify_symtab_nodes (); +} + /* Walk all aliases for NODE. */ #define FOR_EACH_ALIAS(node, alias) \ for (unsigned x_i = 0; node->iterate_direct_aliases (x_i, alias); x_i++) @@ -1205,6 +1213,9 @@ public: /* Verify whole cgraph structure. */ static void DEBUG_FUNCTION verify_cgraph_nodes (void); + /* Verify cgraph, if consistency checking is enabled. */ + static inline void checking_verify_cgraph_nodes (void); + /* Worker to bring NODE local. */ static bool make_local (cgraph_node *node, void *); @@ -2753,6 +2764,15 @@ cgraph_node::can_remove_if_no_direct_calls_and_refs_p (void) return true; } +/* Verify cgraph, if consistency checking is enabled. */ + +inline void +cgraph_node::checking_verify_cgraph_nodes (void) +{ + if (flag_checking) + cgraph_node::verify_cgraph_nodes (); +} + /* Return true when variable can be removed from variable pool if all direct calls are eliminated. */ |