summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2005-04-08 06:54:39 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2005-04-08 06:54:39 +0000
commit2e2ca68d32906c6cf424c065b323876774c6ec7d (patch)
tree88190af34691f7a2c7d8de6844bf11c28e0cce22 /TAO
parent607471e0a40ea575c351f402e18c73127af64583 (diff)
downloadATCD-2e2ca68d32906c6cf424c065b323876774c6ec7d.tar.gz
ChangeLogTag: Fri Apr 8 07:53:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO')
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp68
-rw-r--r--TAO/TAO_IDL/be/be_global.cpp71
-rw-r--r--TAO/TAO_IDL/be/be_produce.cpp62
-rw-r--r--TAO/TAO_IDL/be_include/be_global.h38
-rw-r--r--TAO/docs/compiler.html24
5 files changed, 195 insertions, 68 deletions
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 92b90394e80..e9f63b6d3d2 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -300,13 +300,17 @@ TAO_CodeGen::start_client_stubs (const char *fname)
<< "#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig\n"
<< "#endif /* __BORLANDC__ */";
- // Generate the code that includes the inline file if not included in the
- // header file.
- *this->client_stubs_ << "\n\n#if !defined (__ACE_INLINE__)";
- *this->client_stubs_ << "\n#include \""
- << be_global->be_get_client_inline_fname (1)
- << "\"";
- *this->client_stubs_ << "\n#endif /* !defined INLINE */";
+ // Only when we generate a client inline file generate the include
+ if (be_global->gen_client_inline ())
+ {
+ // Generate the code that includes the inline file if not included in the
+ // header file.
+ *this->client_stubs_ << "\n\n#if !defined (__ACE_INLINE__)";
+ *this->client_stubs_ << "\n#include \""
+ << be_global->be_get_client_inline_fname (1)
+ << "\"";
+ *this->client_stubs_ << "\n#endif /* !defined INLINE */";
+ }
return 0;
}
@@ -624,13 +628,17 @@ TAO_CodeGen::start_server_skeletons (const char *fname)
<< "#pragma option -w-rvl -w-rch -w-ccc -w-aus\n"
<< "#endif /* __BORLANDC__ */";
- // Generate the code that includes the inline file if not included in the
- // header file.
- *this->server_skeletons_ << "\n\n#if !defined (__ACE_INLINE__)\n";
- *this->server_skeletons_ << "#include \""
- << be_global->be_get_server_inline_fname (1)
- << "\"\n";
- *this->server_skeletons_ << "#endif /* !defined INLINE */";
+ // Only when we generate a server inline file generate the include
+ if (be_global->gen_server_inline ())
+ {
+ // Generate the code that includes the inline file if not included in the
+ // header file.
+ *this->server_skeletons_ << "\n\n#if !defined (__ACE_INLINE__)\n";
+ *this->server_skeletons_ << "#include \""
+ << be_global->be_get_server_inline_fname (1)
+ << "\"\n";
+ *this->server_skeletons_ << "#endif /* !defined INLINE */";
+ }
return 0;
}
@@ -946,12 +954,16 @@ TAO_CodeGen::end_client_header (void)
*this->client_header_ << be_nl << be_nl << "// TAO_IDL - Generated from"
<< be_nl << "// " << __FILE__ << ":" << __LINE__;
- // Insert the code to include the inline file.
- *this->client_header_ << "\n\n#if defined (__ACE_INLINE__)\n";
- *this->client_header_ << "#include \""
- << be_global->be_get_client_inline_fname (1)
- << "\"\n";
- *this->client_header_ << "#endif /* defined INLINE */";
+ // Only when we generate a client inline file generate the include
+ if (be_global->gen_client_inline ())
+ {
+ // Insert the code to include the inline file.
+ *this->client_header_ << "\n\n#if defined (__ACE_INLINE__)\n";
+ *this->client_header_ << "#include \""
+ << be_global->be_get_client_inline_fname (1)
+ << "\"\n";
+ *this->client_header_ << "#endif /* defined INLINE */";
+ }
*this->client_header_ << "\n\n#if defined(_MSC_VER)\n"
<< "#pragma warning(pop)\n"
@@ -991,12 +1003,16 @@ TAO_CodeGen::end_server_header (void)
<< "\"\n";
}
- // Insert the code to include the inline file.
- *this->server_header_ << "\n#if defined (__ACE_INLINE__)\n";
- *this->server_header_ << "#include \""
- << be_global->be_get_server_inline_fname (1)
- << "\"\n";
- *this->server_header_ << "#endif /* defined INLINE */";
+ // Only when we generate a server inline file generate the include
+ if (be_global->gen_server_inline ())
+ {
+ // Insert the code to include the inline file.
+ *this->server_header_ << "\n#if defined (__ACE_INLINE__)\n";
+ *this->server_header_ << "#include \""
+ << be_global->be_get_server_inline_fname (1)
+ << "\"\n";
+ *this->server_header_ << "#endif /* defined INLINE */";
+ }
*this->server_header_ << "\n\n#if defined(_MSC_VER)\n"
<< "#pragma warning(pop)\n"
diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp
index 968548847d2..746c96a904f 100644
--- a/TAO/TAO_IDL/be/be_global.cpp
+++ b/TAO/TAO_IDL/be/be_global.cpp
@@ -86,7 +86,9 @@ BE_GlobalData::BE_GlobalData (void)
ccmobject_ (0),
gen_anyop_files_ (I_FALSE),
do_ccm_preproc_ (I_TRUE),
- gen_skel_files_ (I_TRUE)
+ gen_skel_files_ (I_TRUE),
+ gen_client_inline_ (I_TRUE),
+ gen_server_inline_ (I_TRUE)
{
}
@@ -1037,6 +1039,30 @@ BE_GlobalData::gen_skel_files (idl_bool val)
this->gen_skel_files_ = val;
}
+idl_bool
+BE_GlobalData::gen_client_inline (void) const
+{
+ return this->gen_client_inline_;
+}
+
+void
+BE_GlobalData::gen_client_inline (idl_bool val)
+{
+ this->gen_client_inline_ = val;
+}
+
+idl_bool
+BE_GlobalData::gen_server_inline (void) const
+{
+ return this->gen_server_inline_;
+}
+
+void
+BE_GlobalData::gen_server_inline (idl_bool val)
+{
+ this->gen_server_inline_ = val;
+}
+
ACE_CString
BE_GlobalData::spawn_options (void)
{
@@ -1525,8 +1551,16 @@ BE_GlobalData::parse_args (long &i, char **av)
}
else if (av[i][2] == 'c')
{
- // suppress generating tie classes and files
- be_global->gen_tie_classes (0);
+ if (av[i][3] == 'i')
+ {
+ // no client inline
+ be_global->gen_client_inline (I_FALSE);
+ }
+ else
+ {
+ // suppress generating tie classes and files
+ be_global->gen_tie_classes (0);
+ }
}
else if (av[i][2] == 'm')
{
@@ -1538,6 +1572,22 @@ BE_GlobalData::parse_args (long &i, char **av)
// disable skeleton file generation.
be_global->gen_skel_files (I_FALSE);
}
+ else if (av[i][2] == 's')
+ {
+ if (av[i][3] == 'i')
+ {
+ // no client inline
+ be_global->gen_server_inline (I_FALSE);
+ }
+ else
+ {
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
+ av[i]
+ ));
+ }
+ }
else
{
ACE_ERROR ((
@@ -1905,6 +1955,21 @@ BE_GlobalData::usage (void) const
ACE_TEXT (" -Sm\t\t\tdisable IDL3 equivalent IDL preprocessing")
ACE_TEXT (" (enabled by default)\n")
));
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT (" -SS\t\t\tsuppress generating skeleton implementation")
+ ACE_TEXT (" and inline file (disabled by default)\n")
+ ));
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT (" -Sci\t\t\tsuppress generating client inline file")
+ ACE_TEXT (" (disabled by default)\n")
+ ));
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT (" -Ssi\t\t\tsuppress generating server inline file")
+ ACE_TEXT (" (disabled by default)\n")
+ ));
}
AST_Generator *
diff --git a/TAO/TAO_IDL/be/be_produce.cpp b/TAO/TAO_IDL/be/be_produce.cpp
index 52a9c032342..f2a0b23903a 100644
--- a/TAO/TAO_IDL/be/be_produce.cpp
+++ b/TAO/TAO_IDL/be/be_produce.cpp
@@ -73,8 +73,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "be_extern.h"
#include "global_extern.h"
-ACE_RCSID (be,
- be_produce,
+ACE_RCSID (be,
+ be_produce,
"$Id$")
// Clean up before exit, whether successful or not.
@@ -207,19 +207,22 @@ BE_produce (void)
// (2) Generate client inline and
// set the context information.
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_CI);
+ if (be_global->gen_client_inline ())
+ {
+ ctx.reset ();
+ ctx.state (TAO_CodeGen::TAO_ROOT_CI);
- // Create a visitor.
- be_visitor_root_ci root_ci_visitor (&ctx);
+ // Create a visitor.
+ be_visitor_root_ci root_ci_visitor (&ctx);
- // Generate code for the client inline file.
- if (root->accept (&root_ci_visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "client inline for Root failed\n"));
- BE_abort ();
+ // Generate code for the client inline file.
+ if (root->accept (&root_ci_visitor) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%N:%l) be_produce - "
+ "client inline for Root failed\n"));
+ BE_abort ();
+ }
}
// (3) Generate client stubs.
@@ -238,7 +241,7 @@ BE_produce (void)
BE_abort ();
}
- // (4) Generate server header.
+ // (4) Generate server header.
ctx.reset ();
ctx.state (TAO_CodeGen::TAO_ROOT_SH);
@@ -253,28 +256,31 @@ BE_produce (void)
"server header for Root failed\n"));
BE_abort ();
}
-
- // If skeleton file generation is suppressed, we're done.
+
+ // If skeleton file generation is suppressed, we're done.
if (!be_global->gen_skel_files ())
{
BE_cleanup ();
return;
}
- // (5) Generate server inline.
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_SI);
+ if (be_global->gen_server_inline ())
+ {
+ // (5) Generate server inline.
+ ctx.reset ();
+ ctx.state (TAO_CodeGen::TAO_ROOT_SI);
- // Create a visitor.
- be_visitor_root_si root_si_visitor (&ctx);
+ // Create a visitor.
+ be_visitor_root_si root_si_visitor (&ctx);
- // Generate code for the server inline file.
- if (root->accept (&root_si_visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "server inline for Root failed\n"));
- BE_abort ();
+ // Generate code for the server inline file.
+ if (root->accept (&root_si_visitor) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%N:%l) be_produce - "
+ "server inline for Root failed\n"));
+ BE_abort ();
+ }
}
// (6) Generate server skeletons
diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h
index 00045576d51..a306ed101e2 100644
--- a/TAO/TAO_IDL/be_include/be_global.h
+++ b/TAO/TAO_IDL/be_include/be_global.h
@@ -425,31 +425,39 @@ public:
idl_bool gen_anyop_files (void) const;
void gen_anyop_files (idl_bool val);
// Accessors for the member.
-
+
idl_bool do_ccm_preproc (void) const;
void do_ccm_preproc (idl_bool val);
// Accessors for the member do_ccm_preproc_.
-
+
idl_bool gen_skel_files (void) const;
void gen_skel_files (idl_bool val);
// Accessors for the member gen_skel_files_.
-
+
+ idl_bool gen_client_inline (void) const;
+ void gen_client_inline (idl_bool val);
+ // Accessors for the member gen_client_inline_.
+
+ idl_bool gen_server_inline (void) const;
+ void gen_server_inline (idl_bool val);
+ // Accessors for the member gen_server_inline_.
+
ACE_CString spawn_options (void);
// Command line passed to ACE_Process::spawn. Different
// implementations in IDL and IFR backends.
-
+
void parse_args (long &i, char **av);
// Parse args that affect the backend.
-
+
void prep_be_arg (char *s);
// Special BE arg call factored out of DRV_args.
-
+
void arg_post_proc (void);
// Checks made after parsing args.
-
+
void usage (void) const;
// Display usage of BE-specific options.
-
+
AST_Generator *generator_init (void);
// Create an AST node generator.
@@ -470,7 +478,7 @@ private:
char* post_include_;
// Client's header file name ending. Default is "C.h".
- char* client_hdr_ending_;
+ char* client_hdr_ending_;
// Client's stub's file name ending. Default is "C.cpp".
char* client_stub_ending_;
@@ -589,13 +597,21 @@ private:
idl_bool gen_anyop_files_;
// Separate files for generated Any operators?
-
+
idl_bool do_ccm_preproc_;
// Do the IDL3 to IDL2 preprocessing?
-
+
idl_bool gen_skel_files_;
// True by default, but a command line option can turn this off so
// we generate only an empty *S.h file on the skeleton side.
+
+ idl_bool gen_client_inline_;
+ // True by default, but a command line option can turn this off so
+ // that we don't generate a client inline file
+
+ idl_bool gen_server_inline_;
+ // True by default, but a command line option can turn this off so
+ // that we don't generate a server inline file
};
#endif /* _BE_GLOBAL_H */
diff --git a/TAO/docs/compiler.html b/TAO/docs/compiler.html
index d300062b353..1ef51454f18 100644
--- a/TAO/docs/compiler.html
+++ b/TAO/docs/compiler.html
@@ -748,6 +748,30 @@ also receives other options that are specific to it. <p>
so this command line option will suppress it.</td>
</tr>
+ <tr><a name="SS">
+ <td><tt>-SS</tt></td>
+
+ <td>Suppress generation of the skeleton implementation and inline file.</td>
+ <td>This option doesn't check whether something is generated in the files. It
+ just suppresses them without looking at any possible contents;</td>
+ </tr>
+
+ <tr><a name="Sci">
+ <td><tt>-Sci</tt></td>
+
+ <td>Suppress generation of the client inline file.</td>
+ <td>This option doesn't check whether something is generated in the file. It
+ just suppresses it without looking at any possible contents;</td>
+ </tr>
+
+ <tr><a name="Ssi">
+ <td><tt>-Ssi</tt></td>
+
+ <td>Suppress generation of the server inline file.</td>
+ <td>This option doesn't check whether something is generated in the file. It
+ just suppresses it without looking at any possible contents;</td>
+ </tr>
+
</table> <P>
<P><HR><P>