From: Bernhard Reutner-Fischer Date: Sat, 13 May 2023 22:37:46 +0000 (+0200) Subject: analyzer: use _P() defines from tree.h X-Git-Tag: basepoints/gcc-15~9164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=778aca1b4f4ca8b72bcb1002d4e5ee0e402ffb0c;p=thirdparty%2Fgcc.git analyzer: use _P() defines from tree.h gcc/analyzer/ChangeLog: * region-model-manager.cc (get_code_for_cast): Use _P defines from tree.h. (region_model_manager::get_or_create_cast): Ditto. (region_model_manager::get_region_for_global): Ditto. * region-model.cc (region_model::get_lvalue_1): Ditto. * region.cc (decl_region::maybe_get_constant_value): Ditto. --- diff --git a/gcc/analyzer/region-model-manager.cc b/gcc/analyzer/region-model-manager.cc index fab5bba15d5f..3b95e432aba2 100644 --- a/gcc/analyzer/region-model-manager.cc +++ b/gcc/analyzer/region-model-manager.cc @@ -507,7 +507,7 @@ get_code_for_cast (tree dst_type, tree src_type) if (!src_type) return NOP_EXPR; - if (TREE_CODE (src_type) == REAL_TYPE) + if (SCALAR_FLOAT_TYPE_P (src_type)) { if (TREE_CODE (dst_type) == INTEGER_TYPE) return FIX_TRUNC_EXPR; @@ -531,9 +531,9 @@ region_model_manager::get_or_create_cast (tree type, const svalue *arg) return arg; /* Don't attempt to handle casts involving vector types for now. */ - if (TREE_CODE (type) == VECTOR_TYPE + if (VECTOR_TYPE_P (type) || (arg->get_type () - && TREE_CODE (arg->get_type ()) == VECTOR_TYPE)) + && VECTOR_TYPE_P (arg->get_type ()))) return get_or_create_unknown_svalue (type); enum tree_code op = get_code_for_cast (type, arg->get_type ()); @@ -1410,7 +1410,7 @@ region_model_manager::get_region_for_label (tree label) const decl_region * region_model_manager::get_region_for_global (tree expr) { - gcc_assert (TREE_CODE (expr) == VAR_DECL); + gcc_assert (VAR_P (expr)); decl_region **slot = m_globals_map.get (expr); if (slot) diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index fb81d43f91b2..3bb3df2f063e 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -2092,7 +2092,7 @@ region_model::get_lvalue_1 (path_var pv, region_model_context *ctxt) const { gcc_assert (TREE_CODE (expr) == SSA_NAME || TREE_CODE (expr) == PARM_DECL - || TREE_CODE (expr) == VAR_DECL + || VAR_P (expr) || TREE_CODE (expr) == RESULT_DECL); int stack_index = pv.m_stack_depth; diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc index a18bfa50d09b..8f0eb569b339 100644 --- a/gcc/analyzer/region.cc +++ b/gcc/analyzer/region.cc @@ -1162,7 +1162,7 @@ decl_region::get_stack_depth () const const svalue * decl_region::maybe_get_constant_value (region_model_manager *mgr) const { - if (TREE_CODE (m_decl) == VAR_DECL + if (VAR_P (m_decl) && DECL_IN_CONSTANT_POOL (m_decl) && DECL_INITIAL (m_decl) && TREE_CODE (DECL_INITIAL (m_decl)) == CONSTRUCTOR)