diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-09-16 16:59:29 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-09-16 16:59:29 +0000 |
commit | 5ae0d1aae87bd19f6abd57fdb49355d687ff092f (patch) | |
tree | d7fb6e27e8c97a055754155eedc3c33dec0dffba | |
parent | b4793635a50814df3bf67d2ef06981f6ca21ab61 (diff) | |
download | ATCD-5ae0d1aae87bd19f6abd57fdb49355d687ff092f.tar.gz |
ChangeLogTag: Thu Sep 16 11:49:32 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 26 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_arg_traits.cpp | 35 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp | 9 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_traits.cpp | 33 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/array.idl | 8 |
5 files changed, 73 insertions, 38 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 3814099645a..e06a5eeaa06 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,29 @@ +Thu Sep 16 11:49:32 2004 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/be/be_visitor_argument/paramlist.cpp: + + Removed code that has been long commented out. + + * TAO_IDL/be/be_visitor_traits.cpp (visit_array): + + Removed unused code to generate an #ifdef guard based on the + unaliased type name of the array element and all the dimensions. + + * TAO_IDL/be/be_visitor_arg_traits.cpp (visit_array): + + Added generation of #ifdef guard removed from the above visitor. + This change eliminates a compile error when two arrays with + identical element types are both used as operation parameters. + Thanks to Jean-Christophe Cota + <jean-christophe.cota@eurocontrol.int> for sending in the + example IDL file that uncovered the bug. + + * tests/IDL_Test/array.idl: + + Added interface with an operation containing parameters of + arrays with identical element types which already existed in + the IDL file. + Thu Sep 16 11:03:47 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu> * orbsvcs/tests/Miop/McastHello/README: diff --git a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp index bbd8afc91f9..0eea91ba50e 100644 --- a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp @@ -486,7 +486,40 @@ be_visitor_arg_traits::visit_array (be_array *node) // This should be generated even for imported nodes. The ifdef guard prevents // multiple declarations. - os->gen_ifdef_macro (node->flat_name (), "arg_traits"); +// os->gen_ifdef_macro (node->flat_name (), "arg_traits"); + + // Generate the array traits specialization definitions, + // guarded by #ifdef on unaliased array element type and length. + + ACE_CString unique; + be_type *bt = be_type::narrow_from_decl (node->base_type ()); + AST_Decl::NodeType nt = bt->node_type (); + + if (nt == AST_Decl::NT_typedef) + { + be_typedef *td = be_typedef::narrow_from_decl (bt); + unique = td->primitive_base_type ()->flat_name (); + } + else + { + unique = bt->flat_name (); + } + + char buf[NAMEBUFSIZE]; + + for (unsigned long i = 0; i < node->n_dims (); ++i) + { + ACE_OS::memset (buf, + '\0', + NAMEBUFSIZE); + ACE_OS::sprintf (buf, + "_%ld", + node->dims ()[i]->ev ()->u.ulval); + unique += buf; + } + + unique += "_traits"; + os->gen_ifdef_macro (unique.fast_rep ()); *os << be_nl << be_nl << "ACE_TEMPLATE_SPECIALIZATION" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp index 2fa4e527ac7..fbb5e7613cd 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp @@ -101,11 +101,12 @@ int be_visitor_args_paramlist::visit_argument (be_argument *node) *os << " _tao_forany_" << node->local_name () << " ("; *os << this->type_name (bt, "_dup"); *os << " ("; - // This is to placate some compilers which have - // trouble with IN args that are multidimensional arrays. - //if (node->n_dims () > 1) cant do this here since dont have a be_array node + if (this->direction () != AST_Argument::dir_IN) - *os << "(const ::" << bt->name () << "_slice *) "; + { + *os << "(const ::" << bt->name () << "_slice *) "; + } + *os << "this->"; *os << node->local_name () << "_));" << be_nl; *os << "(*parameter_list)[len].argument <<= _tao_forany_" ; diff --git a/TAO/TAO_IDL/be/be_visitor_traits.cpp b/TAO/TAO_IDL/be/be_visitor_traits.cpp index d7233422e98..159e95ef9bd 100644 --- a/TAO/TAO_IDL/be/be_visitor_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_traits.cpp @@ -388,39 +388,6 @@ be_visitor_traits::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); - // Generate the array traits specialization definitions, - // guarded by #ifdef on unaliased array element type and length. - - ACE_CString unique; - be_type *bt = be_type::narrow_from_decl (node->base_type ()); - AST_Decl::NodeType nt = bt->node_type (); - - if (nt == AST_Decl::NT_typedef) - { - be_typedef *td = be_typedef::narrow_from_decl (bt); - unique = td->primitive_base_type ()->flat_name (); - } - else - { - unique = bt->flat_name (); - } - - char buf[NAMEBUFSIZE]; - - for (unsigned long i = 0; i < node->n_dims (); ++i) - { - ACE_OS::memset (buf, - '\0', - NAMEBUFSIZE); - ACE_OS::sprintf (buf, - "_%ld", - node->dims ()[i]->ev ()->u.ulval); - unique += buf; - } - - unique += "_traits"; -// os->gen_ifdef_macro (unique.fast_rep ()); - *os << be_nl << be_nl << "ACE_TEMPLATE_SPECIALIZATION" << be_nl << "struct " << be_global->stub_export_macro () << " Array_Traits<" diff --git a/TAO/tests/IDL_Test/array.idl b/TAO/tests/IDL_Test/array.idl index aa940776ec9..910bc04a740 100644 --- a/TAO/tests/IDL_Test/array.idl +++ b/TAO/tests/IDL_Test/array.idl @@ -72,6 +72,14 @@ module ABCModule typedef octet oa1[22]; typedef octet oa2[22]; +// Test generation of Arg_Traits specialization for identical +// arrays. +interface array_args +{ + void all_arrays (in oa1 arg1, + in oa2 arg2); +}; + // This should generate unique _var and _forany types, but // also generate TAO_String_Manager as the element type for both. module string_array |