summaryrefslogtreecommitdiff
path: root/gcc/vec.h
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-16 01:15:43 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-16 01:15:43 +0000
commitde5ab3f1d1c41ca6fd5528032c39c1097261d290 (patch)
tree682aa43196b4509a69da60da01d7d2806e7bb920 /gcc/vec.h
parent5f18162f7775fe2e479a98c542130f841574d583 (diff)
downloadgcc-de5ab3f1d1c41ca6fd5528032c39c1097261d290.tar.gz
* vec.h (VEC_address): New function.
* cp-tree.h (lang_type_class): Remove has_real_assign_ref and has_abstract_assign_ref. Make methods a VEC(tree) *. (TYPE_HAS_CONST_ASSIGN_REF): Add documentation. (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC. (CLASSTYPE_DESTRUCTORS): Likewise. (TYPE_HAS_REAL_ASSIGN_REF): Remove. (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise. (add_method): Change prototoype. * class.c (add_method): Remove error_p parameter. Adjust for changes to CLASSTYPE_METHOD_VEC. (handle_using_decl): Adjust call to add_method. (maybe_warn_about_overly_private_class): Adjust for changes to CLASSTYPE_METHOD_VEC. (resort_type_method_vec): Likewise. (finish_struct_methods): Likewise. (check_for_override): Likewise. (warn_hidden): Likewise. (add_implicitly_declared_members): Defer creation of assignment operators. Adjust call to add_method. (clone_function_decl): Adjust call to add_method. (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF. (finish_struct_1): Use CLASSTYPE_DESTRUCTORS. * decl.c (grok_special_member_properties): Don't set TYPE_HAS_ABSTRACT_ASSIGN_REF. * decl2.c (check_classfn): Adjust for changes to CLASSTYPE_METHOD_VEC. * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS. (locate_ctor): Use CLASSTYPE_CONSTRUCTORS. (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC. (implicitly_declare_fn): Set DECL_SOURCE_LOCATION. Do not call cp_finish_decl. * pt.c (check_explicit_specialization): Adjust for changes to CLASSTYPE_METHOD_VEC. (instantiate_class_template): Do not set TYPE_HAS_ABSTRACT_ASSIGN_REF. * ptree.c (cxx_print_type): Don't try to print CLASSTYPE_METHOD_VEC. * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS. * search.c (lookup_field_r): Adjust for changes to CLASSTYPE_METHOD_VEC. (lookup_fnfields): Likewise. (lookup_conversion_operator): Likewise. (lookup_fnfields_1): Likewise. Create assignment operators lazily. (look_for_overrides_here): Adjust for changes to CLASSTYPE_METHOD_VEC. (add_conversions): Likewise. * semantics.c (finish_member_declaration): Adjust call to add_method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84796 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/vec.h')
-rw-r--r--gcc/vec.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/vec.h b/gcc/vec.h
index f795ba13f0b..6d78c832b24 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -244,6 +244,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
removed object. This is an O(1) operation. */
#define VEC_unordered_remove(TDEF,V,I) (VEC_OP(TDEF,unordered_remove)(V,I))
+/* Get the address of the array of elements
+ T *VEC_T_address (VEC(T) v)
+
+ If you need to directly manipulate the array (for instance, you
+ want to feed it to qsort), use this accessor. */
+#define VEC_address(TDEF,V) (VEC_OP(TDEF,address)(V))
+
#if !IN_GENGTYPE
/* Reallocate an array of elements with prefix. */
extern void *vec_p_reserve (void *, int MEM_STAT_DECL);
@@ -449,6 +456,12 @@ static inline TDEF VEC_OP (TDEF,unordered_remove) \
return obj_; \
} \
\
+static inline TDEF *VEC_OP (TDEF,address) \
+ (VEC (TDEF) *vec_) \
+{ \
+ return vec_ ? vec_->vec : 0; \
+} \
+ \
struct vec_swallow_trailing_semi
#endif
@@ -612,6 +625,12 @@ static inline void VEC_OP (TDEF,unordered_remove) \
vec_->vec[ix_] = vec_->vec[--vec_->num]; \
} \
\
+static inline TDEF *VEC_OP (TDEF,address) \
+ (VEC (TDEF) *vec_) \
+{ \
+ return vec_ ? vec_->vec : 0; \
+} \
+ \
struct vec_swallow_trailing_semi
#endif