Commit 889d8465 by Nick Clifton Committed by Nick Clifton

Replace C++ style line comments with C style line comments.

(symbian_add_attribute): Do not use a ? operator on the LHS of an assignment.
(sh_symbian_handle_dll_attribute): Change the type of the method vector to
  "VEC(tree,gc)*" and use vector accessor macros to walk over the elements.
(symbian_export_vtable_and_rtti_p): Likewise.
(symbian_class_needs_attribute_p): Likewise.

From-SVN: r102228
parent 8eb9df78
2005-07-21 Nick Clifton <nickc@redhat.com>
* config/sh/symbian.c: Replace C++ style line comments with C
style line comments.
(symbian_add_attribute): Do not use a ? operator on the LHS of
an assignment.
(sh_symbian_handle_dll_attribute): Change the type of the
method vector to "VEC(tree,gc)*" and use vector accessor
macros to walk over the elements.
(symbian_export_vtable_and_rtti_p): Likewise.
(symbian_class_needs_attribute_p): Likewise.
2005-07-21 Paolo Bonzini <bonzini@gnu.org> 2005-07-21 Paolo Bonzini <bonzini@gnu.org>
PR target/22085 PR target/22085
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
1 for informative messages about decisions to add attributes 1 for informative messages about decisions to add attributes
2 for verbose information about what is being done. */ 2 for verbose information about what is being done. */
#define SYMBIAN_DEBUG 0 #define SYMBIAN_DEBUG 0
//#define SYMBIAN_DEBUG 1 /* #define SYMBIAN_DEBUG 1 */
//#define SYMBIAN_DEBUG 2 /* #define SYMBIAN_DEBUG 2 */
/* A unique character to encode declspec encoded objects. */ /* A unique character to encode declspec encoded objects. */
#define SH_SYMBIAN_FLAG_CHAR "$" #define SH_SYMBIAN_FLAG_CHAR "$"
...@@ -375,8 +375,10 @@ symbian_add_attribute (tree node, const char *attr_name) ...@@ -375,8 +375,10 @@ symbian_add_attribute (tree node, const char *attr_name)
attr = get_identifier (attr_name); attr = get_identifier (attr_name);
(DECL_P (node) ? DECL_ATTRIBUTES (node) : TYPE_ATTRIBUTES (node)) if (DECL_P (node))
= tree_cons (attr, NULL_TREE, attrs); DECL_ATTRIBUTES (node) = tree_cons (attr, NULL_TREE, attrs);
else
TYPE_ATTRIBUTES (node) = tree_cons (attr, NULL_TREE, attrs);
#if SYMBIAN_DEBUG #if SYMBIAN_DEBUG
fprintf (stderr, "propogate %s attribute", attr_name); fprintf (stderr, "propogate %s attribute", attr_name);
...@@ -549,18 +551,18 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args, ...@@ -549,18 +551,18 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args,
static void static void
symbian_possibly_export_base_class (tree base_class) symbian_possibly_export_base_class (tree base_class)
{ {
tree methods; VEC(tree,gc) *method_vec;
int len; int len;
if (! (TYPE_CONTAINS_VPTR_P (base_class))) if (! (TYPE_CONTAINS_VPTR_P (base_class)))
return; return;
methods = CLASSTYPE_METHOD_VEC (base_class); method_vec = CLASSTYPE_METHOD_VEC (base_class);
len = methods ? TREE_VEC_LENGTH (methods) : 0; len = method_vec ? VEC_length (tree, method_vec) : 0;
for (;len --;) for (;len --;)
{ {
tree member = TREE_VEC_ELT (methods, len); tree member = VEC_index (tree, method_vec, len);
if (! member) if (! member)
continue; continue;
...@@ -611,7 +613,7 @@ symbian_export_vtable_and_rtti_p (tree ctype) ...@@ -611,7 +613,7 @@ symbian_export_vtable_and_rtti_p (tree ctype)
bool dllimport_ctor_dtor; bool dllimport_ctor_dtor;
bool dllimport_member; bool dllimport_member;
tree binfo, base_binfo; tree binfo, base_binfo;
tree methods; VEC(tree,gc) *method_vec;
tree key; tree key;
int i; int i;
int len; int len;
...@@ -653,12 +655,12 @@ symbian_export_vtable_and_rtti_p (tree ctype) ...@@ -653,12 +655,12 @@ symbian_export_vtable_and_rtti_p (tree ctype)
dllimport_ctor_dtor = false; dllimport_ctor_dtor = false;
dllimport_member = false; dllimport_member = false;
methods = CLASSTYPE_METHOD_VEC (ctype); method_vec = CLASSTYPE_METHOD_VEC (ctype);
len = methods ? TREE_VEC_LENGTH (methods) : 0; len = method_vec ? VEC_length (tree, method_vec) : 0;
for (;len --;) for (;len --;)
{ {
tree member = TREE_VEC_ELT (methods, len); tree member = VEC_index (tree, method_vec, len);
if (! member) if (! member)
continue; continue;
...@@ -754,22 +756,27 @@ symbian_add_attribute_to_class_vtable_and_rtti (tree ctype, const char *attr_nam ...@@ -754,22 +756,27 @@ symbian_add_attribute_to_class_vtable_and_rtti (tree ctype, const char *attr_nam
static bool static bool
symbian_class_needs_attribute_p (tree ctype, const char *attribute_name) symbian_class_needs_attribute_p (tree ctype, const char *attribute_name)
{ {
VEC(tree,gc) *method_vec;
method_vec = CLASSTYPE_METHOD_VEC (ctype);
/* If the key function has the attribute then the class needs it too. */ /* If the key function has the attribute then the class needs it too. */
if (TYPE_POLYMORPHIC_P (ctype) if (TYPE_POLYMORPHIC_P (ctype)
&& CLASSTYPE_KEY_METHOD (ctype) && method_vec
&& lookup_attribute (attribute_name, && lookup_attribute (attribute_name,
DECL_ATTRIBUTES (CLASSTYPE_KEY_METHOD (ctype)))) DECL_ATTRIBUTES (VEC_index (tree, method_vec, 0))))
return true; return true;
/* Check the class's member functions. */ /* Check the class's member functions. */
if (TREE_CODE (ctype) == RECORD_TYPE) if (TREE_CODE (ctype) == RECORD_TYPE)
{ {
tree methods = CLASSTYPE_METHOD_VEC (ctype); unsigned int len;
unsigned int len = methods ? TREE_VEC_LENGTH (methods) : 0;
len = method_vec ? VEC_length (tree, method_vec) : 0;
for (;len --;) for (;len --;)
{ {
tree member = TREE_VEC_ELT (methods, len); tree member = VEC_index (tree, method_vec, len);
if (! member) if (! member)
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment