From 89d684bba353ee89c83c51a8cffc1f1cf5366ad5 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Thu, 22 Nov 2001 02:33:02 +0000 Subject: tree-dump.c: Rename from c-dump.c. * tree-dump.c: Rename from c-dump.c. Include c-tree.h, not c-common.h. (lang_type_quals): Declare. (dequeue_and_dump): Use lang_hooks.tree_dump.type_quals function to retrieve language-specific qualifiers for a type node, instead of C_TYPE_QUALS. Likewise for lang_hooks.tree_dump.dump_tree instead of lang_dump_tree. * tree-dump.h: Rename from c-dump.h. * c-common.h (C_TYPE_QUALS): Removed. Move declarations for tree-dump.c interface to... * tree.h: ... here. Remove lang_dump_tree. * langhooks.h (struct lang_hooks_for_tree_dump): New. (struct lang_hooks): Add tree_dump hooks. * langhooks.c (lhd_tree_dump_dump_tree): New function. (lhd_tree_dump_type_quals): New function. * langhooks-def.h (lhd_tree_dump_dump_tree, lhd_tree_dump_type_quals): Declare. (LANG_HOOKS_INITIALIZER): Add tree_dump hooks. * Makefile.in: Move tree-dump.o to language-independent back-end. cp: * cp-tree.h (CP_TYPE_QUALS): Removed. * decl.c (cxx_init_decl_processing): Don't set lang_dump_tree. * cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN. * dump.c (cp_dump_tree): Use void* dump_info argument to match lang-hooks prototype. * call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to CP_TYPE_QUALS changed to cp_type_quals. * Make-lang.in: References to c-dump.h changed to tree-dump.h. (CXX_C_OBJS): Remove c-dump.o. From-SVN: r47257 --- gcc/cp/ChangeLog | 14 ++++++++++++++ gcc/cp/Make-lang.in | 4 ++-- gcc/cp/call.c | 8 ++++---- gcc/cp/cp-lang.c | 4 ++++ gcc/cp/cp-tree.h | 14 +++++--------- gcc/cp/cvt.c | 4 ++-- gcc/cp/decl.c | 17 ++++++++--------- gcc/cp/dump.c | 7 ++++--- gcc/cp/init.c | 2 +- gcc/cp/mangle.c | 4 ++-- gcc/cp/method.c | 6 +++--- gcc/cp/pt.c | 20 ++++++++++---------- gcc/cp/rtti.c | 6 +++--- gcc/cp/semantics.c | 2 +- gcc/cp/tree.c | 6 +++--- gcc/cp/typeck.c | 37 +++++++++++++++++++------------------ gcc/cp/typeck2.c | 4 ++-- 17 files changed, 87 insertions(+), 72 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9637ab5..a3856da 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2001-11-22 Bryce McKinlay + + * cp-tree.h (CP_TYPE_QUALS): Removed. + * decl.c (cxx_init_decl_processing): Don't set lang_dump_tree. + * cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and + LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN. + * dump.c (cp_dump_tree): Use void* dump_info argument to match + lang-hooks prototype. + * call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c, + rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to + CP_TYPE_QUALS changed to cp_type_quals. + * Make-lang.in: References to c-dump.h changed to tree-dump.h. + (CXX_C_OBJS): Remove c-dump.o. + 2001-11-21 Mark Mitchell PR c++/3637 diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 6bf274c..3a1f149 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -96,7 +96,7 @@ $(DEMANGLER_PROG): cxxmain.o underscore.o $(LIBDEPS) # The compiler itself. # Shared with C front end: CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \ - c-dump.o $(CXX_TARGET_OBJS) + $(CXX_TARGET_OBJS) # Language-specific object files. CXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \ @@ -279,7 +279,7 @@ cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H) diagnostic.h cp/semantics.o: cp/semantics.c $(CXX_TREE_H) cp/lex.h except.h toplev.h \ flags.h $(GGC_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \ tree-inline.h -cp/dump.o: cp/dump.c $(CXX_TREE_H) c-dump.h +cp/dump.o: cp/dump.c $(CXX_TREE_H) tree-dump.h cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \ input.h $(PARAMS_H) debug.h tree-inline.h cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 4d06dc5..46aacca 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -777,7 +777,7 @@ standard_conversion (to, from, expr) { from = build_pointer_type (cp_build_qualified_type (void_type_node, - CP_TYPE_QUALS (TREE_TYPE (from)))); + cp_type_quals (TREE_TYPE (from)))); conv = build_conv (PTR_CONV, from, conv); } else if (ufcode == OFFSET_TYPE && utcode == OFFSET_TYPE) @@ -803,7 +803,7 @@ standard_conversion (to, from, expr) { from = cp_build_qualified_type (TREE_TYPE (to), - CP_TYPE_QUALS (TREE_TYPE (from))); + cp_type_quals (TREE_TYPE (from))); from = build_pointer_type (from); conv = build_conv (PTR_CONV, from, conv); } @@ -838,10 +838,10 @@ standard_conversion (to, from, expr) || !same_type_p (TREE_TYPE (fromfn), TREE_TYPE (tofn)) || !compparms (TREE_CHAIN (TYPE_ARG_TYPES (fromfn)), TREE_CHAIN (TYPE_ARG_TYPES (tofn))) - || CP_TYPE_QUALS (fbase) != CP_TYPE_QUALS (tbase)) + || cp_type_quals (fbase) != cp_type_quals (tbase)) return 0; - from = cp_build_qualified_type (tbase, CP_TYPE_QUALS (fbase)); + from = cp_build_qualified_type (tbase, cp_type_quals (fbase)); from = build_cplus_method_type (from, TREE_TYPE (fromfn), TREE_CHAIN (TYPE_ARG_TYPES (fromfn))); from = build_ptrmemfunc_type (build_pointer_type (from)); diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index 08ecf5b..dbca8af 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -78,6 +78,10 @@ static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree)); cp_copy_res_decl_for_inlining #undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P #define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p +#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN +#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN cp_dump_tree +#undef LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN +#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN cp_type_quals /* Each front end provides its own hooks, for toplev.c. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index b485434..4b39e80 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1128,28 +1128,24 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* True if this a "Java" type, defined in 'extern "Java"'. */ #define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3(NODE) -/* The type qualifiers for this type, including the qualifiers on the - elements for an array type. */ -#define CP_TYPE_QUALS(NODE) C_TYPE_QUALS (NODE) - /* Nonzero if this type is const-qualified. */ #define CP_TYPE_CONST_P(NODE) \ - ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_CONST) != 0) + ((cp_type_quals (NODE) & TYPE_QUAL_CONST) != 0) /* Nonzero if this type is volatile-qualified. */ #define CP_TYPE_VOLATILE_P(NODE) \ - ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_VOLATILE) != 0) + ((cp_type_quals (NODE) & TYPE_QUAL_VOLATILE) != 0) /* Nonzero if this type is restrict-qualified. */ #define CP_TYPE_RESTRICT_P(NODE) \ - ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_RESTRICT) != 0) + ((cp_type_quals (NODE) & TYPE_QUAL_RESTRICT) != 0) /* Nonzero if this type is const-qualified, but not volatile-qualified. Other qualifiers are ignored. This macro is used to test whether or not it is OK to bind an rvalue to a reference. */ #define CP_TYPE_CONST_NON_VOLATILE_P(NODE) \ - ((CP_TYPE_QUALS (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)) \ + ((cp_type_quals (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)) \ == TYPE_QUAL_CONST) #define FUNCTION_ARG_CHAIN(NODE) \ @@ -4341,7 +4337,7 @@ extern tree mangle_guard_variable PARAMS ((tree)); extern tree mangle_ref_init_variable PARAMS ((tree)); /* in dump.c */ -extern int cp_dump_tree PARAMS ((dump_info_p, tree)); +extern int cp_dump_tree PARAMS ((void *, tree)); /* -- end of C++ */ diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 960552c8..3ab60b6 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -657,7 +657,7 @@ convert_pointer_to_real (binfo, expr) } ptr_type = cp_build_qualified_type (type, - CP_TYPE_QUALS (TREE_TYPE (intype))); + cp_type_quals (TREE_TYPE (intype))); ptr_type = build_pointer_type (ptr_type); if (same_type_p (ptr_type, TYPE_MAIN_VARIANT (intype))) return expr; @@ -1267,7 +1267,7 @@ type_promotes_to (type) if (type == error_mark_node) return error_mark_node; - type_quals = CP_TYPE_QUALS (type); + type_quals = cp_type_quals (type); type = TYPE_MAIN_VARIANT (type); /* bool always promotes to int (not unsigned), even if it's the same diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f7448f5..6fdb1c4 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6408,7 +6408,6 @@ cxx_init_decl_processing () free_lang_status = &pop_cp_function_context; mark_lang_status = &mark_cp_function_context; lang_safe_from_p = &c_safe_from_p; - lang_dump_tree = &cp_dump_tree; lang_missing_noreturn_ok_p = &cp_missing_noreturn_ok_p; cp_parse_init (); @@ -9206,7 +9205,7 @@ build_ptrmemfunc_type (type) /* Make sure that we always have the unqualified pointer-to-member type first. */ - if (CP_TYPE_QUALS (type) != TYPE_UNQUALIFIED) + if (cp_type_quals (type) != TYPE_UNQUALIFIED) unqualified_variant = build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type)); @@ -9229,9 +9228,9 @@ build_ptrmemfunc_type (type) type, set the TYPE_MAIN_VARIANT for this type to be the unqualified type. Since they are actually RECORD_TYPEs that are not variants of each other, we must do this manually. */ - if (CP_TYPE_QUALS (type) != TYPE_UNQUALIFIED) + if (cp_type_quals (type) != TYPE_UNQUALIFIED) { - t = build_qualified_type (t, CP_TYPE_QUALS (type)); + t = build_qualified_type (t, cp_type_quals (type)); TYPE_MAIN_VARIANT (t) = unqualified_variant; TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (unqualified_variant); TYPE_NEXT_VARIANT (unqualified_variant) = t; @@ -10159,7 +10158,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) { RIDBIT_RESET (RID_LONG, specbits); type = build_qualified_type (long_double_type_node, - CP_TYPE_QUALS (type)); + cp_type_quals (type)); } /* Check all other uses of type modifiers. */ @@ -11129,7 +11128,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) && TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL && TYPE_ANONYMOUS_P (type) - && CP_TYPE_QUALS (type) == TYPE_UNQUALIFIED) + && cp_type_quals (type) == TYPE_UNQUALIFIED) { tree oldname = TYPE_NAME (type); tree t; @@ -13539,7 +13538,7 @@ start_function (declspecs, declarator, attrs, flags) { DECL_RESULT (decl1) = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (restype)); - c_apply_type_quals_to_decl (CP_TYPE_QUALS (restype), + c_apply_type_quals_to_decl (cp_type_quals (restype), DECL_RESULT (decl1)); } } @@ -14469,14 +14468,14 @@ revert_static_member_fn (decl) tree function = TREE_TYPE (decl); tree args = TYPE_ARG_TYPES (function); - if (CP_TYPE_QUALS (TREE_TYPE (TREE_VALUE (args))) + if (cp_type_quals (TREE_TYPE (TREE_VALUE (args))) != TYPE_UNQUALIFIED) cp_error ("static member function `%#D' declared with type qualifiers", decl); args = TREE_CHAIN (args); tmp = build_function_type (TREE_TYPE (function), args); - tmp = build_qualified_type (tmp, CP_TYPE_QUALS (function)); + tmp = build_qualified_type (tmp, cp_type_quals (function)); tmp = build_exception_variant (tmp, TYPE_RAISES_EXCEPTIONS (function)); TREE_TYPE (decl) = tmp; diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index dea990a..98c1fc4 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. */ #include "system.h" #include "tree.h" #include "cp-tree.h" -#include "c-dump.h" +#include "tree-dump.h" static void dump_access PARAMS ((dump_info_p, tree)); @@ -208,11 +208,12 @@ dump_op (di, t) } int -cp_dump_tree (di, t) - dump_info_p di; +cp_dump_tree (dump_info, t) + void *dump_info; tree t; { enum tree_code code; + dump_info_p di = (dump_info_p) dump_info; /* Figure out what kind of node this is. */ code = TREE_CODE (t); diff --git a/gcc/cp/init.c b/gcc/cp/init.c index fdb3557..ffbe822 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1177,7 +1177,7 @@ build_aggr_init (exp, init, flags) cp_error ("bad array initializer"); return error_mark_node; } - if (CP_TYPE_QUALS (type) != TYPE_UNQUALIFIED) + if (cp_type_quals (type) != TYPE_UNQUALIFIED) { TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type); if (init) diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 5466ca9..a0260e1 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -509,7 +509,7 @@ find_substitution (node) std::basic_string , std::allocator > . */ - if (CP_TYPE_QUALS (type) == TYPE_UNQUALIFIED + if (cp_type_quals (type) == TYPE_UNQUALIFIED && CLASSTYPE_USE_TEMPLATE (type)) { tree args = CLASSTYPE_TI_ARGS (type); @@ -535,7 +535,7 @@ find_substitution (node) /* Check for basic_{i,o,io}stream. */ if (TYPE_P (node) - && CP_TYPE_QUALS (type) == TYPE_UNQUALIFIED + && cp_type_quals (type) == TYPE_UNQUALIFIED && CLASS_TYPE_P (type) && CLASSTYPE_USE_TEMPLATE (type) && CLASSTYPE_TEMPLATE_INFO (type) != NULL) diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 24fd379..4de7605 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -551,7 +551,7 @@ do_build_copy_constructor (fndecl) tree binfos = TYPE_BINFO_BASETYPES (current_class_type); tree member_init_list = NULL_TREE; tree base_init_list = NULL_TREE; - int cvquals = CP_TYPE_QUALS (TREE_TYPE (parm)); + int cvquals = cp_type_quals (TREE_TYPE (parm)); int i; /* Initialize all the base-classes with the parameter converted to @@ -640,7 +640,7 @@ do_build_assign_ref (fndecl) tree fields = TYPE_FIELDS (current_class_type); int n_bases = CLASSTYPE_N_BASECLASSES (current_class_type); tree binfos = TYPE_BINFO_BASETYPES (current_class_type); - int cvquals = CP_TYPE_QUALS (TREE_TYPE (parm)); + int cvquals = cp_type_quals (TREE_TYPE (parm)); int i; for (i = 0; i < n_bases; ++i) @@ -919,7 +919,7 @@ locate_copy (type, client_) continue; if (!sufficient_parms_p (TREE_CHAIN (parms))) continue; - quals = CP_TYPE_QUALS (src_type); + quals = cp_type_quals (src_type); if (client->quals & ~quals) continue; excess = quals & ~client->quals; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f80392a..8273e16 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5905,7 +5905,7 @@ tsubst_decl (t, args, type) { r = copy_node (t); TREE_TYPE (r) = type; - c_apply_type_quals_to_decl (CP_TYPE_QUALS (type), r); + c_apply_type_quals_to_decl (cp_type_quals (type), r); if (TREE_CODE (DECL_INITIAL (r)) != TEMPLATE_PARM_INDEX) DECL_INITIAL (r) = TREE_TYPE (r); @@ -5928,7 +5928,7 @@ tsubst_decl (t, args, type) { r = copy_decl (t); TREE_TYPE (r) = type; - c_apply_type_quals_to_decl (CP_TYPE_QUALS (type), r); + c_apply_type_quals_to_decl (cp_type_quals (type), r); /* We don't have to set DECL_CONTEXT here; it is set by finish_member_declaration. */ @@ -6007,7 +6007,7 @@ tsubst_decl (t, args, type) r = copy_decl (t); TREE_TYPE (r) = type; - c_apply_type_quals_to_decl (CP_TYPE_QUALS (type), r); + c_apply_type_quals_to_decl (cp_type_quals (type), r); DECL_CONTEXT (r) = ctx; /* Clear out the mangled name and RTL for the instantiation. */ SET_DECL_ASSEMBLER_NAME (r, NULL_TREE); @@ -6394,7 +6394,7 @@ tsubst (t, args, complain, in_decl) { my_friendly_assert (TYPE_P (arg), 0); return cp_build_qualified_type_real - (arg, CP_TYPE_QUALS (arg) | CP_TYPE_QUALS (t), + (arg, cp_type_quals (arg) | cp_type_quals (t), complain); } else if (TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM) @@ -6445,10 +6445,10 @@ tsubst (t, args, complain, in_decl) case TEMPLATE_TYPE_PARM: case TEMPLATE_TEMPLATE_PARM: case BOUND_TEMPLATE_TEMPLATE_PARM: - if (CP_TYPE_QUALS (t)) + if (cp_type_quals (t)) { r = tsubst (TYPE_MAIN_VARIANT (t), args, complain, in_decl); - r = cp_build_qualified_type_real (r, CP_TYPE_QUALS (t), + r = cp_build_qualified_type_real (r, cp_type_quals (t), complain); } else @@ -6755,8 +6755,8 @@ tsubst (t, args, complain, in_decl) if (f == error_mark_node) return f; return cp_build_qualified_type_real (f, - CP_TYPE_QUALS (f) - | CP_TYPE_QUALS (t), + cp_type_quals (f) + | cp_type_quals (t), complain); } @@ -8667,8 +8667,8 @@ unify (tparms, targs, parm, arg, strict) PARM is `const T'. Then, T should be `volatile int'. */ arg = cp_build_qualified_type_real (arg, - CP_TYPE_QUALS (arg) - & ~CP_TYPE_QUALS (parm), + cp_type_quals (arg) + & ~cp_type_quals (parm), /*complain=*/0); if (arg == error_mark_node) return 1; diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index c91b378..ae9600c 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -107,7 +107,7 @@ build_headof (exp) offset = build_vtbl_ref (build_indirect_ref (exp, NULL), index); type = build_qualified_type (ptr_type_node, - CP_TYPE_QUALS (TREE_TYPE (exp))); + cp_type_quals (TREE_TYPE (exp))); return build (PLUS_EXPR, type, exp, cp_convert (ptrdiff_type_node, offset)); } @@ -923,8 +923,8 @@ typeinfo_in_lib_p (type) /* The typeinfo objects for `T*' and `const T*' are in the runtime library for simple types T. */ if (TREE_CODE (type) == POINTER_TYPE - && (CP_TYPE_QUALS (TREE_TYPE (type)) == TYPE_QUAL_CONST - || CP_TYPE_QUALS (TREE_TYPE (type)) == TYPE_UNQUALIFIED)) + && (cp_type_quals (TREE_TYPE (type)) == TYPE_QUAL_CONST + || cp_type_quals (TREE_TYPE (type)) == TYPE_UNQUALIFIED)) type = TREE_TYPE (type); switch (TREE_CODE (type)) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ae1e597..edd676b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2128,7 +2128,7 @@ finish_base_specifier (access_specifier, base_class) result = NULL_TREE; else { - if (CP_TYPE_QUALS (base_class) != 0) + if (cp_type_quals (base_class) != 0) { cp_error ("base class `%T' has cv qualifiers", base_class); base_class = TYPE_MAIN_VARIANT (base_class); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 97ae231..ae4c375 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -490,7 +490,7 @@ build_cplus_array_type (elt_type, index_type) tree index_type; { tree t; - int type_quals = CP_TYPE_QUALS (elt_type); + int type_quals = cp_type_quals (elt_type); if (type_quals != TYPE_UNQUALIFIED) elt_type = cp_build_qualified_type (elt_type, TYPE_UNQUALIFIED); @@ -521,7 +521,7 @@ cp_build_qualified_type_real (type, type_quals, complain) if (type == error_mark_node) return type; - if (type_quals == CP_TYPE_QUALS (type)) + if (type_quals == cp_type_quals (type)) return type; /* A restrict-qualified pointer type must be a pointer (or reference) @@ -624,7 +624,7 @@ tree canonical_type_variant (t) tree t; { - return cp_build_qualified_type (TYPE_MAIN_VARIANT (t), CP_TYPE_QUALS (t)); + return cp_build_qualified_type (TYPE_MAIN_VARIANT (t), cp_type_quals (t)); } /* Makes new binfos for the indirect bases under BINFO, and updates diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index e57dd1c..c4c0e10 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -223,7 +223,7 @@ qualify_type_recursive (t1, t2) else b1 = NULL_TREE; - type_quals = (CP_TYPE_QUALS (tt1) | CP_TYPE_QUALS (tt2)); + type_quals = (cp_type_quals (tt1) | cp_type_quals (tt2)); tgt = qualify_type_recursive (tt1, tt2); tgt = cp_build_qualified_type (tgt, type_quals); if (b1) @@ -486,8 +486,8 @@ composite_pointer_type (t1, t2, arg1, arg2, location) t1 = TREE_TYPE (t1); t2 = TREE_TYPE (t2); result_type = cp_build_qualified_type (void_type_node, - (CP_TYPE_QUALS (t1) - | CP_TYPE_QUALS (t2))); + (cp_type_quals (t1) + | cp_type_quals (t2))); result_type = build_pointer_type (result_type); } else @@ -617,7 +617,7 @@ common_type (t1, t2) else b1 = b2 = NULL_TREE; - type_quals = (CP_TYPE_QUALS (tt1) | CP_TYPE_QUALS (tt2)); + type_quals = (cp_type_quals (tt1) | cp_type_quals (tt2)); tt1 = TYPE_MAIN_VARIANT (tt1); tt2 = TYPE_MAIN_VARIANT (tt2); @@ -795,7 +795,7 @@ comp_except_types (a, b, exact) return 1; else if (!exact) { - if (CP_TYPE_QUALS (a) || CP_TYPE_QUALS (b)) + if (cp_type_quals (a) || cp_type_quals (b)) return 0; if (TREE_CODE (a) == POINTER_TYPE @@ -803,7 +803,7 @@ comp_except_types (a, b, exact) { a = TREE_TYPE (a); b = TREE_TYPE (b); - if (CP_TYPE_QUALS (a) || CP_TYPE_QUALS (b)) + if (cp_type_quals (a) || cp_type_quals (b)) return 0; } @@ -983,7 +983,7 @@ comptypes (t1, t2, strict) return 0; /* Qualifiers must match. */ - if (CP_TYPE_QUALS (t1) != CP_TYPE_QUALS (t2)) + if (cp_type_quals (t1) != cp_type_quals (t2)) return 0; if (strict == COMPARE_STRICT && TYPE_FOR_JAVA (t1) != TYPE_FOR_JAVA (t2)) @@ -1327,8 +1327,8 @@ at_least_as_qualified_p (type1, type2) tree type2; { /* All qualifiers for TYPE2 must also appear in TYPE1. */ - return ((CP_TYPE_QUALS (type1) & CP_TYPE_QUALS (type2)) - == CP_TYPE_QUALS (type2)); + return ((cp_type_quals (type1) & cp_type_quals (type2)) + == cp_type_quals (type2)); } /* Returns 1 if TYPE1 is more qualified than TYPE2. */ @@ -1338,7 +1338,7 @@ more_qualified_p (type1, type2) tree type1; tree type2; { - return (CP_TYPE_QUALS (type1) != CP_TYPE_QUALS (type2) + return (cp_type_quals (type1) != cp_type_quals (type2) && at_least_as_qualified_p (type1, type2)); } @@ -1350,7 +1350,7 @@ comp_cv_qualification (type1, type2) tree type1; tree type2; { - if (CP_TYPE_QUALS (type1) == CP_TYPE_QUALS (type2)) + if (cp_type_quals (type1) == cp_type_quals (type2)) return 0; if (at_least_as_qualified_p (type1, type2)) @@ -2241,8 +2241,8 @@ build_component_ref (datum, component, basetype_path, protect) ; else { - type_quals = (CP_TYPE_QUALS (field_type) - | CP_TYPE_QUALS (TREE_TYPE (datum))); + type_quals = (cp_type_quals (field_type) + | cp_type_quals (TREE_TYPE (datum))); /* A field is const (volatile) if the enclosing object, or the field itself, is const (volatile). But, a mutable field is @@ -6892,7 +6892,8 @@ comp_ptr_ttypes_reinterpret (to, from) } } -/* Returns the type-qualifier set corresponding to TYPE. */ +/* Returns the type qualifiers for this type, including the qualifiers on the + elements for an array type. */ int cp_type_quals (type) @@ -6958,14 +6959,14 @@ casts_away_constness_r (t1, t2) || TREE_CODE (*t2) != POINTER_TYPE) { *t1 = cp_build_qualified_type (void_type_node, - CP_TYPE_QUALS (*t1)); + cp_type_quals (*t1)); *t2 = cp_build_qualified_type (void_type_node, - CP_TYPE_QUALS (*t2)); + cp_type_quals (*t2)); return; } - quals1 = CP_TYPE_QUALS (*t1); - quals2 = CP_TYPE_QUALS (*t2); + quals1 = cp_type_quals (*t1); + quals2 = cp_type_quals (*t2); *t1 = TREE_TYPE (*t1); *t2 = TREE_TYPE (*t2); casts_away_constness_r (t1, t2); diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 2a9b2a9..8281b34 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1159,8 +1159,8 @@ build_m_component_ref (datum, component) ; else { - type_quals = (CP_TYPE_QUALS (field_type) - | CP_TYPE_QUALS (TREE_TYPE (datum))); + type_quals = (cp_type_quals (field_type) + | cp_type_quals (TREE_TYPE (datum))); /* There's no such thing as a mutable pointer-to-member, so we don't need to deal with that here like we do in build_component_ref. */ -- cgit v1.1