summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-07-14 19:50:33 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-07-14 19:50:33 +0000
commit483d4ae5fb62645f0317cebe4d1dfa85e41cd896 (patch)
treebb5548d0cfc86b8ba1885ccafabec51962e4c452
parent2324352b5a9569ed4bc1a7936fac8dee8648f072 (diff)
downloadATCD-483d4ae5fb62645f0317cebe4d1dfa85e41cd896.tar.gz
ChangeLogTag: Thu Jul 14 19:49:02 UTC 2011 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog78
-rw-r--r--TAO/TAO_IDL/ast/ast_interface.cpp6
-rw-r--r--TAO/TAO_IDL/ast/ast_interface_fwd.cpp5
-rw-r--r--TAO/TAO_IDL/be/be_argument.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_attribute.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp238
-rw-r--r--TAO/TAO_IDL/be/be_decl.cpp115
-rw-r--r--TAO/TAO_IDL/be/be_enum.cpp1
-rw-r--r--TAO/TAO_IDL/be/be_global.cpp19
-rw-r--r--TAO/TAO_IDL/be/be_operation.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_sequence.cpp1
-rw-r--r--TAO/TAO_IDL/be/be_string.cpp16
-rw-r--r--TAO/TAO_IDL/be/be_type.cpp1
-rw-r--r--TAO/TAO_IDL/be/be_util.cpp127
-rw-r--r--TAO/TAO_IDL/be/be_valuebox.cpp17
-rw-r--r--TAO/TAO_IDL/be/be_valuetype.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_arg_traits.cpp550
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp10
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp16
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp36
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp17
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp18
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp26
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp42
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union.cpp5
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox.cpp5
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype.cpp5
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp2
-rw-r--r--TAO/TAO_IDL/be_include/be_codegen.h1
-rw-r--r--TAO/TAO_IDL/be_include/be_decl.h4
-rw-r--r--TAO/TAO_IDL/be_include/be_global.h8
-rw-r--r--TAO/TAO_IDL/be_include/be_util.h4
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_root/root_ch.h1
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_root/root_cs.h1
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_root/root_sh.h6
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_root/root_ss.h5
-rw-r--r--TAO/TAO_IDL/include/idl_global.h16
-rw-r--r--TAO/TAO_IDL/util/utl_global.cpp16
-rw-r--r--TAO/docs/compiler.html7
-rw-r--r--TAO/tao/PolicyC.cpp25
-rw-r--r--TAO/tao/PortableServer/PolicyS.cpp32
-rw-r--r--TAO/tao/tao.mpc12
-rw-r--r--TAO/tests/Param_Test/Param_Test.mpc72
48 files changed, 937 insertions, 672 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 8fc49bffda4..b48c098f928 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,81 @@
+Thu Jul 14 19:49:02 UTC 2011 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * tao/PolicyC.cpp:
+ * tao/PortableServer/PolicyS.cpp:
+
+ Removed arg traits instantiations and #includes from these
+ hand_crafted files.
+
+ * tao/tao.mpc:
+
+ - Added IDL compiler option to suppress Any operator
+ generation for Policy_Forward.pidl.
+
+ - Added new IDL compiler option (see below) to
+ suppress arg traits generation for ParameterMode.pidl.
+
+ * tests/Param_Test/Param_Test.mpc:
+
+ Added header and inline file lists.
+
+ * TAO_IDL/include/idl_global.h:
+ * TAO_IDL/be/be_attribute.cpp:
+ * TAO_IDL/be/be_visitor_arg_traits.cpp:
+ * TAO_IDL/be/be_valuetype.cpp:
+ * TAO_IDL/be/be_visitor_operation/arglist.cpp:
+ * TAO_IDL/be/be_visitor_operation/operation_cs.cpp:
+ * TAO_IDL/be/be_visitor_operation/operation.cpp:
+ * TAO_IDL/be/be_codegen.cpp:
+ * TAO_IDL/be/be_visitor_valuebox.cpp:
+ * TAO_IDL/be/be_visitor_union.cpp:
+ * TAO_IDL/be/be_visitor_structure.cpp:
+ * TAO_IDL/be/be_visitor_root/root_cs.cpp:
+ * TAO_IDL/be/be_visitor_root/root_sh.cpp:
+ * TAO_IDL/be/be_visitor_root/root_ss.cpp:
+ * TAO_IDL/be/be_visitor_root/root_ch.cpp:
+ * TAO_IDL/be/be_type.cpp:
+ * TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp:
+ * TAO_IDL/be/be_valuebox.cpp:
+ * TAO_IDL/be/be_decl.cpp:
+ * TAO_IDL/be/be_util.cpp:
+ * TAO_IDL/be/be_visitor_sequence.cpp:
+ * TAO_IDL/be/be_visitor_array/array_ch.cpp:
+ * TAO_IDL/be/be_argument.cpp:
+ * TAO_IDL/be/be_visitor_valuetype.cpp:
+ * TAO_IDL/be/be_global.cpp:
+ * TAO_IDL/be/be_visitor_enum/enum_ch.cpp:
+ * TAO_IDL/be/be_sequence.cpp:
+ * TAO_IDL/be/be_operation.cpp:
+ * TAO_IDL/be/be_enum.cpp:
+ * TAO_IDL/be/be_string.cpp:
+ * TAO_IDL/ast/ast_interface.cpp:
+ * TAO_IDL/ast/ast_interface_fwd.cpp:
+ * TAO_IDL/be_include/be_visitor_root/root_ch.h:
+ * TAO_IDL/be_include/be_visitor_root/root_cs.h:
+ * TAO_IDL/be_include/be_visitor_root/root_sh.h:
+ * TAO_IDL/be_include/be_visitor_root/root_ss.h:
+ * TAO_IDL/be_include/be_codegen.h:
+ * TAO_IDL/be_include/be_util.h:
+ * TAO_IDL/be_include/be_decl.h:
+ * TAO_IDL/be_include/be_global.h:
+ * TAO_IDL/util/utl_global.cpp:
+
+ - Moved arg traits generation targets from the stub
+ and skeleton source files to the corresponding
+ header files. This checking addresses [BUGID:3969].
+
+ - Many changes to #include file generation logic,
+ since arg traits generation is now triggered from the IDL
+ declaration and not from its use as an operation argument.
+
+ - Added a new command line option -Sat to suppress
+ the generation of arg tratis altogether.
+
+ * tao/docs/compiler.html:
+
+ Added the new IDL compiler command line option to the table.
+
Tue Jul 12 13:15:24 UTC 2011 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_codegen.cpp:
diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp
index 4aafc06dd89..a6bcd815c73 100644
--- a/TAO/TAO_IDL/ast/ast_interface.cpp
+++ b/TAO/TAO_IDL/ast/ast_interface.cpp
@@ -131,6 +131,12 @@ AST_Interface::AST_Interface (UTL_ScopedName *n,
this->size_type (AST_Type::VARIABLE); // always the case
this->has_constructor (true); // always the case
+ // Check for non-local and not a dummy for a fwd decl.
+ if (! local && nih != -1)
+ {
+ idl_global->non_local_iface_seen_ = true;
+ }
+
// Enqueue the param holders (if any) for later destruction.
// By the time our destroy() is called, it will be too late
// to iterate over pd_inherits.
diff --git a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp
index 501b7f60b9d..5f0b8bb0c9e 100644
--- a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp
+++ b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp
@@ -92,6 +92,11 @@ AST_InterfaceFwd::AST_InterfaceFwd (AST_Interface *dummy,
// interface node is not yet defined (n_inherits < 0), so some operations
// will fail.
this->pd_full_definition = dummy;
+
+ if (! dummy->is_local ())
+ {
+ idl_global->non_local_fwd_iface_seen_ = true;
+ }
}
AST_InterfaceFwd::~AST_InterfaceFwd (void)
diff --git a/TAO/TAO_IDL/be/be_argument.cpp b/TAO/TAO_IDL/be/be_argument.cpp
index 5473f5bc46f..70996d2054f 100644
--- a/TAO/TAO_IDL/be/be_argument.cpp
+++ b/TAO/TAO_IDL/be/be_argument.cpp
@@ -17,6 +17,8 @@
#include "be_argument.h"
#include "be_type.h"
#include "be_visitor.h"
+#include "be_util.h"
+
#include "nr_extern.h"
#include "global_extern.h"
@@ -49,7 +51,7 @@ be_argument::be_argument (AST_Argument::Direction d,
{
be_type *bt = be_type::narrow_from_decl (ft);
bt->seen_in_operation (true);
- this->set_arg_seen_bit (bt);
+ be_util::set_arg_seen_bit (bt);
idl_global->need_skeleton_includes_ = true;
}
}
diff --git a/TAO/TAO_IDL/be/be_attribute.cpp b/TAO/TAO_IDL/be/be_attribute.cpp
index 9e8b87e2633..16f74c7fa09 100644
--- a/TAO/TAO_IDL/be/be_attribute.cpp
+++ b/TAO/TAO_IDL/be/be_attribute.cpp
@@ -17,6 +17,7 @@
#include "be_attribute.h"
#include "be_type.h"
#include "be_visitor.h"
+#include "be_util.h"
#include "global_extern.h"
@@ -46,8 +47,7 @@ be_attribute::be_attribute (bool ro,
{
// For the return types of the two operations
// generated from this attribute.
- this->set_arg_seen_bit (be_type::narrow_from_decl (ft));
- idl_global->basic_arg_seen_ = true;
+ be_util::set_arg_seen_bit (be_type::narrow_from_decl (ft));
}
}
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 102dd29eee0..dc320662866 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -325,7 +325,7 @@ TAO_CodeGen::start_client_header (const char *fname)
}
}
- // Generate the regeneration check.
+ // Generate the regeneration check.
*this->client_header_ << "\n\n#if TAO_MAJOR_VERSION != " << TAO_MAJOR_VERSION
<< " || TAO_MINOR_VERSION != " << TAO_MINOR_VERSION
<< " || TAO_BETA_VERSION != " << TAO_BETA_VERSION
@@ -333,7 +333,7 @@ TAO_CodeGen::start_client_header (const char *fname)
<< TAO_VERSION
<< "\n#endif";
- // Generate the TAO_EXPORT_MACRO macro.
+ // Generate the TAO_EXPORT_MACRO macro.
*this->client_header_ << "\n\n#if defined (TAO_EXPORT_MACRO)\n";
*this->client_header_ << "#undef TAO_EXPORT_MACRO\n";
*this->client_header_ << "#endif\n";
@@ -515,6 +515,13 @@ TAO_CodeGen::start_server_header (const char *fname)
server_hdr);
}
+ /// These are generated regardless, so we put it before the
+ /// check below.
+ if (be_global->gen_arg_traits ())
+ {
+ this->gen_skel_arg_file_includes (this->server_header_);
+ }
+
// If we are suppressing skel file generation, bail after generating the
// copyright text and an informative message.
if (!be_global->gen_skel_files ())
@@ -532,34 +539,7 @@ TAO_CodeGen::start_server_header (const char *fname)
<< "# pragma once\n"
<< "#endif /* ACE_LACKS_PRAGMA_ONCE */\n";
- // Include the definitions for the PortableServer namespace,
- // this forces the application to link the POA library, a good
- // thing, because we need the definitions there, it also
- // registers the POA factory with the Service_Configurator, so
- // the ORB can automatically find it.
- if (idl_global->non_local_iface_seen_)
- {
- // Include the Messaging files if AMI is enabled.
- if (be_global->ami_call_back () == true)
- {
- // Include Messaging skeleton file.
- this->gen_standard_include (this->server_header_,
- "tao/Messaging/MessagingS.h");
- }
-
- this->gen_standard_include (this->server_header_,
- "tao/Collocation_Proxy_Broker.h");
- this->gen_standard_include (this->server_header_,
- "tao/PortableServer/PortableServer.h");
- this->gen_standard_include (this->server_header_,
- "tao/PortableServer/Servant_Base.h");
-
- if (be_global->gen_amh_classes ())
- {
- this->gen_standard_include (this->server_header_,
- "tao/Messaging/AMH_Response_Handler.h");
- }
- }
+ this->gen_skel_hdr_includes ();
if (be_global->skel_export_include () != 0)
{
@@ -2499,6 +2479,12 @@ TAO_CodeGen::gen_stub_hdr_includes (void)
// _vars and _outs are typedefs of template class instantiations.
this->gen_var_file_includes ();
+ if (be_global->gen_arg_traits ())
+ {
+ // Includes whatever arg helper template classes that may be needed.
+ this->gen_stub_arg_file_includes (this->client_header_);
+ }
+
// Version file, for code that checks needs for regeneration.
this->gen_standard_include (this->client_header_,
"tao/Version.h",
@@ -2648,9 +2634,6 @@ TAO_CodeGen::gen_stub_src_includes (void)
}
}
- // Includes whatever arg helper template classes that may be needed.
- this->gen_stub_arg_file_includes (this->client_stubs_);
-
// strcmp() is used with interfaces and exceptions.
if (idl_global->interface_seen_
|| idl_global->exception_seen_
@@ -2670,6 +2653,39 @@ TAO_CodeGen::gen_stub_src_includes (void)
}
void
+TAO_CodeGen::gen_skel_hdr_includes (void)
+{
+ // Include the definitions for the PortableServer namespace,
+ // this forces the application to link the POA library, a good
+ // thing, because we need the definitions there, it also
+ // registers the POA factory with the Service_Configurator, so
+ // the ORB can automatically find it.
+ if (idl_global->non_local_iface_seen_)
+ {
+ // Include the Messaging files if AMI is enabled.
+ if (be_global->ami_call_back () == true)
+ {
+ // Include Messaging skeleton file.
+ this->gen_standard_include (this->server_header_,
+ "tao/Messaging/MessagingS.h");
+ }
+
+ this->gen_standard_include (this->server_header_,
+ "tao/Collocation_Proxy_Broker.h");
+ this->gen_standard_include (this->server_header_,
+ "tao/PortableServer/PortableServer.h");
+ this->gen_standard_include (this->server_header_,
+ "tao/PortableServer/Servant_Base.h");
+
+ if (be_global->gen_amh_classes ())
+ {
+ this->gen_standard_include (this->server_header_,
+ "tao/Messaging/AMH_Response_Handler.h");
+ }
+ }
+}
+
+void
TAO_CodeGen::gen_skel_src_includes (void)
{
// Only non-local interfaces generate anything in the skeleton.
@@ -2755,15 +2771,6 @@ TAO_CodeGen::gen_skel_src_includes (void)
this->gen_standard_include (this->server_skeletons_,
"tao/PortableInterceptor.h");
- this->gen_skel_arg_file_includes (this->server_skeletons_);
-
- if (be_global->gen_thru_poa_collocation ()
- || be_global->gen_direct_collocation ())
- {
- // Collocation skeleton code doesn't use "SArg" variants.
- this->gen_stub_arg_file_includes (this->server_skeletons_);
- }
-
// The following header must always be included.
if (be_global->gen_amh_classes ())
{
@@ -2892,14 +2899,38 @@ TAO_CodeGen::gen_var_file_includes (void)
void
TAO_CodeGen::gen_stub_arg_file_includes (TAO_OutStream * stream)
{
+ this->gen_standard_include (
+ stream,
+ "tao/Arg_Traits_T.h");
+
+ this->gen_standard_include (
+ stream,
+ "tao/Basic_Arguments.h");
+
+ this->gen_standard_include (
+ stream,
+ "tao/Special_Basic_Arguments.h");
+
+ this->gen_standard_include (
+ stream,
+ "tao/Any_Insert_Policy_T.h");
+
this->gen_cond_file_include (
- idl_global->basic_arg_seen_,
- "tao/Basic_Arguments.h",
+ idl_global->enum_seen_,
+ "tao/Basic_Argument_T.h",
stream
);
+ this->gen_standard_include (
+ stream,
+ "tao/Fixed_Size_Argument_T.h");
+
+ this->gen_standard_include (
+ stream,
+ "tao/Var_Size_Argument_T.h");
+
this->gen_cond_file_include (
- idl_global->bd_string_arg_seen_,
+ idl_global->bd_string_seen_,
"tao/BD_String_Argument_T.h",
stream
);
@@ -2907,50 +2938,42 @@ TAO_CodeGen::gen_stub_arg_file_includes (TAO_OutStream * stream)
// If we have a bound string and we have any generation enabled we must
// include Any.h to get the <<= operator for BD_String
this->gen_cond_file_include (
- idl_global->bd_string_arg_seen_ && be_global->any_support (),
+ idl_global->bd_string_seen_ && be_global->any_support (),
"tao/AnyTypeCode/Any.h",
stream
);
this->gen_cond_file_include (
- idl_global->fixed_array_arg_seen_,
- "tao/Fixed_Array_Argument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->fixed_size_arg_seen_,
- "tao/Fixed_Size_Argument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->object_arg_seen_,
+ idl_global->non_local_iface_seen_
+ || idl_global->non_local_fwd_iface_seen_
+ || be_global->ami_call_back ()
+ || be_global->gen_amh_classes ()
+ || be_global->ami4ccm_call_back (),
"tao/Object_Argument_T.h",
stream
);
this->gen_cond_file_include (
- idl_global->special_basic_arg_seen_,
+ idl_global->special_basic_decl_seen_,
"tao/Special_Basic_Arguments.h",
stream
);
this->gen_cond_file_include (
- idl_global->ub_string_arg_seen_,
+ idl_global->ub_string_seen_,
"tao/UB_String_Arguments.h",
stream
);
this->gen_cond_file_include (
- idl_global->var_array_arg_seen_,
- "tao/Var_Array_Argument_T.h",
+ idl_global->array_seen_,
+ "tao/Fixed_Array_Argument_T.h",
stream
);
this->gen_cond_file_include (
- idl_global->var_size_arg_seen_,
- "tao/Var_Size_Argument_T.h",
+ idl_global->array_seen_,
+ "tao/Var_Array_Argument_T.h",
stream
);
@@ -2967,56 +2990,54 @@ TAO_CodeGen::gen_stub_arg_file_includes (TAO_OutStream * stream)
);
}
-
void
TAO_CodeGen::gen_skel_arg_file_includes (TAO_OutStream * stream)
{
- this->gen_cond_file_include (
- idl_global->basic_arg_seen_,
- "tao/PortableServer/Basic_SArguments.h",
- stream
- );
+ this->gen_standard_include (
+ stream,
+ "tao/PortableServer/Basic_SArguments.h");
+
+ this->gen_standard_include (
+ stream,
+ "tao/PortableServer/Special_Basic_SArguments.h");
this->gen_cond_file_include (
- idl_global->bd_string_arg_seen_,
+ idl_global->bd_string_seen_,
"tao/PortableServer/BD_String_SArgument_T.h",
stream
);
+ this->gen_standard_include (
+ stream,
+ "tao/PortableServer/Fixed_Size_SArgument_T.h");
+
+ this->gen_standard_include (
+ stream,
+ "tao/PortableServer/Var_Size_SArgument_T.h");
+
// If we have a bound string and we have any generation enabled we must
// include Any.h to get the <<= operator for BD_String
this->gen_cond_file_include (
- idl_global->bd_string_arg_seen_ && be_global->any_support (),
+ idl_global->bd_string_seen_ && be_global->any_support (),
"tao/AnyTypeCode/Any.h",
stream
);
- this->gen_cond_file_include (
- idl_global->fixed_array_arg_seen_,
- "tao/PortableServer/Fixed_Array_SArgument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->fixed_size_arg_seen_,
- "tao/PortableServer/Fixed_Size_SArgument_T.h",
- stream
- );
-
// Always needed for CORBA::Object handling in _component() skeleton
// code when an unconstrained (non-local) IDL interface is defined.
this->gen_cond_file_include (
- idl_global->non_local_iface_seen_
- || idl_global->object_arg_seen_,
- "tao/PortableServer/Object_SArgument_T.h",
- stream
- );
+ idl_global->non_local_iface_seen_
+ || idl_global->non_local_fwd_iface_seen_
+ || be_global->ami_call_back ()
+ || be_global->gen_amh_classes ()
+ || be_global->ami4ccm_call_back (),
+ "tao/PortableServer/Object_SArg_Traits.h",
+ stream);
// Always needed for CORBA::Boolean handling in _is_a() skeleton
// code when an unconstrained (non-local) IDL interface is defined.
this->gen_cond_file_include (
- idl_global->non_local_iface_seen_
- || idl_global->special_basic_arg_seen_,
+ idl_global->special_basic_decl_seen_,
"tao/PortableServer/Special_Basic_SArguments.h",
stream
);
@@ -3024,21 +3045,21 @@ TAO_CodeGen::gen_skel_arg_file_includes (TAO_OutStream * stream)
// Always needed for string argument handling in _is_a() skeleton
// code when an unconstrained (non-local) IDL interface is defined.
this->gen_cond_file_include (
- idl_global->non_local_iface_seen_
- || idl_global->ub_string_arg_seen_,
+ idl_global->ub_string_seen_
+ || idl_global->non_local_iface_seen_,
"tao/PortableServer/UB_String_SArguments.h",
stream
);
this->gen_cond_file_include (
- idl_global->var_array_arg_seen_,
- "tao/PortableServer/Var_Array_SArgument_T.h",
+ idl_global->array_seen_,
+ "tao/PortableServer/Fixed_Array_SArgument_T.h",
stream
);
this->gen_cond_file_include (
- idl_global->var_size_arg_seen_,
- "tao/PortableServer/Var_Size_SArgument_T.h",
+ idl_global->array_seen_,
+ "tao/PortableServer/Var_Array_SArgument_T.h",
stream
);
@@ -3054,13 +3075,18 @@ TAO_CodeGen::gen_skel_arg_file_includes (TAO_OutStream * stream)
stream
);
- this->gen_standard_include (
- stream,
- "tao/PortableServer/TypeCode_SArg_Traits.h");
+ // Non-abstract interface or keyword 'Object'.
+ this->gen_cond_file_include (
+ idl_global->object_arg_seen_,
+ "tao/PortableServer/Object_SArg_Traits.h",
+ stream);
- this->gen_standard_include (
- stream,
- "tao/PortableServer/Object_SArg_Traits.h");
+ // This is true if we have a typecode or TCKind in the IDL file.
+ // If not included here, it will appear in *C.cpp, if TCs not suppressed.
+ this->gen_cond_file_include (
+ idl_global->typecode_seen_,
+ "tao/PortableServer/TypeCode_SArg_Traits.h",
+ stream);
if (be_global->gen_thru_poa_collocation ())
{
@@ -3070,10 +3096,6 @@ TAO_CodeGen::gen_skel_arg_file_includes (TAO_OutStream * stream)
"tao/PortableServer/get_arg.h",
stream);
- // We need the stub side argument templates when thru-POA
- // collocation is enabled for type resolution.
- // this->gen_stub_arg_file_includes (stream);
-
// Always needed for CORBA::Boolean
// handling in _is_a() skeleton
// code when an unconstrained (non-local)
diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp
index ddc9e7838b7..5d1da4bb2c6 100644
--- a/TAO/TAO_IDL/be/be_decl.cpp
+++ b/TAO/TAO_IDL/be/be_decl.cpp
@@ -842,121 +842,6 @@ be_decl::accept (be_visitor *visitor)
return visitor->visit_decl (this);
}
-void
-be_decl::set_arg_seen_bit (be_type *bt)
-{
- if (bt == 0)
- {
- return;
- }
-
- switch (bt->node_type ())
- {
- case NT_typedef:
- {
- AST_Typedef *td = AST_Typedef::narrow_from_decl (bt);
- this->set_arg_seen_bit (
- be_type::narrow_from_decl (td->primitive_base_type ())
- );
- break;
- }
- case NT_interface:
- case NT_interface_fwd:
- case NT_valuetype:
- case NT_valuetype_fwd:
- case NT_component:
- case NT_component_fwd:
- case NT_home:
- case NT_eventtype:
- case NT_eventtype_fwd:
- idl_global->object_arg_seen_ = true;
- break;
- case NT_union:
- case NT_struct:
- if (bt->size_type () == AST_Type::FIXED)
- {
- idl_global->fixed_size_arg_seen_ = true;
- }
- else
- {
- idl_global->var_size_arg_seen_ = true;
- }
-
- break;
- case NT_struct_fwd:
- case NT_union_fwd:
- {
- AST_StructureFwd *fwd = AST_StructureFwd::narrow_from_decl (bt);
- be_type *fd = be_type::narrow_from_decl (fwd->full_definition ());
- this->set_arg_seen_bit (fd);
- break;
- }
- case NT_enum:
- case NT_enum_val:
- idl_global->basic_arg_seen_ = true;
- break;
- case NT_string:
- case NT_wstring:
- {
- AST_String *str = AST_String::narrow_from_decl (bt);
-
- if (str->max_size ()->ev ()->u.ulval == 0)
- {
- idl_global->ub_string_arg_seen_ = true;
- }
- else
- {
- idl_global->bd_string_arg_seen_ = true;
- }
-
- break;
- }
- case NT_array:
- if (bt->size_type () == AST_Type::FIXED)
- {
- idl_global->fixed_array_arg_seen_ = true;
- }
- else
- {
- idl_global->var_array_arg_seen_ = true;
- }
-
- break;
- case NT_sequence:
- idl_global->var_size_arg_seen_ = true;
- break;
- case NT_pre_defined:
- {
- AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (bt);
-
- switch (pdt->pt ())
- {
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_value:
- case AST_PredefinedType::PT_abstract:
- idl_global->object_arg_seen_ = true;
- break;
- case AST_PredefinedType::PT_any:
- idl_global->var_size_arg_seen_ = true;
- idl_global->any_arg_seen_ = true;
- break;
- case AST_PredefinedType::PT_char:
- case AST_PredefinedType::PT_wchar:
- case AST_PredefinedType::PT_octet:
- case AST_PredefinedType::PT_boolean:
- idl_global->special_basic_arg_seen_ = true;
- break;
- default:
- idl_global->basic_arg_seen_ = true;
- break;
- }
- }
- default:
- break;
- }
-}
-
IMPL_NARROW_FROM_DECL (be_decl)
diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp
index 8e1acae31ac..4e01322a549 100644
--- a/TAO/TAO_IDL/be/be_enum.cpp
+++ b/TAO/TAO_IDL/be/be_enum.cpp
@@ -44,6 +44,7 @@ be_enum::be_enum (UTL_ScopedName *n,
if (!this->imported ())
{
idl_global->enum_seen_ = true;
+ idl_global->fixed_size_decl_seen_ = true;
}
}
diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp
index 704e51a5223..4908cb9450d 100644
--- a/TAO/TAO_IDL/be/be_global.cpp
+++ b/TAO/TAO_IDL/be/be_global.cpp
@@ -147,7 +147,8 @@ BE_GlobalData::BE_GlobalData (void)
gen_lem_force_all_ (false),
tab_size_ (2),
alt_mapping_ (false),
- in_facet_servant_ (false)
+ in_facet_servant_ (false),
+ gen_arg_traits_ (true)
{
}
@@ -2506,6 +2507,18 @@ BE_GlobalData::in_facet_servant (bool val)
this->in_facet_servant_ = val;
}
+bool
+BE_GlobalData::gen_arg_traits (void) const
+{
+ return this->gen_arg_traits_;
+}
+
+void
+BE_GlobalData::gen_arg_traits (bool val)
+{
+ this->gen_arg_traits_ = val;
+}
+
unsigned long
BE_GlobalData::tab_size (void) const
{
@@ -3270,6 +3283,10 @@ BE_GlobalData::parse_args (long &i, char **av)
// Suppress Any support for local interfaces.
be_global->gen_local_iface_anyops (false);
}
+ else if (av[i][3] == 't')
+ {
+ be_global->gen_arg_traits (false);
+ }
else
{
// Suppress all Any support.
diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp
index 14fe829e7ec..0edfaad98a0 100644
--- a/TAO/TAO_IDL/be/be_operation.cpp
+++ b/TAO/TAO_IDL/be/be_operation.cpp
@@ -18,6 +18,7 @@
#include "be_predefined_type.h"
#include "be_argument.h"
#include "be_visitor.h"
+#include "be_util.h"
#include "ast_exception.h"
@@ -59,7 +60,7 @@ be_operation::be_operation (AST_Type *rt,
{
be_type *bt = be_type::narrow_from_decl (rt);
bt->seen_in_operation (true);
- this->set_arg_seen_bit (bt);
+ be_util::set_arg_seen_bit (bt);
idl_global->non_local_op_seen_ = true;
}
}
diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp
index d557215fb5e..f8c1fa664c4 100644
--- a/TAO/TAO_IDL/be/be_sequence.cpp
+++ b/TAO/TAO_IDL/be/be_sequence.cpp
@@ -72,6 +72,7 @@ be_sequence::be_sequence (AST_Expression *v,
// This one gets set for all sequences, in addition to any specialized
// one that may get set below.
idl_global->seq_seen_ = true;
+ idl_global->var_size_decl_seen_ = true;
// Don't need the return value - just set the member.
(void) this->managed_type ();
diff --git a/TAO/TAO_IDL/be/be_string.cpp b/TAO/TAO_IDL/be/be_string.cpp
index f0d93527172..fc39acd9b62 100644
--- a/TAO/TAO_IDL/be/be_string.cpp
+++ b/TAO/TAO_IDL/be/be_string.cpp
@@ -42,7 +42,19 @@ be_string::be_string (AST_Decl::NodeType nt,
be_type (nt,
n)
{
- idl_global->string_seen_ = true;
+ if (!this->imported ())
+ {
+ idl_global->string_seen_ = true;
+
+ if (v->ev ()->u.ulval != 0)
+ {
+ idl_global->bd_string_seen_ = true;
+ }
+ else
+ {
+ idl_global->ub_string_seen_ = true;
+ }
+ }
}
// Overridden method.
@@ -166,6 +178,4 @@ be_string::destroy (void)
this->AST_String::destroy ();
}
-
-
IMPL_NARROW_FROM_DECL (be_string)
diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp
index c431afbbb68..4f8547ad54b 100644
--- a/TAO/TAO_IDL/be/be_type.cpp
+++ b/TAO/TAO_IDL/be/be_type.cpp
@@ -20,6 +20,7 @@
#include "be_codegen.h"
#include "be_helper.h"
#include "be_extern.h"
+#include "be_util.h"
#include "ast_valuetype.h"
#include "ast_sequence.h"
diff --git a/TAO/TAO_IDL/be/be_util.cpp b/TAO/TAO_IDL/be/be_util.cpp
index 28f338b5abf..cc995ffbd47 100644
--- a/TAO/TAO_IDL/be/be_util.cpp
+++ b/TAO/TAO_IDL/be/be_util.cpp
@@ -16,6 +16,7 @@
#include "be_util.h"
#include "be_helper.h"
#include "be_module.h"
+#include "be_type.h"
#include "be_identifier_helper.h"
#include "be_extern.h"
#include "be_generator.h"
@@ -23,6 +24,11 @@
#include "utl_identifier.h"
+#include "ast_typedef.h"
+#include "ast_structure.h"
+#include "ast_structure_fwd.h"
+#include "ast_string.h"
+
#include "ace/OS_NS_string.h"
void
@@ -787,6 +793,12 @@ be_util::usage (void)
));
ACE_DEBUG ((
LM_DEBUG,
+ ACE_TEXT (" -Sat\t\t\tsuppress arg traits")
+ ACE_TEXT (" generation")
+ ACE_TEXT (" (arg traits generated by default)\n")
+ ));
+ ACE_DEBUG ((
+ LM_DEBUG,
ACE_TEXT (" -St\t\t\tsuppress TypeCode support")
ACE_TEXT (" (support enabled by default)\n")
));
@@ -881,3 +893,118 @@ be_util::get_output_path (bool for_anyop,
return be_global->output_dir ();
}
}
+
+void
+be_util::set_arg_seen_bit (be_type *bt)
+{
+ if (bt == 0)
+ {
+ return;
+ }
+
+ switch (bt->node_type ())
+ {
+ case AST_Decl::NT_typedef:
+ {
+ AST_Typedef *td = AST_Typedef::narrow_from_decl (bt);
+ be_util::set_arg_seen_bit (
+ be_type::narrow_from_decl (td->primitive_base_type ())
+ );
+ break;
+ }
+ case AST_Decl::NT_interface:
+ case AST_Decl::NT_interface_fwd:
+ case AST_Decl::NT_valuetype:
+ case AST_Decl::NT_valuetype_fwd:
+ case AST_Decl::NT_component:
+ case AST_Decl::NT_component_fwd:
+ case AST_Decl::NT_home:
+ case AST_Decl::NT_eventtype:
+ case AST_Decl::NT_eventtype_fwd:
+ idl_global->object_arg_seen_ = true;
+ break;
+ case AST_Decl::NT_union:
+ case AST_Decl::NT_struct:
+ if (bt->size_type () == AST_Type::FIXED)
+ {
+ idl_global->fixed_size_decl_seen_ = true;
+ }
+ else
+ {
+ idl_global->var_size_decl_seen_ = true;
+ }
+
+ break;
+ case AST_Decl::NT_struct_fwd:
+ case AST_Decl::NT_union_fwd:
+ {
+ AST_StructureFwd *fwd = AST_StructureFwd::narrow_from_decl (bt);
+ be_type *fd = be_type::narrow_from_decl (fwd->full_definition ());
+ be_util::set_arg_seen_bit (fd);
+ break;
+ }
+ case AST_Decl::NT_enum:
+ case AST_Decl::NT_enum_val:
+// idl_global->basic_arg_seen_ = true;
+ break;
+ case AST_Decl::NT_string:
+ case AST_Decl::NT_wstring:
+ {
+ AST_String *str = AST_String::narrow_from_decl (bt);
+
+ if (str->max_size ()->ev ()->u.ulval == 0)
+ {
+ idl_global->ub_string_seen_ = true;
+ }
+ else
+ {
+ idl_global->bd_string_seen_ = true;
+ }
+
+ break;
+ }
+ case AST_Decl::NT_array:
+ if (bt->size_type () == AST_Type::FIXED)
+ {
+ idl_global->fixed_array_decl_seen_ = true;
+ }
+ else
+ {
+ idl_global->var_array_decl_seen_ = true;
+ }
+
+ break;
+ case AST_Decl::NT_sequence:
+ idl_global->var_size_decl_seen_ = true;
+ break;
+ case AST_Decl::NT_pre_defined:
+ {
+ AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (bt);
+
+ switch (pdt->pt ())
+ {
+ case AST_PredefinedType::PT_object:
+ case AST_PredefinedType::PT_pseudo:
+ case AST_PredefinedType::PT_value:
+ case AST_PredefinedType::PT_abstract:
+ idl_global->object_arg_seen_ = true;
+ break;
+ case AST_PredefinedType::PT_any:
+ idl_global->var_size_decl_seen_ = true;
+ idl_global->any_arg_seen_ = true;
+ break;
+ case AST_PredefinedType::PT_char:
+ case AST_PredefinedType::PT_wchar:
+ case AST_PredefinedType::PT_octet:
+ case AST_PredefinedType::PT_boolean:
+ idl_global->special_basic_decl_seen_ = true;
+ break;
+ default:
+ break;
+ }
+ }
+ default:
+ break;
+ }
+}
+
diff --git a/TAO/TAO_IDL/be/be_valuebox.cpp b/TAO/TAO_IDL/be/be_valuebox.cpp
index 7b8569e2a05..588ebed8324 100644
--- a/TAO/TAO_IDL/be/be_valuebox.cpp
+++ b/TAO/TAO_IDL/be/be_valuebox.cpp
@@ -37,13 +37,18 @@ be_valuebox::be_valuebox (AST_Type *boxed_type,
// Always the case (according to C++ mapping specification).
this->size_type (AST_Type::VARIABLE);
- // Set the flag that says we have a valuetype in this IDL file.
- // This allows the correct #include to be generated (see be_codegen.cpp).
- idl_global->valuebase_seen_ = true;
+ if (!this->imported ())
+ {
+ // Set the flag that says we have a valuetype in this IDL file.
+ // This allows the correct #include to be generated (see be_codegen.cpp).
+ idl_global->valuebase_seen_ = true;
- // Set the flag that says we have a valuetype in this IDL file.
- // This allows the correct #include to be generated (see be_codegen.cpp).
- idl_global->valuetype_seen_ = true;
+ // Set the flag that says we have a valuetype in this IDL file.
+ // This allows the correct #include to be generated (see be_codegen.cpp).
+ idl_global->valuetype_seen_ = true;
+
+ idl_global->var_size_decl_seen_ = true;
+ }
}
// Accept a visitor.
diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp
index b065f3006f8..badb282a429 100644
--- a/TAO/TAO_IDL/be/be_valuetype.cpp
+++ b/TAO/TAO_IDL/be/be_valuetype.cpp
@@ -121,6 +121,8 @@ be_valuetype::be_valuetype (UTL_ScopedName *n,
return;
}
+ idl_global->var_size_decl_seen_ = true;
+
// Set the flag that says we have a valuetype in this IDL file.
if (this->is_defined ())
{
diff --git a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp
index d2a582920c4..cfabe5ad742 100644
--- a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp
@@ -109,7 +109,7 @@ be_visitor_arg_traits::visit_root (be_root *node)
int
be_visitor_arg_traits::visit_module (be_module *node)
{
- if (this->visit_scope (node) == -1)
+ if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_visitor_arg_traits::"
@@ -123,51 +123,61 @@ be_visitor_arg_traits::visit_module (be_module *node)
int
be_visitor_arg_traits::visit_interface (be_interface *node)
{
- if (this->generated (node))
+ if (node->imported ())
{
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
return 0;
}
- if (node->seen_in_operation ())
+ // A local interface can never be an argument.
+ if (node->is_local () || this->generated (node))
{
- TAO_OutStream *os = this->ctx_->stream ();
+ return 0;
+ }
- *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
+ this->generated (node, true);
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
+ TAO_OutStream *os = this->ctx_->stream ();
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
+ *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
+ << "// " << __FILE__ << ":" << __LINE__;
- *os << be_nl_2
- << "template<>" << be_nl
- << "class "
- << " " << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name () << "_ptr," << be_nl
- << node->name () << "_var," << be_nl
- << node->name () << "_out";
-
- if (ACE_OS::strlen (this->S_) == 0)
- {
- *os << "," << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">";
- }
+ std::string guard_suffix =
+ std::string (this->S_) + std::string ("arg_traits");
+
+ // The guard should be generated to prevent multiple declarations,
+ // since a forward declaration may appear more than once.
+ os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
- *os << "," << be_nl << this->insert_policy()
- << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
+ *os << be_nl_2
+ << "template<>" << be_nl
+ << "class "
+ << " " << this->S_ << "Arg_Traits<"
+ << node->name () << ">" << be_idt_nl
+ << ": public" << be_idt << be_idt_nl
+ << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
+ << node->name () << "_ptr," << be_nl
+ << node->name () << "_var," << be_nl
+ << node->name () << "_out";
- os->gen_endif ();
+ if (ACE_OS::strlen (this->S_) == 0)
+ {
+ *os << "," << be_nl
+ << "TAO::Objref_Traits<" << node->name () << ">";
}
+ *os << "," << be_nl << this->insert_policy()
+ << be_uidt_nl
+ << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
+ << "{" << be_nl
+ << "};";
+
+ os->gen_endif ();
+
if (this->visit_scope (node) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -176,13 +186,22 @@ be_visitor_arg_traits::visit_interface (be_interface *node)
-1);
}
- this->generated (node, true);
return 0;
}
int
be_visitor_arg_traits::visit_interface_fwd (be_interface_fwd *node)
{
+ if (node->imported ())
+ {
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
+ return 0;
+ }
+
// If a full definition with the same name in the same scope
// has been seen, then it will have gone through visit_interface()
// already.
@@ -211,53 +230,51 @@ be_visitor_arg_traits::visit_interface_fwd (be_interface_fwd *node)
int
be_visitor_arg_traits::visit_valuebox (be_valuebox *node)
{
- if (this->generated (node))
+ if (node->imported ())
{
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
return 0;
}
- if (node->seen_in_operation ())
+ if (this->generated (node))
{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl_2
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os.gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
+ return 0;
+ }
- os << be_nl_2
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name () << " *," << be_nl
- << node->name () << "_var," << be_nl
- << node->name () << "_out";
+ TAO_OutStream & os = *this->ctx_->stream ();
- // The SArgument classes don't need the traits parameter (yet?)
- if (ACE_OS::strlen (this->S_) == 0)
- {
- os << "," << be_nl
- << "TAO::Value_Traits<" << node->name () << ">";
- }
+ os << be_nl_2
+ << "// TAO_IDL - Generated from" << be_nl
+ << "// " << __FILE__ << ":" << __LINE__;
- os << "," << be_nl << this->insert_policy()
- << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
+ os << be_nl_2
+ << "template<>" << be_nl
+ << "class "
+ << this->S_ << "Arg_Traits<"
+ << node->name () << ">" << be_idt_nl
+ << ": public" << be_idt << be_idt_nl
+ << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
+ << node->name () << " *," << be_nl
+ << node->name () << "_var," << be_nl
+ << node->name () << "_out";
- os.gen_endif ();
+ // The SArgument classes don't need the traits parameter (yet?)
+ if (ACE_OS::strlen (this->S_) == 0)
+ {
+ os << "," << be_nl
+ << "TAO::Value_Traits<" << node->name () << ">";
}
+ os << "," << be_nl << this->insert_policy()
+ << be_uidt_nl
+ << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
+ << "{" << be_nl
+ << "};";
+
this->generated (node, true);
return 0;
}
@@ -265,53 +282,64 @@ be_visitor_arg_traits::visit_valuebox (be_valuebox *node)
int
be_visitor_arg_traits::visit_valuetype (be_valuetype *node)
{
- if (this->generated (node))
+ if (node->imported ())
{
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
return 0;
}
- if (node->seen_in_operation ())
+ if (this->generated (node))
{
- TAO_OutStream & os = *this->ctx_->stream ();
+ return 0;
+ }
- os << be_nl_2
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
+ /// Put this here to prevent infinite recursion with recursive
+ /// valuetypes.
+ this->generated (node, true);
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
+ TAO_OutStream & os = *this->ctx_->stream ();
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os.gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
+ os << be_nl_2
+ << "// TAO_IDL - Generated from" << be_nl
+ << "// " << __FILE__ << ":" << __LINE__;
- os << be_nl_2
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name () << " *," << be_nl
- << node->name () << "_var," << be_nl
- << node->name () << "_out";
+ std::string guard_suffix =
+ std::string (this->S_) + std::string ("arg_traits");
- // The SArgument classes don't need the traits parameter (yet?)
- if (ACE_OS::strlen (this->S_) == 0)
- {
- os << "," << be_nl
- << "TAO::Value_Traits<" << node->name () << ">";
- }
+ // The guard should be generated to prevent multiple declarations,
+ // since a forward declaration may appear more than once.
+ os.gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
- os << "," << be_nl << this->insert_policy()
- << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
+ os << be_nl_2
+ << "template<>" << be_nl
+ << "class "
+ << this->S_ << "Arg_Traits<"
+ << node->name () << ">" << be_idt_nl
+ << ": public" << be_idt << be_idt_nl
+ << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
+ << node->name () << " *," << be_nl
+ << node->name () << "_var," << be_nl
+ << node->name () << "_out";
- os.gen_endif ();
+ // The SArgument classes don't need the traits parameter (yet?)
+ if (ACE_OS::strlen (this->S_) == 0)
+ {
+ os << "," << be_nl
+ << "TAO::Value_Traits<" << node->name () << ">";
}
+ os << "," << be_nl << this->insert_policy()
+ << be_uidt_nl
+ << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
+ << "{" << be_nl
+ << "};";
+
+ os.gen_endif ();
+
if (this->visit_scope (node) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -320,13 +348,22 @@ be_visitor_arg_traits::visit_valuetype (be_valuetype *node)
-1);
}
- this->generated (node, true);
return 0;
}
int
be_visitor_arg_traits::visit_valuetype_fwd (be_valuetype_fwd *node)
{
+ if (node->imported ())
+ {
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
+ return 0;
+ }
+
if (this->generated (node))
{
return 0;
@@ -393,18 +430,21 @@ be_visitor_arg_traits::visit_operation (be_operation *node)
*os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
+ std::string guard_suffix =
+ std::string (this->S_) + std::string ("arg_traits");
+
+ // The guard should be generated to prevent multiple declarations,
+ // since a bounded (w)string of the same length may be used or typedef'd
+ // more than once.
+
+ os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
+
bool wide = (str->width () != 1);
*os << be_nl_2;
- bool const skel =
- (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SS);
-
- // Avoid generating a duplicate structure in the skeleton
- // when generating Arg_Traits<> for ThruPOA and direct
- // collocation code.
- if (!skel
- || (skel && ACE_OS::strlen (this->S_) != 0))
+ // Avoid generating a duplicate structure in the skeleton.
+ if (ACE_OS::strlen (this->S_) == 0)
{
*os << "struct " << node->flat_name () << " {};"
<< be_nl_2;
@@ -424,6 +464,8 @@ be_visitor_arg_traits::visit_operation (be_operation *node)
<< be_uidt << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "};";
+
+ os->gen_endif ();
}
}
@@ -432,8 +474,8 @@ be_visitor_arg_traits::visit_operation (be_operation *node)
if (this->visit_scope (node) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_operation - visit scope failed\n"),
+ ACE_TEXT ("be_visitor_arg_traits::")
+ ACE_TEXT ("visit_operation - visit scope failed\n")),
-1);
}
@@ -468,6 +510,15 @@ be_visitor_arg_traits::visit_attribute (be_attribute *node)
*os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
+ std::string guard_suffix =
+ std::string (this->S_) + std::string ("arg_traits");
+
+ // The guard should be generated to prevent multiple declarations,
+ // since a bounded (w)string of the same length may be used or typedef'd
+ // more than once.
+
+ os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
+
bool wide = (st->width () != 1);
// It is legal IDL to declare a bounded (w)string as an operation
@@ -479,13 +530,8 @@ be_visitor_arg_traits::visit_attribute (be_attribute *node)
*os << be_nl;
- bool const skel =
- (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SS);
-
- // Avoid generating a duplicate structure in the skeleton when
- // generating Arg_Traits<> for ThruPOA and direct collocation code.
- if (!skel
- || (skel && ACE_OS::strlen (this->S_) != 0))
+ // Avoid generating a duplicate structure in the skeleton.
+ if (ACE_OS::strlen (this->S_) == 0)
{
*os << "struct " << node->flat_name () << " {};"
<< be_nl_2;
@@ -506,6 +552,8 @@ be_visitor_arg_traits::visit_attribute (be_attribute *node)
<< "{" << be_nl
<< "};";
+ os->gen_endif ();
+
this->generated (node, true);
return 0;
}
@@ -542,6 +590,15 @@ be_visitor_arg_traits::visit_argument (be_argument *node)
*os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
+ std::string guard_suffix =
+ std::string (this->S_) + std::string ("arg_traits");
+
+ // The guard should be generated to prevent multiple declarations,
+ // since a bounded (w)string of the same length may be used or typedef'd
+ // more than once.
+
+ os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
+
bool wide = (st->width () != 1);
// It is legal IDL to declare a bounded (w)string as an operation
@@ -552,9 +609,6 @@ be_visitor_arg_traits::visit_argument (be_argument *node)
// parameter for Arg_Traits<>.
*os << be_nl_2;
- bool const skel =
- (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SS);
-
AST_Decl *op = ScopeAsDecl (node->defined_in ());
AST_Decl *intf = ScopeAsDecl (op->defined_in ());
ACE_CString arg_flat_name (intf->flat_name ());
@@ -563,10 +617,8 @@ be_visitor_arg_traits::visit_argument (be_argument *node)
arg_flat_name += '_';
arg_flat_name += node->local_name ()->get_string ();
- // Avoid generating a duplicate structure in the skeleton when
- // generating Arg_Traits<> for ThruPOA and direct collocation code.
- if (!skel
- || (skel && ACE_OS::strlen (this->S_) != 0))
+ // Avoid generating a duplicate structure in the skeleton.
+ if (ACE_OS::strlen (this->S_) == 0)
{
*os << "struct " << arg_flat_name.c_str () << " {};"
<< be_nl_2;
@@ -588,6 +640,8 @@ be_visitor_arg_traits::visit_argument (be_argument *node)
<< "{" << be_nl
<< "};";
+ os->gen_endif ();
+
this->generated (node, true);
return 0;
}
@@ -595,26 +649,35 @@ be_visitor_arg_traits::visit_argument (be_argument *node)
int
be_visitor_arg_traits::visit_sequence (be_sequence *node)
{
- if (this->generated (node) || !node->seen_in_operation ())
+ if (node->imported ())
+ {
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
+ return 0;
+ }
+
+ if (this->generated (node))
{
return 0;
}
+ this->generated (node, true);
+
TAO_OutStream *os = this->ctx_->stream ();
be_typedef *alias = this->ctx_->alias ();
+ /// No arg traits for anonymous sequences.
+ if (alias == 0)
+ {
+ return 0;
+ }
+
*os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (alias->flat_name (),
- guard_suffix.c_str (),
- false);
-
bool use_vec = (node->unbounded () && be_global->alt_mapping ());
UTL_ScopedName *sn = alias->name ();
@@ -626,23 +689,28 @@ be_visitor_arg_traits::visit_sequence (be_sequence *node)
<< (use_vec ? "Vector_" : "Var_Size_")
<< this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
<< sn << "," << be_nl
- << this->insert_policy() << be_uidt_nl
+ << this->insert_policy () << be_uidt_nl
<< ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "};";
-
-
- os->gen_endif ();
-
- this->generated (node, true);
+
return 0;
}
int
be_visitor_arg_traits::visit_string (be_string *node)
{
- if ((this->generated (node) && !this->ctx_->alias())
- || !node->seen_in_operation ())
+ if (node->imported ())
+ {
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
+ return 0;
+ }
+
+ if (this->generated (node) && !this->ctx_->alias())
{
return 0;
}
@@ -665,12 +733,13 @@ be_visitor_arg_traits::visit_string (be_string *node)
std::string guard_suffix =
std::string (this->S_) + std::string ("arg_traits");
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
+ // The guard should be generated to prevent multiple declarations,
+ // since a bounded (w)string of the same length may be used or typedef'd
+ // more than once.
if (alias == 0)
{
- os->gen_ifdef_macro (node->flat_name(), guard_suffix.c_str (), false);
+ os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
}
else
{
@@ -703,13 +772,9 @@ be_visitor_arg_traits::visit_string (be_string *node)
delete [] bound_string;
}
- bool const skel =
- (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SS);
-
- // Avoid generating a duplicate structure in the skeleton when
- // generating Arg_Traits<> for ThruPOA and direct collocation code.
- if (!skel
- || (skel && ACE_OS::strlen (this->S_) != 0))
+ // Avoid generating a duplicate structure in the skeleton since
+ // it has already been generated in *C.h.
+ if (ACE_OS::strlen (this->S_) == 0)
{
// A workaround 'dummy' type, since bounded (w)strings are all
// generated as typedefs of (w)char *.
@@ -751,7 +816,7 @@ be_visitor_arg_traits::visit_string (be_string *node)
<< this->insert_policy()
<< be_uidt << be_uidt_nl
<< ">"
- << be_uidt << be_uidt << be_uidt << be_uidt_nl
+ << be_uidt << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "};";
@@ -764,18 +829,24 @@ be_visitor_arg_traits::visit_string (be_string *node)
int
be_visitor_arg_traits::visit_array (be_array *node)
{
- if (this->generated (node) || !node->seen_in_operation ())
+ if (node->imported ())
{
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
return 0;
}
- TAO_OutStream *os = this->ctx_->stream ();
+ // Add the alias check here because anonymous arrays can't be
+ // operation arguments.
+ if (this->generated (node) || this->ctx_->alias () == 0)
+ {
+ return 0;
+ }
- // This should be generated even for imported nodes. The ifdef guard prevents
- // multiple declarations.
- ACE_CString suffix (this->S_);
- suffix += "arg_traits";
- os->gen_ifdef_macro (node->flat_name (), suffix.c_str (), false);
+ TAO_OutStream *os = this->ctx_->stream ();
*os << be_nl_2
<< "template<>" << be_nl
@@ -799,8 +870,6 @@ be_visitor_arg_traits::visit_array (be_array *node)
<< "{" << be_nl
<< "};";
- os->gen_endif ();
-
this->generated (node, true);
return 0;
}
@@ -808,7 +877,17 @@ be_visitor_arg_traits::visit_array (be_array *node)
int
be_visitor_arg_traits::visit_enum (be_enum *node)
{
- if (this->generated (node) || !node->seen_in_operation ())
+ if (node->imported ())
+ {
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
+ return 0;
+ }
+
+ if (this->generated (node))
{
return 0;
}
@@ -818,13 +897,6 @@ be_visitor_arg_traits::visit_enum (be_enum *node)
*os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
*os << be_nl_2
<< "template<>" << be_nl
<< "class "
@@ -839,8 +911,6 @@ be_visitor_arg_traits::visit_enum (be_enum *node)
<< "{" << be_nl
<< "};";
- os->gen_endif ();
-
this->generated (node, true);
return 0;
}
@@ -848,7 +918,17 @@ be_visitor_arg_traits::visit_enum (be_enum *node)
int
be_visitor_arg_traits::visit_structure (be_structure *node)
{
- if (this->generated (node) || !node->seen_in_operation ())
+ if (node->imported ())
+ {
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
+ return 0;
+ }
+
+ if (this->generated (node))
{
return 0;
}
@@ -860,13 +940,6 @@ be_visitor_arg_traits::visit_structure (be_structure *node)
*os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
*os << be_nl_2
<< "template<>" << be_nl
<< "class "
@@ -882,8 +955,6 @@ be_visitor_arg_traits::visit_structure (be_structure *node)
<< "{" << be_nl
<< "};";
- os->gen_endif ();
-
/* Set this before visiting the scope so things like
interface foo
@@ -950,13 +1021,24 @@ be_visitor_arg_traits::visit_field (be_field *node)
this->generated (node, true);
this->generated (bt, true);
+
return 0;
}
int
be_visitor_arg_traits::visit_union (be_union *node)
{
- if (this->generated (node) || !node->seen_in_operation ())
+ if (node->imported ())
+ {
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
+ return 0;
+ }
+
+ if (this->generated (node))
{
return 0;
}
@@ -968,13 +1050,6 @@ be_visitor_arg_traits::visit_union (be_union *node)
*os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
*os << be_nl_2
<< "template<>" << be_nl
<< "class "
@@ -991,8 +1066,6 @@ be_visitor_arg_traits::visit_union (be_union *node)
<< "{" << be_nl
<< "};";
- os->gen_endif ();
-
/* Set this before visiting the scope so things like
interface foo
@@ -1054,7 +1127,17 @@ be_visitor_arg_traits::visit_union_branch (be_union_branch *node)
int
be_visitor_arg_traits::visit_typedef (be_typedef *node)
{
- if (this->generated (node) || !node->seen_in_operation ())
+ if (node->imported ())
+ {
+ // Arg traits will presumably already be generated, but
+ // perhaps from another compilation unit. We mark it
+ // generated because if we get here from a typedef in
+ // the main file, we should skip it.
+ this->generated (node, true);
+ return 0;
+ }
+
+ if (this->generated (node))
{
return 0;
}
@@ -1074,23 +1157,6 @@ be_visitor_arg_traits::visit_typedef (be_typedef *node)
// Make a decision based on the primitive base type.
be_type *bt = node->primitive_base_type ();
- // We can't set seen_in_operation_ for the base type
- // in the be_typedef operation, since valuetype OBV
- // constructor code may reset it to FALSE, and the base
- // type may be used unaliased in another arg somewhere.
- // So we just set it to TRUE here, since we know it
- // has to be TRUE at this point. We also set the
- // 'generated' flag to false if the original value
- // of 'seen_in_operation' was false, since the base
- // type could have been processed already, as a member
- // for example, before the typedef was seen, which
- // would short-circuit things.
- if (!bt->seen_in_operation ())
- {
- bt->seen_in_operation (true);
- this->generated (bt, false);
- }
-
if (!bt || (bt->accept (this) == -1))
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -1104,6 +1170,30 @@ be_visitor_arg_traits::visit_typedef (be_typedef *node)
return 0;
}
+int
+be_visitor_arg_traits::visit_component (be_component *node)
+{
+ return this->visit_interface (node);
+}
+
+int
+be_visitor_arg_traits::visit_component_fwd (be_component_fwd *node)
+{
+ return this->visit_interface_fwd (node);
+}
+
+int
+be_visitor_arg_traits::visit_connector (be_connector *node)
+{
+ return this->visit_component (node);
+}
+
+int
+be_visitor_arg_traits::visit_home (be_home *node)
+{
+ return this->visit_interface (node);
+}
+
bool
be_visitor_arg_traits::generated (be_decl *node) const
{
@@ -1111,9 +1201,9 @@ be_visitor_arg_traits::generated (be_decl *node) const
{
switch (this->ctx_->state ())
{
- case TAO_CodeGen::TAO_ROOT_CS:
+ case TAO_CodeGen::TAO_ROOT_CH:
return node->cli_arg_traits_gen ();
- case TAO_CodeGen::TAO_ROOT_SS:
+ case TAO_CodeGen::TAO_ROOT_SH:
return node->srv_arg_traits_gen ();
default:
return 0;
@@ -1131,10 +1221,10 @@ be_visitor_arg_traits::generated (be_decl *node,
{
switch (this->ctx_->state ())
{
- case TAO_CodeGen::TAO_ROOT_CS:
+ case TAO_CodeGen::TAO_ROOT_CH:
node->cli_arg_traits_gen (val);
return;
- case TAO_CodeGen::TAO_ROOT_SS:
+ case TAO_CodeGen::TAO_ROOT_SH:
node->srv_arg_traits_gen (val);
return;
default:
@@ -1145,30 +1235,6 @@ be_visitor_arg_traits::generated (be_decl *node,
node->srv_sarg_traits_gen (val);
}
-int
-be_visitor_arg_traits::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_arg_traits::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_arg_traits::visit_connector (be_connector *node)
-{
- return this->visit_component (node);
-}
-
-int
-be_visitor_arg_traits::visit_home (be_home *node)
-{
- return this->visit_interface (node);
-}
-
const char *
be_visitor_arg_traits::insert_policy (void)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
index 8bbb08ac0dc..47c6384e8f8 100644
--- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
@@ -169,7 +169,7 @@ int be_visitor_array_ch::visit_array (be_array *node)
'\0',
2);
- if (this->ctx_->tdef ())
+ if (this->ctx_->tdef () != 0)
{
anon_p[0] = '\0';
}
@@ -184,9 +184,9 @@ int be_visitor_array_ch::visit_array (be_array *node)
if (node->gen_dimensions (os, 1) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_array - "
- "gen slice dimensions failed\n"),
+ ACE_TEXT ("be_visitor_array_ch::")
+ ACE_TEXT ("visit_array - ")
+ ACE_TEXT ("gen slice dimensions failed\n")),
-1);
}
@@ -299,7 +299,7 @@ int be_visitor_array_ch::visit_array (be_array *node)
<< "const ";
*os << node->nested_type_name (scope, "_slice")
<< " *_tao_from);" << be_uidt
- << be_uidt << be_nl;
+ << be_uidt;
}
else
{
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp
index 2e7336b3d15..6fb3960a4e6 100644
--- a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp
@@ -52,10 +52,9 @@ be_visitor_enum_ch::visit_enum (be_enum *node)
if (this->visit_scope (node) == 1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_enum_ch::"
- "visit_enum - "
- "scope generation failed\n"
- ),
+ ACE_TEXT ("be_visitor_enum_ch::")
+ ACE_TEXT ("visit_enum - ")
+ ACE_TEXT ("scope generation failed\n")),
-1);
}
@@ -74,11 +73,10 @@ be_visitor_enum_ch::visit_enum (be_enum *node)
if (node->accept (&visitor) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_enum_ch::"
- "visit_enum - "
- "TypeCode declaration failed\n"
- ),
- -1);
+ ACE_TEXT ("be_visitor_enum_ch::")
+ ACE_TEXT ("visit_enum - ")
+ ACE_TEXT ("TypeCode declaration failed\n" )),
+ -1);
}
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
index bf786bb9c94..061e0c578d0 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
@@ -36,7 +36,7 @@ be_visitor_operation_arglist::visit_operation (be_operation *node)
TAO_OutStream *os = this->ctx_->stream ();
bool has_args = node->argument_count () > 0;
- *os << " (";
+ *os << " (" << be_idt_nl;
switch (this->ctx_->state ())
{
@@ -68,7 +68,7 @@ be_visitor_operation_arglist::visit_operation (be_operation *node)
*os << "void";
}
- *os << ")";
+ *os << ")" << be_uidt;
switch (this->ctx_->state ())
{
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
index 42f56085bc1..bf7102103a5 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
@@ -557,10 +557,16 @@ be_visitor_operation::gen_arg_template_param_name (AST_Decl *scope,
*os << "char *";
}
}
- else
+ else if (nt == AST_Decl::NT_sequence)
{
+ // In some cases (e.g., if the node is imported)
+ // the underlying sequence is still named 'sequence'.
*os << bt->name ();
}
+ else
+ {
+ *os << ut->name ();
+ }
if (nt == AST_Decl::NT_array)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
index d6986c83e12..66704a49d57 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
@@ -85,9 +85,9 @@ be_visitor_operation_cs::visit_operation (be_operation *node)
if (!bt)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "Bad return type\n"),
+ ACE_TEXT ("be_visitor_operation_cs::")
+ ACE_TEXT ("visit_operation - ")
+ ACE_TEXT ("bad return type\n")),
-1);
}
@@ -98,9 +98,9 @@ be_visitor_operation_cs::visit_operation (be_operation *node)
if (bt->accept (&rt_visitor) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return type failed\n"),
+ ACE_TEXT ("be_visitor_operation_cs::")
+ ACE_TEXT ("visit_operation - ")
+ ACE_TEXT ("codegen for return type failed\n")),
-1);
}
@@ -116,18 +116,18 @@ be_visitor_operation_cs::visit_operation (be_operation *node)
if (node->accept (&al_visitor) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
+ ACE_TEXT ("be_visitor_operation_cs::")
+ ACE_TEXT ("visit_operation - ")
+ ACE_TEXT ("codegen for argument list failed\n")),
-1);
}
if (this->gen_stub_operation_body (node, bt) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for stub body failed\n"),
+ ACE_TEXT ("be_visitor_operation_cs::")
+ ACE_TEXT ("visit_operation - ")
+ ACE_TEXT ("codegen for stub body failed\n")),
-1);
}
@@ -147,9 +147,9 @@ be_visitor_operation_cs::visit_operation (be_operation *node)
if (status == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for AMI reply stub failed\n"),
+ ACE_TEXT ("be_visitor_operation_cs::")
+ ACE_TEXT ("visit_operation - ")
+ ACE_TEXT ("codegen for AMI reply stub failed\n")),
-1);
}
}
@@ -168,9 +168,9 @@ be_visitor_operation_cs::visit_argument (be_argument *node)
if (!bt)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_argument - "
- "Bad argument type\n"),
+ ACE_TEXT ("be_visitor_operation_cs::")
+ ACE_TEXT ("visit_argument - ")
+ ACE_TEXT ("bad argument type\n")),
-1);
}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp
index c46957b7beb..7a3048a0c16 100644
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp
@@ -47,6 +47,15 @@ be_visitor_root_ch::visit_root (be_root *node)
-1);
}
+ if (be_global->gen_arg_traits () && this->gen_arg_traits (node) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_root_ch::")
+ ACE_TEXT ("visit_root - failed to ")
+ ACE_TEXT ("generate stub arg traits\n")),
+ -1);
+ }
+
this->gen_proxy_broker_factory_pointers ();
this->gen_ref_counting_overrides ();
@@ -130,6 +139,14 @@ be_visitor_root_ch::init (void)
return 0;
}
+int
+be_visitor_root_ch::gen_arg_traits (be_root *node)
+{
+ be_visitor_context ctx = *this->ctx_;
+ be_visitor_arg_traits arg_visitor ("", &ctx);
+ return node->accept (&arg_visitor);
+}
+
void
be_visitor_root_ch::gen_fwd_decls (void)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp
index 8727266c11a..3a293267f84 100644
--- a/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp
@@ -36,16 +36,6 @@ be_visitor_root_cs::visit_root (be_root *node)
-1);
}
-
- if (this->gen_arg_traits (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("be_visitor_root_cs::")
- ACE_TEXT ("visit_root - failed to ")
- ACE_TEXT ("generate stub arg traits\n")),
- -1);
- }
-
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -112,14 +102,6 @@ be_visitor_root_cs::init (void)
}
int
-be_visitor_root_cs::gen_arg_traits (be_root *node)
-{
- be_visitor_context ctx = *this->ctx_;
- be_visitor_arg_traits arg_visitor ("", &ctx);
- return node->accept (&arg_visitor);
-}
-
-int
be_visitor_root_cs::gen_obv_defns (be_root *node)
{
be_visitor_context ctx = *this->ctx_;
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp
index 44b6aba4236..44c33b211b5 100644
--- a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp
@@ -36,6 +36,12 @@ be_visitor_root_sh::visit_root (be_root *node)
-1);
}
+ if (this->gen_arg_traits (node) == -1)
+ {
+ /// Error message already output.
+ return -1;
+ }
+
/// The SI and SS cases are caught in BE_produce(). We
/// want to generate an empty skeleton header file, which
/// has been done, so -SS can flag a skip of the scope
@@ -77,3 +83,23 @@ be_visitor_root_sh::init (void)
this->ctx_->stream (tao_cg->server_header ());
return 0;
}
+
+int
+be_visitor_root_sh::gen_arg_traits (be_root *node)
+{
+ be_visitor_context ctx = *this->ctx_;
+ be_visitor_arg_traits arg_visitor ("S", &ctx);
+ int status = node->accept (&arg_visitor);
+
+ if (status == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_root_sh::")
+ ACE_TEXT ("gen_arg_traits - failed to ")
+ ACE_TEXT ("generate skeleton arg traits\n")),
+ -1);
+ }
+
+ return 0;
+}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp
index b754b1d52a9..86db6fa67e5 100644
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp
@@ -36,12 +36,6 @@ be_visitor_root_ss::visit_root (be_root *node)
-1);
}
- if (this->gen_arg_traits (node) == -1)
- {
- /// Error message already output.
- return -1;
- }
-
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -97,39 +91,3 @@ be_visitor_root_ss::init (void)
return 0;
}
-int
-be_visitor_root_ss::gen_arg_traits (be_root *node)
-{
- be_visitor_context ctx = *this->ctx_;
- be_visitor_arg_traits arg_visitor ("S", &ctx);
- int status = node->accept (&arg_visitor);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("be_visitor_root_ss::")
- ACE_TEXT ("gen_arg_traits - failed to ")
- ACE_TEXT ("generate skeleton arg traits\n")),
- -1);
- }
-
- if (be_global->gen_thru_poa_collocation ()
- || be_global->gen_direct_collocation ())
- {
- be_visitor_arg_traits arg_visitor ("", &ctx);
- status = node->accept (&arg_visitor);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("be_visitor_root_ss::")
- ACE_TEXT ("gen_arg_traits - failed to ")
- ACE_TEXT ("generate collocated ")
- ACE_TEXT ("skeleton arg traits\n")),
- -1);
- }
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence.cpp b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
index 149258b6449..539f8be7c32 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
@@ -12,6 +12,8 @@
*/
//=============================================================================
+#include "ace/Log_Msg.h"
+
#include "be_array.h"
#include "be_enum.h"
#include "be_exception.h"
@@ -45,7 +47,6 @@
#include "be_visitor_sequence.h"
#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
#include "be_visitor_sequence/any_op_ch.cpp"
#include "be_visitor_sequence/any_op_cs.cpp"
diff --git a/TAO/TAO_IDL/be/be_visitor_structure.cpp b/TAO/TAO_IDL/be/be_visitor_structure.cpp
index 73e941095cf..d2efa0a3d8a 100644
--- a/TAO/TAO_IDL/be/be_visitor_structure.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_structure.cpp
@@ -12,6 +12,8 @@
*/
//=============================================================================
+#include "ace/Log_Msg.h"
+
#include "be_field.h"
#include "be_structure.h"
#include "be_helper.h"
@@ -24,7 +26,6 @@
#include "be_visitor_field.h"
#include "be_visitor_typecode.h"
#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
#include "be_visitor_structure/structure.cpp"
#include "be_visitor_structure/structure_ch.cpp"
diff --git a/TAO/TAO_IDL/be/be_visitor_union.cpp b/TAO/TAO_IDL/be/be_visitor_union.cpp
index 45d36b6c5bf..178bdbf431f 100644
--- a/TAO/TAO_IDL/be/be_visitor_union.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union.cpp
@@ -12,6 +12,9 @@
*/
//=============================================================================
+#include "ace/Log_Msg.h"
+
+#include "ast_union_label.h"
#include "be_enum.h"
#include "be_typedef.h"
@@ -23,7 +26,6 @@
#include "be_union_branch.h"
#include "be_helper.h"
#include "be_extern.h"
-#include "ast_union_label.h"
#include "be_visitor_union.h"
#include "be_visitor_enum.h"
@@ -31,7 +33,6 @@
#include "be_visitor_union_branch.h"
#include "be_visitor_typecode.h"
#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
#include "be_visitor_union/discriminant_ch.cpp"
#include "be_visitor_union/discriminant_ci.cpp"
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox.cpp
index e044797c0d1..7a4aba89dd8 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuebox.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuebox.cpp
@@ -13,6 +13,9 @@
*/
//=============================================================================
+#include "ace/Log_Msg.h"
+
+#include "utl_identifier.h"
#include "be_array.h"
#include "be_enum.h"
@@ -31,14 +34,12 @@
#include "be_union_branch.h"
#include "be_util.h"
#include "be_valuebox.h"
-#include "utl_identifier.h"
#include "be_visitor_context.h"
#include "be_visitor_sequence.h"
#include "be_visitor_typecode.h"
#include "be_visitor_union.h"
#include "be_visitor_valuebox.h"
-#include "ace/Log_Msg.h"
#include "be_visitor_valuebox/valuebox.cpp"
#include "be_visitor_valuebox/valuebox_ch.cpp"
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp
index 5af1303fe8f..966d55f8de4 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp
@@ -105,8 +105,10 @@ be_visitor_valuebox_ch::visit_valuebox (be_valuebox *node)
if (!bt || (bt->accept (this) == -1))
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::visit_valuebox - "
- "type-specific valuebox code generation failed\n"),
+ ACE_TEXT ("be_visitor_valuebox_ch::")
+ ACE_TEXT ("visit_valuebox - ")
+ ACE_TEXT ("type-specific valuebox")
+ ACE_TEXT (" code generation failed\n")),
-1);
}
@@ -144,9 +146,9 @@ be_visitor_valuebox_ch::visit_valuebox (be_valuebox *node)
if (node->accept (&visitor) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::"
- "visit_valuebox - "
- "TypeCode declaration failed\n"),
+ ACE_TEXT ("be_visitor_valuebox_ch::")
+ ACE_TEXT ("visit_valuebox - ")
+ ACE_TEXT ("TypeCode declaration failed\n")),
-1);
}
}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
index 2bdb4261171..a05039ae09b 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
@@ -13,6 +13,9 @@
*/
//=============================================================================
+#include "utl_identifier.h"
+#include "utl_exceptlist.h"
+
#include "be_argument.h"
#include "be_array.h"
#include "be_attribute.h"
@@ -42,8 +45,6 @@
#include "be_valuetype_fwd.h"
#include "be_helper.h"
#include "be_extern.h"
-#include "utl_identifier.h"
-#include "utl_exceptlist.h"
#include "be_util.h"
#include "be_visitor_valuetype.h"
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
index c6ebd76e1f9..219b51e3479 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
@@ -369,7 +369,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_valuetype_ch::")
- ACE_TEXT ("visit_structure - ")
+ ACE_TEXT ("visit_valuetype - ")
ACE_TEXT ("TypeCode declaration failed\n")),
-1);
}
diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h
index 3f240b82ebb..b0611b2bb8a 100644
--- a/TAO/TAO_IDL/be_include/be_codegen.h
+++ b/TAO/TAO_IDL/be_include/be_codegen.h
@@ -404,6 +404,7 @@ private:
/// Utility methods for generating file includes.
void gen_stub_hdr_includes (void);
void gen_stub_src_includes (void);
+ void gen_skel_hdr_includes (void);
void gen_skel_src_includes (void);
void gen_seq_file_includes (void);
void gen_any_file_includes (TAO_OutStream * stream) ;
diff --git a/TAO/TAO_IDL/be_include/be_decl.h b/TAO/TAO_IDL/be_include/be_decl.h
index 8230e37a051..ab8909fea71 100644
--- a/TAO/TAO_IDL/be_include/be_decl.h
+++ b/TAO/TAO_IDL/be_include/be_decl.h
@@ -164,10 +164,6 @@ public:
DEF_NARROW_FROM_DECL (be_decl);
-protected:
- // Called by be_operation (for the return type) and be_argument.
- void set_arg_seen_bit (be_type *);
-
private:
// Variables that indicate if the code generation for that node is already
// been done. This way we avoid regenerating same code.
diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h
index ba52b8e1656..15e9a359a38 100644
--- a/TAO/TAO_IDL/be_include/be_global.h
+++ b/TAO/TAO_IDL/be_include/be_global.h
@@ -850,6 +850,9 @@ public:
bool in_facet_servant (void) const;
void in_facet_servant (bool val);
+ bool gen_arg_traits (void) const;
+ void gen_arg_traits (bool val);
+
unsigned long tab_size (void) const;
void tab_size (unsigned long val);
@@ -1205,8 +1208,11 @@ private:
/// Are we generating STL types?
bool alt_mapping_;
- /// Are we generating a facet servant?
+ /// Are we in the act of generating a facet servant?
bool in_facet_servant_;
+
+ /// Are we generating arg traits template instantiations?
+ bool gen_arg_traits_;
};
#endif /* _BE_GLOBAL_H */
diff --git a/TAO/TAO_IDL/be_include/be_util.h b/TAO/TAO_IDL/be_include/be_util.h
index e5a4933f3f6..26f05ee0bd7 100644
--- a/TAO/TAO_IDL/be_include/be_util.h
+++ b/TAO/TAO_IDL/be_include/be_util.h
@@ -21,6 +21,7 @@
class TAO_OutStream;
class be_module;
+class be_type;
class AST_Decl;
class AST_Generator;
@@ -63,6 +64,9 @@ public:
/// Called from various places.
static const char *
get_output_path (bool for_anyop, bool for_skel);
+
+ // Called by each node upon construction.
+ static void set_arg_seen_bit (be_type *);
};
#endif // if !defined
diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_ch.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_ch.h
index 564947e2b3b..8bf913f21db 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_root/root_ch.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_ch.h
@@ -42,6 +42,7 @@ private:
/// Encapsulating various bits of code generation peculiar
/// to the client header file, done either before or after
/// the main scope traversal.
+ int gen_arg_traits (be_root *node);
void gen_fwd_decls (void);
void gen_proxy_broker_factory_pointers (void);
void gen_ref_counting_overrides (void);
diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_cs.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_cs.h
index 42f4f44c09a..f4379b1c601 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_root/root_cs.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_cs.h
@@ -42,7 +42,6 @@ private:
/// Encapsulating various bits of code generation peculiar
/// to the client source file, done either before or after
/// he main scope traversal.
- int gen_arg_traits (be_root *node);
int gen_obv_defns (be_root *node);
int gen_any_ops (be_root *node);
int gen_cdr_ops (be_root *node);
diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_sh.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_sh.h
index 7e10ef9dad5..b2ae378626f 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_root/root_sh.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_sh.h
@@ -34,8 +34,14 @@ public:
virtual int visit_root (be_root *node);
+private:
/// Open file and initialize stream.
int init (void);
+
+ /// Generate arg template trait specializations in
+ /// the skeleton header file, done before the main
+ /// scope traversal.
+ int gen_arg_traits (be_root *node);
};
#endif /* _BE_VISITOR_ROOT_ROOT_SH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_ss.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_ss.h
index 50b67208471..423d5330035 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_root/root_ss.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_ss.h
@@ -37,11 +37,6 @@ public:
private:
/// Open file and initialize stream.
int init (void);
-
- /// Generate arg template trait specializations in
- /// the skeleton source file, done before the main
- /// scope traversal.
- int gen_arg_traits (be_root *node);
};
#endif /* _BE_VISITOR_ROOT_ROOT_SS_H_ */
diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h
index ccf11aa7d1c..0ae8a618e35 100644
--- a/TAO/TAO_IDL/include/idl_global.h
+++ b/TAO/TAO_IDL/include/idl_global.h
@@ -309,9 +309,8 @@ public:
bool array_seen_;
bool array_seq_seen_;
bool base_object_seen_;
- bool basic_arg_seen_;
bool basic_type_seen_;
- bool bd_string_arg_seen_;
+ bool bd_string_seen_;
bool boolean_seq_seen_;
bool char_seq_seen_;
bool component_seen_;
@@ -319,8 +318,8 @@ public:
bool double_seq_seen_;
bool enum_seen_;
bool exception_seen_;
- bool fixed_array_arg_seen_;
- bool fixed_size_arg_seen_;
+ bool fixed_array_decl_seen_;
+ bool fixed_size_decl_seen_;
bool float_seq_seen_;
bool fwd_iface_seen_;
bool fwd_valuetype_seen_;
@@ -330,6 +329,7 @@ public:
bool long_seq_seen_;
bool longdouble_seq_seen_;
bool longlong_seq_seen_;
+ bool non_local_fwd_iface_seen_;
bool non_local_iface_seen_;
bool non_local_op_seen_;
bool object_arg_seen_;
@@ -339,12 +339,12 @@ public:
bool recursive_type_seen_;
bool seq_seen_;
bool short_seq_seen_;
- bool special_basic_arg_seen_;
+ bool special_basic_decl_seen_;
bool string_seen_;
bool string_member_seen_;
bool string_seq_seen_;
bool typecode_seen_;
- bool ub_string_arg_seen_;
+ bool ub_string_seen_;
bool ulong_seq_seen_;
bool ulonglong_seq_seen_;
bool union_seen_;
@@ -352,8 +352,8 @@ public:
bool valuebase_seen_;
bool valuefactory_seen_;
bool valuetype_seen_;
- bool var_array_arg_seen_;
- bool var_size_arg_seen_;
+ bool var_array_decl_seen_;
+ bool var_size_decl_seen_;
bool vt_seq_seen_;
bool wchar_seq_seen_;
bool wstring_seq_seen_;
diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp
index 6a7fbb6f75d..740c9b58084 100644
--- a/TAO/TAO_IDL/util/utl_global.cpp
+++ b/TAO/TAO_IDL/util/utl_global.cpp
@@ -243,9 +243,8 @@ IDL_GlobalData::reset_flag_seen (void)
array_seen_ = false;
array_seq_seen_ = false;
base_object_seen_ = false;
- basic_arg_seen_ = false;
//basic_type_seen_
- bd_string_arg_seen_ = false;
+ bd_string_seen_ = false;
boolean_seq_seen_ = false;
char_seq_seen_ = false;
component_seen_ = false;
@@ -253,8 +252,8 @@ IDL_GlobalData::reset_flag_seen (void)
double_seq_seen_ = false;
enum_seen_ = false;
exception_seen_ = false;
- fixed_array_arg_seen_ = false;
- fixed_size_arg_seen_ = false;
+ fixed_array_decl_seen_ = false;
+ fixed_size_decl_seen_ = false;
float_seq_seen_ = false;
fwd_iface_seen_ = false;
fwd_valuetype_seen_ = false;
@@ -264,6 +263,7 @@ IDL_GlobalData::reset_flag_seen (void)
long_seq_seen_ = false;
longdouble_seq_seen_ = false;
longlong_seq_seen_ = false;
+ non_local_fwd_iface_seen_ = false;
non_local_iface_seen_ = false;
non_local_op_seen_ = false;
object_arg_seen_ = false;
@@ -273,12 +273,12 @@ IDL_GlobalData::reset_flag_seen (void)
recursive_type_seen_ = false;
seq_seen_ = false;
short_seq_seen_ = false;
- special_basic_arg_seen_ = false;
+ special_basic_decl_seen_ = false;
string_seen_ = false;
string_member_seen_ = false;
string_seq_seen_ = false;
typecode_seen_ = false;
- ub_string_arg_seen_ = false;
+ ub_string_seen_ = false;
ulong_seq_seen_ = false;
ulonglong_seq_seen_ = false;
union_seen_ = false;
@@ -286,8 +286,8 @@ IDL_GlobalData::reset_flag_seen (void)
valuebase_seen_ = false;
valuefactory_seen_ = false;
valuetype_seen_ = false;
- var_array_arg_seen_ = false;
- var_size_arg_seen_ = false;
+ var_array_decl_seen_ = false;
+ var_size_decl_seen_ = false;
vt_seq_seen_ = false;
wchar_seq_seen_ = false;
wstring_seq_seen_ = false;
diff --git a/TAO/docs/compiler.html b/TAO/docs/compiler.html
index 2add0d21c33..c3418aecc26 100644
--- a/TAO/docs/compiler.html
+++ b/TAO/docs/compiler.html
@@ -1109,6 +1109,13 @@ also receives other options that are specific to it.<p>
<td>&nbsp;</td>
</tr>
+ <tr><a name="Sat">
+ <td><tt>-Sat</tt></td>
+
+ <td>Suppress generation of arg traits instantiations</td>
+ <td>&nbsp;</td>
+ </tr>
+
<tr><a name="Sp">
<td><tt>-Sp</tt></td>
diff --git a/TAO/tao/PolicyC.cpp b/TAO/tao/PolicyC.cpp
index eff733a61b6..604ac00ebcc 100644
--- a/TAO/tao/PolicyC.cpp
+++ b/TAO/tao/PolicyC.cpp
@@ -35,7 +35,6 @@
#include "tao/Invocation_Adapter.h"
#include "tao/Object_T.h"
#include "tao/Basic_Arguments.h"
-#include "tao/Object_Argument_T.h"
#include "ace/OS_NS_string.h"
#include "tao/AnyTypeCode_Adapter.h"
#include "ace/Dynamic_Service.h"
@@ -67,30 +66,6 @@ namespace TAO
}
-// Arg traits specializations.
-namespace TAO
-{
-
-#if !defined (_CORBA_POLICY__ARG_TRAITS_CS_)
-#define _CORBA_POLICY__ARG_TRAITS_CS_
-
- template<>
- class Arg_Traits<CORBA::Policy>
- : public
- Object_Arg_Traits_T<
- CORBA::Policy_ptr,
- CORBA::Policy_var,
- CORBA::Policy_out,
- TAO::Objref_Traits<CORBA::Policy>,
- TAO::Any_Insert_Policy_AnyTypeCode_Adapter
- >
- {
- };
-
-#endif /* end #if !defined */
-}
-
-
// TAO_IDL - Generated from
// be\be_visitor_exception/exception_cs.cpp:63
diff --git a/TAO/tao/PortableServer/PolicyS.cpp b/TAO/tao/PortableServer/PolicyS.cpp
index 29c81c7860d..b9bffd54bbe 100644
--- a/TAO/tao/PortableServer/PolicyS.cpp
+++ b/TAO/tao/PortableServer/PolicyS.cpp
@@ -74,7 +74,7 @@ namespace TAO
#if !defined (_CORBA_POLICY__SARG_TRAITS_SS_)
#define _CORBA_POLICY__SARG_TRAITS_SS_
-
+/*
template<>
class SArg_Traits<CORBA::Policy>
: public
@@ -86,38 +86,10 @@ namespace TAO
>
{
};
-
+ */
#endif /* end #if !defined */
}
-
-// TAO_IDL - Generated from
-// be\be_visitor_arg_traits.cpp:69
-
-// Arg traits specializations.
-namespace TAO
-{
-
-#if !defined (_CORBA_POLICY__ARG_TRAITS_SS_)
-#define _CORBA_POLICY__ARG_TRAITS_SS_
-
- template<>
- class Arg_Traits<CORBA::Policy>
- : public
- Object_Arg_Traits_T<
- CORBA::Policy_ptr,
- CORBA::Policy_var,
- CORBA::Policy_out,
- TAO::Objref_Traits<CORBA::Policy>,
- TAO::Any_Insert_Policy_Stream
- >
- {
- };
-
-#endif /* end #if !defined */
-}
-
-
// TAO_IDL - Generated from
// be\be_interface.cpp:1455
diff --git a/TAO/tao/tao.mpc b/TAO/tao/tao.mpc
index 74b88d26c09..2681f8ca93f 100644
--- a/TAO/tao/tao.mpc
+++ b/TAO/tao/tao.mpc
@@ -24,8 +24,6 @@ project(TAO_Core_idl) : tao_versioning_idl_defaults, gen_ostream, install, pidl_
Messaging_SyncScope.pidl >> AnyTypeCode/Messaging_SyncScopeA.h AnyTypeCode/Messaging_SyncScopeA.cpp
ObjectIdList.pidl >> AnyTypeCode/ObjectIdListA.h AnyTypeCode/ObjectIdListA.cpp
orb_types.pidl >> AnyTypeCode/orb_typesA.h AnyTypeCode/orb_typesA.cpp
- ParameterMode.pidl >> AnyTypeCode/ParameterModeA.h AnyTypeCode/ParameterModeA.cpp
- Policy_Forward.pidl >> AnyTypeCode/Policy_ForwardA.h AnyTypeCode/Policy_ForwardA.cpp
Policy_Manager.pidl >> AnyTypeCode/Policy_ManagerA.h AnyTypeCode/Policy_ManagerA.cpp
Policy_Current.pidl >> AnyTypeCode/Policy_CurrentA.h AnyTypeCode/Policy_CurrentA.cpp
PI_Forward.pidl >> AnyTypeCode/PI_ForwardA.h AnyTypeCode/PI_ForwardA.cpp
@@ -36,6 +34,16 @@ project(TAO_Core_idl) : tao_versioning_idl_defaults, gen_ostream, install, pidl_
}
IDL_Files {
+ idlflags += -Sci -Sa
+ Policy_Forward.pidl >> AnyTypeCode/Policy_ForwardA.h AnyTypeCode/Policy_ForwardA.cpp
+ }
+
+ IDL_Files {
+ idlflags += -Sci -Sat
+ ParameterMode.pidl >> AnyTypeCode/ParameterModeA.h AnyTypeCode/ParameterModeA.cpp
+ }
+
+ IDL_Files {
idlflags += -Sci -Gse
BooleanSeq.pidl >> AnyTypeCode/BooleanSeqA.h AnyTypeCode/BooleanSeqA.cpp
CharSeq.pidl >> AnyTypeCode/CharSeqA.h AnyTypeCode/CharSeqA.cpp
diff --git a/TAO/tests/Param_Test/Param_Test.mpc b/TAO/tests/Param_Test/Param_Test.mpc
index 41280d6076e..97a74931b30 100644
--- a/TAO/tests/Param_Test/Param_Test.mpc
+++ b/TAO/tests/Param_Test/Param_Test.mpc
@@ -11,12 +11,25 @@ project(*idl): taoidldefaults {
project(*Server): taoserver, codeset, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro {
after += *idl
+
Source_Files {
param_testS.cpp
param_testC.cpp
param_test_i.cpp
server.cpp
}
+
+ Header_Files {
+ param_testS.h
+ param_testC.h
+ param_test_i.h
+ }
+
+ Inline_Files {
+ param_testS.inl
+ param_testC.inl
+ }
+
IDL_Files {
}
}
@@ -69,6 +82,56 @@ project(*Client): taoserver, codeset, avoids_minimum_corba, avoids_ace_for_tao,
var_array.cpp
var_struct.cpp
}
+
+ Header_Files {
+ param_testC.h
+ any.h
+ bd_array_seq.h
+ bd_long_seq.h
+ bd_short_seq.h
+ bd_string.h
+ bd_struct_seq.h
+ bd_str_seq.h
+ bd_wstring.h
+ bd_wstr_seq.h
+ big_union.h
+ client.h
+ complex_any.h
+ driver.h
+ except.h
+ fixed_array.h
+ fixed_struct.h
+ helper.h
+ multdim_array.h
+ nested_struct.h
+ objref.h
+ objref_struct.h
+ options.h
+ recursive_struct.h
+ recursive_union.h
+ results.h
+ short.h
+ small_union.h
+ typecode.h
+ ub_any_seq.h
+ ub_array_seq.h
+ ub_long_seq.h
+ ub_objref_seq.h
+ ub_short_seq.h
+ ub_string.h
+ ub_struct_seq.h
+ ub_str_seq.h
+ ub_wstring.h
+ ub_wstr_seq.h
+ ulonglong.h
+ var_array.h
+ var_struct.h
+ }
+
+ Inline_Files {
+ param_testC.inl
+ }
+
IDL_Files {
}
}
@@ -81,6 +144,15 @@ project(*Anyop): taoserver, codeset, avoids_minimum_corba, avoids_corba_e_compac
param_testC.cpp
anyop.cpp
}
+
+ Header_Files {
+ param_testC.h
+ }
+
+ Inline_Files {
+ param_testC.inl
+ }
+
IDL_Files {
}
}