This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Use DECL_P more

Use DECL_P where appropriate.  No functional changes.

Bootstrapped/regtested on x86_64-linux, applying to trunk.

2015-05-20  Marek Polacek  <>

	* gimple-fold.c (fold_const_aggregate_ref_1): Use DECL_P.
	* gimplify.c (gimplify_modify_expr_rhs): Likewise.

	* c-ada-spec.c (dump_sloc): Use DECL_P.

diff --git gcc/c-family/c-ada-spec.c gcc/c-family/c-ada-spec.c
index 8d6e014..b4e159e 100644
--- gcc/c-family/c-ada-spec.c
+++ gcc/c-family/c-ada-spec.c
@@ -1629,7 +1629,7 @@ dump_sloc (pretty_printer *buffer, tree node)
   xloc.file = NULL;
-  if (TREE_CODE_CLASS (TREE_CODE (node)) == tcc_declaration)
+  if (DECL_P (node))
     xloc = expand_location (DECL_SOURCE_LOCATION (node));
   else if (EXPR_HAS_LOCATION (node))
     xloc = expand_location (EXPR_LOCATION (node));
diff --git gcc/gimple-fold.c gcc/gimple-fold.c
index 2cc5628..4bef350 100644
--- gcc/gimple-fold.c
+++ gcc/gimple-fold.c
@@ -5518,7 +5518,7 @@ fold_const_aggregate_ref_1 (tree t, tree (*valueize) (tree))
     return NULL_TREE;
-  if (TREE_CODE_CLASS (TREE_CODE (t)) == tcc_declaration)
+  if (DECL_P (t))
     return get_symbol_constant_value (t);
   tem = fold_read_from_constant_string (t);
diff --git gcc/gimplify.c gcc/gimplify.c
index c5eccf0..2720d02 100644
--- gcc/gimplify.c
+++ gcc/gimplify.c
@@ -4222,7 +4222,7 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p,
 		if (TREE_THIS_VOLATILE (t) != volatile_p)
-		    if (TREE_CODE_CLASS (TREE_CODE (t)) == tcc_declaration)
+		    if (DECL_P (t))
 		      t = build_simple_mem_ref_loc (EXPR_LOCATION (*from_p),
 						    build_fold_addr_expr (t));
 		    if (REFERENCE_CLASS_P (t))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]