summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-02-25 16:46:07 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-02-25 16:46:07 +0000
commit20d84b24ffc6b5900b704bd8ba836ccd8a44bd14 (patch)
treefdeeab6fd112ea003eb8fd6758f8e148d54c31e0
parent97baab0ba96edc80ef3a952b87736b906f8993c3 (diff)
downloadATCD-20d84b24ffc6b5900b704bd8ba836ccd8a44bd14.tar.gz
Added command line option to suppress generation of ostream operators
for exceptions.
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp16
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp6
-rw-r--r--TAO/TAO_IDL/driver/drv_args.cpp6
-rw-r--r--TAO/TAO_IDL/include/idl_global.h10
-rw-r--r--TAO/TAO_IDL/util/utl_global.cpp15
6 files changed, 48 insertions, 11 deletions
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 388d3776b6f..34a079e9d22 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -185,13 +185,17 @@ TAO_CodeGen::start_client_header (const char *fname)
// generating iostream operators. The following is mainly
// for VxWorks.
- *this->client_header_ << "\n#if defined (ACE_HAS_MINIMUM_IOSTREAMH_INCLUSION)\n";
+ if (idl_global->gen_except_ostream_op () != 0)
+ {
+ *this->client_header_ << "\n#if defined (ACE_HAS_MINIMUM_IOSTREAMH_INCLUSION)\n";
- if (idl_global->changing_standard_include_files () == 1)
- *this->client_header_ << "#include \"ace/streams.h\"\n";
- else
- *this->client_header_ << "#include <ace/streams.h>\n";
- *this->client_header_ << "#endif /* ACE_HAS_MINIMUM_IOSTREAMH_INCLUSION */\n";
+ if (idl_global->changing_standard_include_files () == 1)
+ *this->client_header_ << "#include \"ace/streams.h\"\n";
+ else
+ *this->client_header_ << "#include <ace/streams.h>\n";
+
+ *this->client_header_ << "#endif /* ACE_HAS_MINIMUM_IOSTREAMH_INCLUSION */\n";
+ }
// Some compilers don't optimize the #ifndef header include
// protection, but do optimize based on #pragma once.
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp
index a994be238f1..68e0d6f5c1a 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp
@@ -72,8 +72,10 @@ be_visitor_exception_cdr_op_ch::visit_exception (be_exception *node)
*os << be_nl;
- // Generate the iostream operator overload for this exception.
- node->gen_iostream_op_hdr (os);
+ // Generate the iostream operator overload for this exception,
+ // unless it is suppressed.
+ if (idl_global->gen_except_ostream_op ())
+ node->gen_iostream_op_hdr (os);
node->cli_hdr_cdr_op_gen (1);
return 0;
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp
index d178df023e0..6a3afa5c735 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp
@@ -160,8 +160,10 @@ be_visitor_exception_cdr_op_ci::visit_exception (be_exception *node)
<< "return 0;" << be_uidt << be_uidt_nl
<< "}\n\n";
- // Generate the iostream operator overload for this exception.
- node->gen_iostream_op_impl (os);
+ // Generate the iostream operator overload for this exception,
+ // unless it is suppressed
+ if (idl_global->gen_except_ostream_op ())
+ node->gen_iostream_op_impl (os);
node->cli_inline_cdr_op_gen (1);
return 0;
diff --git a/TAO/TAO_IDL/driver/drv_args.cpp b/TAO/TAO_IDL/driver/drv_args.cpp
index 13ff70260ac..68f72aa225a 100644
--- a/TAO/TAO_IDL/driver/drv_args.cpp
+++ b/TAO/TAO_IDL/driver/drv_args.cpp
@@ -157,6 +157,7 @@ DRV_usage (void)
cerr << GTDEVEL (" -Sc\t\t\tsuppress tie class (and file) generation (enabled by default)\n");
cerr << GTDEVEL (" -Sp\t\t\tsuppress generating Thru POA collocated stubs (enabled by default)\n");
cerr << GTDEVEL (" -Sd\t\t\tsuppress generating Direct collocated stubs (disable by default)\n");
+ cerr << GTDEVEL (" -So\t\t\tsuppress generating ostream operators for exceptions (enabled by default)\n");
#ifdef IDL_HAS_VALUETYPE
cerr << GTDEVEL (" -Sv\t\t\tdisable OBV (Valuetype) support (disabled by default)\n");
#endif /* IDL_HAS_VALUETYPE */
@@ -565,6 +566,11 @@ DRV_parse_args (long ac, char **av)
// suppress generating tie classes and files
idl_global->gen_tie_classes (0);
}
+ else if (av[i][2] == 'o')
+ {
+ // suppress generating ostream operators for exceptions
+ idl_global->gen_except_ostream_op (0);
+ }
else if (av[i][2] == 'v')
{
// disable OBV (Valuetype) support
diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h
index e19d77366d4..d8679786da6 100644
--- a/TAO/TAO_IDL/include/idl_global.h
+++ b/TAO/TAO_IDL/include/idl_global.h
@@ -612,6 +612,12 @@ public:
virtual idl_bool gen_tie_classes (void);
// Return the flag.
+ virtual void gen_except_ostream_op (idl_bool value);
+ // Toggle the generation of ostream operators for exceptions.
+
+ virtual idl_bool gen_except_ostream_op (void);
+ // Return the flag.
+
private:
// Data
UTL_ScopeStack *pd_scopes; // Store scopes stack
@@ -773,6 +779,10 @@ private:
idl_bool gen_tie_classes_;
// Flag to indicate whether we generate the tie classes and
// files or not.
+
+ idl_bool gen_except_ostream_op_;
+ // Flag to indicate whether or not ostream operatos are
+ // generated for exceptions.
};
#endif //_IDL_IDL_GLOBAL_HH
diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp
index 77f0d701945..29ccad767e9 100644
--- a/TAO/TAO_IDL/util/utl_global.cpp
+++ b/TAO/TAO_IDL/util/utl_global.cpp
@@ -152,7 +152,8 @@ IDL_GlobalData::IDL_GlobalData (void)
opt_tc_ (I_FALSE),
case_diff_error_ (I_TRUE),
ami_call_back_ (I_FALSE),
- gen_tie_classes_ (I_TRUE)
+ gen_tie_classes_ (I_TRUE),
+ gen_except_ostream_op_ (I_TRUE)
{
// Path for the perfect hash generator(gperf) program.
@@ -1497,3 +1498,15 @@ IDL_GlobalData::gen_tie_classes (void)
{
return this->gen_tie_classes_;
}
+
+void
+IDL_GlobalData::gen_except_ostream_op (idl_bool val)
+{
+ this->gen_except_ostream_op_ = val;
+}
+
+idl_bool
+IDL_GlobalData::gen_except_ostream_op (void)
+{
+ return this->gen_except_ostream_op_;
+}