aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2013-03-29 16:09:35 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2013-03-29 16:09:35 +0000
commit5a6ccc943fa6c7f121a47e96a19d73a7531de311 (patch)
treeeffb9d381a62e67766863cbbe83fd7aac2b98280 /gcc/cp/semantics.c
parent39385fa637d08b4e64f9c70f690954a302928ce0 (diff)
downloadgcc-5a6ccc943fa6c7f121a47e96a19d73a7531de311.zip
gcc-5a6ccc943fa6c7f121a47e96a19d73a7531de311.tar.gz
gcc-5a6ccc943fa6c7f121a47e96a19d73a7531de311.tar.bz2
tree.h (VAR_P): New.
* tree.h (VAR_P): New. cp/ * call.c (build_java_interface_fn_ref): Likewise. (make_temporary_var_for_ref_to_temp): Likewise. * class.c (check_field_decls): Likewise. (layout_class_type): Likewise. (finish_struct_1): Likewise. (fixed_type_or_null): Likewise. (get_vtbl_decl_for_binfo): Likewise. * cp-gimplify.c (omp_var_to_track): Likewise. (cp_genericize_r): Likewise. * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise. * cp-tree.h (LANG_DECL_HAS_MIN): Likewise. (DECL_DISCRIMINATOR_P): Likewise. * decl.c (poplevel): Likewise. (decls_match): Likewise. (duplicate_decls): Likewise. (decl_jump_unsafe): Likewise. (start_decl): Likewise. (check_for_uninitialized_const_var): Likewise. (make_rtl_for_nonlocal_decl): Likewise. (cp_finish_decl): Likewise. (expand_static_init): Likewise. (local_variable_p): Likewise. (maybe_register_incomplete_var): Likewise. * decl2.c (grokfield): Likewise. (comdat_linkage): Likewise. (determine_visibility): Likewise. (import_export_decl): Likewise. (prune_vars_needing_no_initialization): Likewise. (decl_maybe_constant_var_p): Likewise. * error.c (dump_simple_decl): Likewise. (dump_template_decl): Likewise. (cp_printer): Likewise. * except.c (build_throw): Likewise. * init.c (build_vtbl_address): Likewise. (member_init_ok_or_else): Likewise. (build_aggr_init): Likewise. (expand_aggr_init_1): Likewise. (build_offset_ref): Likewise. (constant_value_1): Likewise. * mangle.c (write_mangled_name): Likewise. (write_prefix): Likewise. * name-lookup.c (supplement_binding_1): Likewise. (add_decl_to_level): Likewise. (pushdecl_maybe_friend_1): Likewise. (check_for_out_of_scope_variable): Likewise. (validate_nonmember_using_decl): Likewise. (lookup_name_innermost_nonclass_level_1): Likewise. (lookup_arg_dependent_1): Likewise. * parser.c (cp_parser_lambda_introducer): Likewise. (cp_parser_template_argument): Likewise. (cp_parser_single_declaration): Likewise. * pt.c (convert_nontype_argument): Likewise. (instantiate_class_template_1): Likewise. (tsubst_decl): Likewise. (tsubst_expr): Likewise. (do_decl_instantiation): Likewise. (do_type_instantiation): Likewise. (regenerate_decl_from_template): Likewise. (always_instantiate_p): Likewise. (instantiate_decl): Likewise. (type_dependent_expression_p): Likewise. (build_non_dependent_expr): Likewise. * repo.c (repo_emit_p): Likewise. * rtti.c (build_dynamic_cast_1): Likewise. * search.c (shared_member_p): Likewise. * semantics.c (outer_var_p): Likewise. (finish_id_expression): Likewise. (finish_omp_clauses): Likewise. (finish_decltype_type): Likewise. (ensure_literal_type_for_constexpr_object): Likewise. * tree.c (lvalue_kind): Likewise. (bot_replace): Likewise. (cp_tree_equal): Likewise. (handle_init_priority_attribute): Likewise. (decl_storage_duration): Likewise. * typeck.c (cxx_sizeof_expr): Likewise. (cxx_alignof_expr): Likewise. (decay_conversion): Likewise. (build_class_member_access_expr): Likewise. (cp_build_array_ref): Likewise. (cxx_mark_addressable): Likewise. (maybe_warn_about_returning_address_of_local): Likewise. (check_return_expr): Likewise. * typeck2.c (cxx_readonly_error): Likewise. (abstract_virtuals_error_sfinae): Likewise. (cxx_incomplete_type_diagnostic): Likewise. From-SVN: r197240
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 2fe2908..8bd7612 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2887,7 +2887,7 @@ baselink_for_fns (tree fns)
static bool
outer_var_p (tree decl)
{
- return ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL)
+ return ((VAR_P (decl) || TREE_CODE (decl) == PARM_DECL)
&& DECL_FUNCTION_SCOPE_P (decl)
&& (DECL_CONTEXT (decl) != current_function_decl
|| parsing_nsdmi ()));
@@ -3083,7 +3083,7 @@ finish_id_expression (tree id_expression,
}
else
{
- error (TREE_CODE (decl) == VAR_DECL
+ error (VAR_P (decl)
? G_("use of local variable with automatic storage from containing function")
: G_("use of parameter from containing function"));
error (" %q+#D declared here", decl);
@@ -3259,7 +3259,7 @@ finish_id_expression (tree id_expression,
/* If we found a variable, then name lookup during the
instantiation will always resolve to the same VAR_DECL
(or an instantiation thereof). */
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
|| TREE_CODE (decl) == PARM_DECL)
{
mark_used (decl);
@@ -3303,7 +3303,7 @@ finish_id_expression (tree id_expression,
/* Mark variable-like entities as used. Functions are similarly
marked either below or after overload resolution. */
- if ((TREE_CODE (decl) == VAR_DECL
+ if ((VAR_P (decl)
|| TREE_CODE (decl) == PARM_DECL
|| TREE_CODE (decl) == CONST_DECL
|| TREE_CODE (decl) == RESULT_DECL)
@@ -3328,7 +3328,7 @@ finish_id_expression (tree id_expression,
}
tree wrap;
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& !cp_unevaluated_operand
&& DECL_THREAD_LOCAL_P (decl)
&& (wrap = get_tls_wrapper_fn (decl)))
@@ -4061,7 +4061,7 @@ finish_omp_clauses (tree clauses)
goto check_dup_generic;
check_dup_generic:
t = OMP_CLAUSE_DECL (c);
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
if (processing_template_decl)
break;
@@ -4084,7 +4084,7 @@ finish_omp_clauses (tree clauses)
case OMP_CLAUSE_FIRSTPRIVATE:
t = OMP_CLAUSE_DECL (c);
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
if (processing_template_decl)
break;
@@ -4106,7 +4106,7 @@ finish_omp_clauses (tree clauses)
case OMP_CLAUSE_LASTPRIVATE:
t = OMP_CLAUSE_DECL (c);
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
if (processing_template_decl)
break;
@@ -4258,7 +4258,7 @@ finish_omp_clauses (tree clauses)
t = OMP_CLAUSE_DECL (c);
if (processing_template_decl
- && TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ && !VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
pc = &OMP_CLAUSE_CHAIN (c);
continue;
@@ -4298,7 +4298,7 @@ finish_omp_clauses (tree clauses)
break;
case OMP_CLAUSE_COPYIN:
- if (TREE_CODE (t) != VAR_DECL || !DECL_THREAD_LOCAL_P (t))
+ if (!VAR_P (t) || !DECL_THREAD_LOCAL_P (t))
{
error ("%qE must be %<threadprivate%> for %<copyin%>", t);
remove = true;
@@ -4325,7 +4325,7 @@ finish_omp_clauses (tree clauses)
{
const char *share_name = NULL;
- if (TREE_CODE (t) == VAR_DECL && DECL_THREAD_LOCAL_P (t))
+ if (VAR_P (t) && DECL_THREAD_LOCAL_P (t))
share_name = "threadprivate";
else switch (cxx_omp_predetermined_sharing (t))
{
@@ -4392,7 +4392,7 @@ finish_omp_threadprivate (tree vars)
if (error_operand_p (v))
;
- else if (TREE_CODE (v) != VAR_DECL)
+ else if (!VAR_P (v))
error ("%<threadprivate%> %qD is not file, namespace "
"or block scope variable", v);
/* If V had already been marked threadprivate, it doesn't matter
@@ -5295,7 +5295,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p,
/* To get the size of a static data member declared as an array of
unknown bound, we need to instantiate it. */
- if (TREE_CODE (expr) == VAR_DECL
+ if (VAR_P (expr)
&& VAR_HAD_UNKNOWN_BOUND (expr)
&& DECL_TEMPLATE_INSTANTIATION (expr))
instantiate_decl (expr, /*defer_ok*/true, /*expl_inst_mem*/false);
@@ -5727,7 +5727,7 @@ tree
ensure_literal_type_for_constexpr_object (tree decl)
{
tree type = TREE_TYPE (decl);
- if (TREE_CODE (decl) == VAR_DECL && DECL_DECLARED_CONSTEXPR_P (decl)
+ if (VAR_P (decl) && DECL_DECLARED_CONSTEXPR_P (decl)
&& !processing_template_decl)
{
if (CLASS_TYPE_P (type) && !COMPLETE_TYPE_P (complete_type (type)))
@@ -9200,7 +9200,7 @@ capture_decltype (tree decl)
bool
is_capture_proxy (tree decl)
{
- return (TREE_CODE (decl) == VAR_DECL
+ return (VAR_P (decl)
&& DECL_HAS_VALUE_EXPR_P (decl)
&& !DECL_ANON_UNION_VAR_P (decl)
&& LAMBDA_FUNCTION_P (DECL_CONTEXT (decl)));