diff options
Diffstat (limited to 'gcc/analyzer/region.cc')
-rw-r--r-- | gcc/analyzer/region.cc | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc index efbbca0..e27fc6e 100644 --- a/gcc/analyzer/region.cc +++ b/gcc/analyzer/region.cc @@ -124,7 +124,7 @@ region_offset::dump (bool simple) const } /* An svalue that matches the pattern (BASE * FACTOR) + OFFSET - where FACTOR or OFFSET could be the identity (represented as NULL). */ + where FACTOR or OFFSET could be the identity (represented as nullptr). */ struct linear_op { @@ -231,7 +231,7 @@ struct linear_op { *out = linear_op (binop_sval.get_arg0 (), binop_sval.get_arg1 (), - NULL); + nullptr); return true; } else if (binop_sval.get_op () == PLUS_EXPR) @@ -250,7 +250,7 @@ struct linear_op } *out = linear_op (binop_sval.get_arg0 (), - NULL, + nullptr, binop_sval.get_arg1 ()); return true; } @@ -276,8 +276,8 @@ operator< (const region_offset &a, const region_offset &b) const svalue &a_sval = *a.get_symbolic_byte_offset (); const svalue &b_sval = *b.get_symbolic_byte_offset (); - linear_op op_a (NULL, NULL, NULL); - linear_op op_b (NULL, NULL, NULL); + linear_op op_a (nullptr, nullptr, nullptr); + linear_op op_b (nullptr, nullptr, nullptr); if (linear_op::from_svalue (a_sval, &op_a) && linear_op::from_svalue (b_sval, &op_b)) { @@ -318,8 +318,8 @@ operator<= (const region_offset &a, const region_offset &b) const svalue &a_sval = *a.get_symbolic_byte_offset (); const svalue &b_sval = *b.get_symbolic_byte_offset (); - linear_op op_a (NULL, NULL, NULL); - linear_op op_b (NULL, NULL, NULL); + linear_op op_a (nullptr, nullptr, nullptr); + linear_op op_b (nullptr, nullptr, nullptr); if (linear_op::from_svalue (a_sval, &op_a) && linear_op::from_svalue (b_sval, &op_b)) { @@ -448,7 +448,7 @@ region::descendent_of_p (const region *elder) const } /* If this region is a frame_region, or a descendent of one, return it. - Otherwise return NULL. */ + Otherwise return nullptr. */ const frame_region * region::maybe_get_frame_region () const @@ -460,7 +460,7 @@ region::maybe_get_frame_region () const return frame_reg; iter = iter->get_parent_region (); } - return NULL; + return nullptr; } /* Get the memory space of this region. */ @@ -609,7 +609,7 @@ region::calc_initial_value_at_main (region_model_manager *mgr) const } /* If this region is a decl_region, return the decl. - Otherwise return NULL. */ + Otherwise return NULL_TREE. */ tree region::maybe_get_decl () const @@ -769,7 +769,7 @@ get_field_at_bit_offset (tree record_type, bit_offset_t bit_offset) { gcc_assert (TREE_CODE (record_type) == RECORD_TYPE); if (bit_offset < 0) - return NULL; + return nullptr; /* Find the first field that has an offset > BIT_OFFSET, then return the one preceding it. @@ -879,7 +879,7 @@ region::calc_offset (region_model_manager *mgr) const { const region *iter_region = this; bit_offset_t accum_bit_offset = 0; - const svalue *accum_byte_sval = NULL; + const svalue *accum_byte_sval = nullptr; while (iter_region) { @@ -1155,7 +1155,7 @@ region::is_named_decl_p (const char *decl_name) const region::region (complexity c, symbol::id_t id, const region *parent, tree type) : symbol (c, id), m_parent (parent), m_type (type), - m_cached_offset (NULL), m_cached_init_sval_at_main (NULL) + m_cached_offset (nullptr), m_cached_init_sval_at_main (nullptr) { gcc_assert (type == NULL_TREE || TYPE_P (type)); } @@ -1548,7 +1548,7 @@ heap_region::print_dump_widget_label (pretty_printer *pp) const /* root_region's ctor. */ root_region::root_region (symbol::id_t id) -: region (complexity (1, 1), id, NULL, NULL_TREE) +: region (complexity (1, 1), id, nullptr, NULL_TREE) { } @@ -1680,7 +1680,7 @@ decl_region::print_dump_widget_label (pretty_printer *pp) const int decl_region::get_stack_depth () const { - if (get_parent_region () == NULL) + if (get_parent_region () == nullptr) return 0; if (const frame_region *frame_reg = get_parent_region ()->dyn_cast_frame_region ()) @@ -1690,7 +1690,7 @@ decl_region::get_stack_depth () const /* If the underlying decl is in the global constant pool, return an svalue representing the constant value. - Otherwise return NULL. */ + Otherwise return nullptr. */ const svalue * decl_region::maybe_get_constant_value (region_model_manager *mgr) const @@ -1700,7 +1700,7 @@ decl_region::maybe_get_constant_value (region_model_manager *mgr) const && DECL_INITIAL (m_decl) && TREE_CODE (DECL_INITIAL (m_decl)) == CONSTRUCTOR) return get_svalue_for_constructor (DECL_INITIAL (m_decl), mgr); - return NULL; + return nullptr; } /* Implementation of decl_region::get_svalue_for_constructor @@ -1742,7 +1742,7 @@ decl_region::get_svalue_for_constructor (tree ctor, "main" (either based on DECL_INITIAL, or implicit initialization to zero. - Return NULL if there is a problem. */ + Return nullptr if there is a problem. */ const svalue * decl_region::get_svalue_for_initializer (region_model_manager *mgr) const @@ -1753,10 +1753,10 @@ decl_region::get_svalue_for_initializer (region_model_manager *mgr) const /* If we have an "extern" decl then there may be an initializer in another TU. */ if (DECL_EXTERNAL (m_decl)) - return NULL; + return nullptr; if (empty_p ()) - return NULL; + return nullptr; /* Implicit initialization to zero; use a compound_svalue for it. Doing so requires that we have a concrete binding for this region, @@ -1765,12 +1765,12 @@ decl_region::get_svalue_for_initializer (region_model_manager *mgr) const const binding_key *binding = binding_key::make (mgr->get_store_manager (), this); if (binding->symbolic_p ()) - return NULL; + return nullptr; /* If we don't care about tracking the content of this region, then it's unused, and the value doesn't matter. */ if (!tracked_p ()) - return NULL; + return nullptr; binding_cluster c (this); c.zero_fill_region (mgr->get_store_manager (), this); @@ -1781,14 +1781,14 @@ decl_region::get_svalue_for_initializer (region_model_manager *mgr) const /* LTO can write out error_mark_node as the DECL_INITIAL for simple scalar values (to avoid writing out an extra section). */ if (init == error_mark_node) - return NULL; + return nullptr; if (TREE_CODE (init) == CONSTRUCTOR) return get_svalue_for_constructor (init, mgr); /* Reuse the get_rvalue logic from region_model. */ region_model m (mgr); - return m.get_rvalue (path_var (init, 0), NULL); + return m.get_rvalue (path_var (init, 0), nullptr); } /* Subroutine of symnode_requires_tracking_p; return true if REF @@ -1802,7 +1802,7 @@ ipa_ref_requires_tracking (ipa_ref *ref) if (ref->use != IPA_REF_ADDR) return true; - if (ref->stmt == NULL) + if (ref->stmt == nullptr) return true; switch (ref->stmt->code) @@ -1812,12 +1812,12 @@ ipa_ref_requires_tracking (ipa_ref *ref) case GIMPLE_CALL: { cgraph_node *caller_cnode = dyn_cast <cgraph_node *> (ref->referring); - if (caller_cnode == NULL) + if (caller_cnode == nullptr) return true; cgraph_edge *edge = caller_cnode->get_edge (ref->stmt); if (!edge) return true; - if (edge->callee == NULL) + if (edge->callee == nullptr) return true; /* e.g. call through function ptr. */ if (edge->callee->definition) return true; @@ -1852,7 +1852,7 @@ symnode_requires_tracking_p (symtab_node *symnode) if (symnode->externally_visible) return true; tree context_fndecl = DECL_CONTEXT (symnode->decl); - if (context_fndecl == NULL) + if (context_fndecl == nullptr) return true; if (TREE_CODE (context_fndecl) != FUNCTION_DECL) return true; |