diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-04-13 17:19:08 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-04-13 17:19:08 +0000 |
commit | 5913d92d59748c18244ac4d004e3b28e3836d4b0 (patch) | |
tree | c13d125c5029e28e74e5250c6acbd2affb4f907d | |
parent | 8b37082ad225c0f058879aae8684922aab357420 (diff) | |
download | ATCD-5913d92d59748c18244ac4d004e3b28e3836d4b0.tar.gz |
ChangeLogTag: Tue Apr 13 12:00:18 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 49 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/any_op.cpp | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/root.cpp | 9 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/driver/drv_args.cpp | 5 | ||||
-rw-r--r-- | TAO/docs/compiler.html | 9 | ||||
-rw-r--r-- | TAO/tests/Hello/Hello.mpc | 4 | ||||
-rw-r--r-- | TAO/tests/Hello/README | 6 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/IDL_Test.mpc | 28 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/README | 27 | ||||
-rw-r--r-- | TAO/tests/Param_Test/Param_Test.mpc | 9 | ||||
-rw-r--r-- | TAO/tests/Param_Test/README | 6 |
12 files changed, 147 insertions, 21 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 6e2e7259974..ede43e627c7 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,52 @@ +Tue Apr 13 12:00:18 2004 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO/TAO_IDL/be/be_visitor_root/any_op.cpp: + * TAO/TAO_IDL/be/be_visitor_root/root.cpp: + + Moved the check for the -GA option set and resulting + conditional switch of the output stream file pointer + from the root visitor to the any_op visitor. + + * TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp: + + Added check for the -GA option set and resulting + conditional generation of type code body in *A.cpp + instead of the default *C.cpp. + + * TAO/TAO_IDL/driver/drv_args.cpp: + * TAO/docs/compiler.html: + * TAO/tests/Hello/Hello.mpc: + * TAO/tests/Hello/README: + * TAO/tests/IDL_Test/IDL_Test.mpc: + * TAO/tests/IDL_Test/README: + * TAO/tests/Param_Test/Param_Test.mpc: + * TAO/tests/Param_Test/README: + + Made the IDL compiler option -GA (generation of Any operator + and type code bodies into a separate file with the extension + *A.cpp), recently added and up until now intended only for + TAO developers, available to all users. More flexible than + the -Sa and -St options, which suppress generation of Any + operators and type codes respectively, this option enables + clients and servers to independently decide whether to + compile and link TypeCode- and Any-related code. Changes + involving this option include: + + - Add usage message to the IDL compiler. + + - Adding the option to the IDL compiler command line in + Param_Test, IDL_Test and the Hello test. In the latter + test, the resulting testA.cpp file is not included in + either the client or server build, testing the decoupling + of the dependency when a client or server does not use + type codes or Anys. + + - Updating the README files of the above tests to document + the added option. + + - Adding documentation of the option to the table of IDL + compiler command line options in TAO/docs/compiler.html. + Tue Apr 13 13:36:27 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl> * tao/Dynamic_Parameter.pidl: diff --git a/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp b/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp index 427dbbb8125..b53fdee616e 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp @@ -40,6 +40,14 @@ be_visitor_root_any_op::~be_visitor_root_any_op (void) int be_visitor_root_any_op::visit_root (be_root *node) { + if (be_global->gen_anyop_files () + && this->ctx_->state () == TAO_CodeGen::TAO_ROOT_ANY_OP_CS) + { + // Switch streams, ctx will be reassigned when this + // pass is done. + this->ctx_->stream (tao_cg->anyop_source ()); + } + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/TAO_IDL/be/be_visitor_root/root.cpp b/TAO/TAO_IDL/be/be_visitor_root/root.cpp index 99669d9a284..511fb536b4c 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root.cpp @@ -294,16 +294,11 @@ int be_visitor_root::visit_root (be_root *node) if (be_global->any_support ()) { - if (be_global->gen_anyop_files ()) - { - // Switch streams, ctx will be reassigned when this - // pass is done. - ctx.stream (tao_cg->anyop_source ()); - } - be_visitor_root_any_op visitor (&ctx); status = node->accept (&visitor); + // Conditional switch to the *A.cpp stream is done + // in the visitor constructor. if (be_global->gen_anyop_files ()) { (void) tao_cg->end_anyop_source (); diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp index 92be2eb722d..dffde291e2f 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp @@ -68,7 +68,6 @@ be_visitor_typecode_defn::be_visitor_typecode_defn (be_visitor_context *ctx) computed_scope_encap_len_ (0), tc_offset_ (0), index_ (-1) - { } @@ -263,6 +262,13 @@ be_visitor_typecode_defn::gen_nested_namespace_end (be_module *node) int be_visitor_typecode_defn::visit_type (be_type *node) { + if (be_global->gen_anyop_files ()) + { + // Switch streams, ctx will be reassigned when this + // pass is done. + this->ctx_->stream (tao_cg->anyop_source ()); + } + TAO_OutStream *os = this->ctx_->stream (); // reset the queue diff --git a/TAO/TAO_IDL/driver/drv_args.cpp b/TAO/TAO_IDL/driver/drv_args.cpp index e115937129f..ec53439356f 100644 --- a/TAO/TAO_IDL/driver/drv_args.cpp +++ b/TAO/TAO_IDL/driver/drv_args.cpp @@ -323,6 +323,11 @@ DRV_usage (void) )); ACE_DEBUG (( LM_DEBUG, + ACE_TEXT (" -GA\t\t\tgenerate Any operator and type code bodies in *A.cpp") + ACE_TEXT (" (generated in *C.cpp by default)\n") + )); + ACE_DEBUG (( + LM_DEBUG, ACE_TEXT (" -Guc\t\t\tgenerate uninlined constant if declared ") ACE_TEXT ("in a module") ACE_TEXT (" (inlined by default)\n") diff --git a/TAO/docs/compiler.html b/TAO/docs/compiler.html index 94d64fa50a4..e1c52f28cbf 100644 --- a/TAO/docs/compiler.html +++ b/TAO/docs/compiler.html @@ -620,6 +620,15 @@ also receives other options that are specific to it. <p> <td> </td> </tr> + <tr><a name="GA"> + <td><tt>-GA</tt></td> + + <td>Generate type code and Any operator bodies in *A.cpp</td> + <td>Decouples client and server decisions to compile and link + TypeCode- and Any-related code, which is generated in + *C.cpp by default.</td> + </tr> + <tr><a name="Guc"> <td><tt>-Guc</tt></td> diff --git a/TAO/tests/Hello/Hello.mpc b/TAO/tests/Hello/Hello.mpc index 52da9feb86c..b4ec43ea676 100644 --- a/TAO/tests/Hello/Hello.mpc +++ b/TAO/tests/Hello/Hello.mpc @@ -2,6 +2,8 @@ // $Id$ project(*Server): taoexe, portableserver { + idlflags += -GA + Source_Files { Hello.cpp server.cpp @@ -9,6 +11,8 @@ project(*Server): taoexe, portableserver { } project(*Client): taoexe { + idlflags += -GA + Source_Files { TestC.cpp client.cpp diff --git a/TAO/tests/Hello/README b/TAO/tests/Hello/README index b9b1c26edfb..ee77329decb 100644 --- a/TAO/tests/Hello/README +++ b/TAO/tests/Hello/README @@ -18,6 +18,12 @@ anything useful, i.e. chances are that this test will always pass. - External users are often asked to send us a 'simple test' for their use case, we can now point them to this test to explain what do we mean by "simple". +- The -GA option has been added to the IDL compiler command line. + This option generates type code and Any insertion/extraction + operator implementations in a separate file with the extension *A.cpp. + This file is not included in the compilation however, to make sure + there is no dependency on it if the client and server do not use + type codes or Anys. Please refrain from "improving", extending or expanding this test, if you need to change diff --git a/TAO/tests/IDL_Test/IDL_Test.mpc b/TAO/tests/IDL_Test/IDL_Test.mpc index 5f202e7ece3..1a82229ee8f 100644 --- a/TAO/tests/IDL_Test/IDL_Test.mpc +++ b/TAO/tests/IDL_Test/IDL_Test.mpc @@ -4,53 +4,75 @@ project(*Main): taoserver, messaging { exename = main - idlflags += -GC -GH -Gd + idlflags += -GC -GH -Gd -GA Source_Files { anonymousC.cpp anonymousS.cpp + anonymousA.cpp arrayC.cpp arrayS.cpp + arrayA.cpp constantsC.cpp constantsS.cpp + constantsA.cpp enum_in_structC.cpp enum_in_structS.cpp + enum_in_structA.cpp fullC.cpp fullS.cpp + fullA.cpp fwdC.cpp fwdS.cpp + fwdA.cpp generic_objectC.cpp generic_objectS.cpp + generic_objectA.cpp gperfC.cpp gperfS.cpp + gperfA.cpp includedC.cpp includedS.cpp + includedA.cpp includingC.cpp includingS.cpp + includingA.cpp interfaceC.cpp interfaceS.cpp + interfaceA.cpp keywordsC.cpp keywordsS.cpp + keywordsA.cpp nested_scopeC.cpp nested_scopeS.cpp + nested_scopeA.cpp paramsC.cpp paramsS.cpp + paramsA.cpp pragmaC.cpp pragmaS.cpp + pragmaA.cpp reopened_modulesC.cpp reopened_modulesS.cpp + reopened_modulesA.cpp reopen_include1C.cpp reopen_include1S.cpp + reopen_include1A.cpp reopen_include2C.cpp reopen_include2S.cpp + reopen_include2A.cpp + repo_id_modC.cpp + repo_id_modS.cpp + repo_id_modA.cpp sequenceC.cpp sequenceS.cpp + sequenceA.cpp typedefC.cpp typedefS.cpp + typedefA.cpp unionC.cpp unionS.cpp - repo_id_modC.cpp - repo_id_modS.cpp + unionA.cpp main.cpp } } diff --git a/TAO/tests/IDL_Test/README b/TAO/tests/IDL_Test/README index d6a991af0ea..9165d90c57e 100644 --- a/TAO/tests/IDL_Test/README +++ b/TAO/tests/IDL_Test/README @@ -9,7 +9,7 @@ // README // // = AUTHOR -// Jeff Parsons <parsons@cs.wustl.edu> +// Jeff Parsons <j.parsons@vanderbilt.edu> // // ============================================================================ @@ -26,6 +26,22 @@ type involved or by the context in which the error occurs. As new bugs are uncovered and fixed, new examples will be added to the suite, to ensure that the bugs do not recur. +The -GA option has been added to the IDL compiler command line. This +option generates the implementations of type codes and Any +insertion/extraction operators in a separate file with the +extension *A.cpp. These files have been added to the build, to make +sure that the option functions correctly for all the IDL types +found in this test. If the client or server does not use type codes +or Anys, these files may be left out of the compilation. This +feature is tested in TAO_ROOT/tests/Hello. + +The IDL compiler command line options -GC -GH and -Gd have also been added. +They switch on generation, respectively, of extra code for Asynchronous +Method Invocation (AMI), Asynchronous Method Handling (AMH) and direct +collocation of invocations (bypassing the POA and using a simple C++ +method call). By adding these options we can test for correct code +generation for every IDL interface found in this test. + To build the test files, type 'make' at the command line. The TAO IDL compiler will open each IDL file in the directory and generate code that will then be compiled by the C++ compiler on your platform. @@ -36,12 +52,3 @@ The rest of the .idl files need only to build cleanly. To test the client/server functionality of the various IDL types and operations, see the test suite in ACE_wrappers/TAO/tests/Param_Test. -The generated code from reopened_modules.idl is not included in the -Makefile per se. Platforms without namespaces cannot handle -reopened modules, so reopened_modulesC.cpp and reopened_modulesS.cpp -have been conditionally included in a file called namespace_check.cpp. -On platforms without namespaces, the IDL compiler will output a -warning that the generated code may not compile, each time a module -is reopened in the .idl file. If seen when building this test, the -warning can safely be ignored. It can also be ignored if you are -cross-compiling onto a platform that has namespaces.
\ No newline at end of file diff --git a/TAO/tests/Param_Test/Param_Test.mpc b/TAO/tests/Param_Test/Param_Test.mpc index 275b8a4dbf8..e4eb20773b2 100644 --- a/TAO/tests/Param_Test/Param_Test.mpc +++ b/TAO/tests/Param_Test/Param_Test.mpc @@ -2,8 +2,11 @@ // $Id$ project(*Server): messaging, taoexe, portableserver, minimum_corba { + idlflags += -GA + Source_Files { param_test_i.cpp + param_testA.cpp server.cpp } } @@ -11,6 +14,8 @@ project(*Server): messaging, taoexe, portableserver, minimum_corba { project(*Client): messaging, taoexe, portableserver, minimum_corba, dynamicinterface { exename = client + idlflags += -GA + Source_Files { any.cpp bd_array_seq.cpp @@ -35,6 +40,7 @@ project(*Client): messaging, taoexe, portableserver, minimum_corba, dynamicinter objref_struct.cpp options.cpp param_test_i.cpp + param_testA.cpp recursive_struct.cpp recursive_union.cpp results.cpp @@ -58,8 +64,11 @@ project(*Client): messaging, taoexe, portableserver, minimum_corba, dynamicinter } project(*Anyop): messaging, taoexe, portableserver, minimum_corba { + idlflags += -GA + Source_Files { param_testC.cpp + param_testA.cpp anyop.cpp } } diff --git a/TAO/tests/Param_Test/README b/TAO/tests/Param_Test/README index db140be410c..3bd468d2ff3 100644 --- a/TAO/tests/Param_Test/README +++ b/TAO/tests/Param_Test/README @@ -22,6 +22,12 @@ Type "make" to make the application. The server executable is called You should have the TAO IDL compiler and the TAO library installed before using this application. +The -GA options has been added the IDL compiler command line for this +test. This option moves the generation of implementations for type +codes and Any insertion/extraction operators to a separate file with +the extension *A.cpp. Adding this option tests that it is handled +correctly for all the various IDL types used in this test. + To run the server, type server [arguments to ORB_init] [-d] [-o <ior_output_file>] |