diff options
-rw-r--r-- | TAO/ChangeLog | 25 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_global.cpp | 18 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_util.cpp | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp | 15 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp | 15 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp | 10 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp | 12 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_traits.cpp | 43 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_global.h | 9 |
10 files changed, 110 insertions, 45 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 0dfa1ee73f3..69e7f80d027 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,13 +1,30 @@ +Mon Aug 8 09:01:55 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl> + + * TAO_IDL/be/be_codegen.cpp: + * TAO_IDL/be/be_global.cpp: + * TAO_IDL/be/be_util.cpp: + * TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp: + * TAO_IDL/be/be_visitor_root/root_ch.cpp: + * TAO_IDL/be/be_visitor_root/root_cs.cpp: + * TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp: + * TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp: + * TAO_IDL/be/be_visitor_structure/structure_cs.cpp: + * TAO_IDL/be/be_visitor_traits.cpp: + * TAO_IDL/be_include/be_global.h: + Added support for -Scdr which suppresses the CDR streaming operations. + This safes footprint when we are using IDL defined types, but these + are not intended to be send through remote CORBA interfaces + Thu Aug 4 15:47:33 UTC 2011 Phil Mesnier <mesnier_p@ociweb.com> * TAO-INSTALL.html: - - Added note about building for Android. + + Added note about building for Android. * tests/Sequence_Unit_Tests/string_sequence_tester.hpp: - + Additional compiler macro added to build on Android. - + Thanks to Trevor Fields of OCI for doing the heavy lifting for porting TAO to Android. diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index 8d8a3e8c4a4..2234c0eb162 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -91,6 +91,7 @@ BE_GlobalData::BE_GlobalData (void) skel_output_dir_ (0), anyop_output_dir_ (0), any_support_ (true), + cdr_support_ (true), tc_support_ (true), obv_opt_accessor_ (0), gen_impl_files_ (false), @@ -1522,6 +1523,18 @@ BE_GlobalData::any_support (void) const } void +BE_GlobalData::cdr_support (bool val) +{ + this->cdr_support_ = val; +} + +bool +BE_GlobalData::cdr_support (void) const +{ + return this->cdr_support_; +} + +void BE_GlobalData::tc_support (bool val) { this->tc_support_ = val; @@ -3351,6 +3364,11 @@ BE_GlobalData::parse_args (long &i, char **av) // No stub inline. be_global->gen_client_stub (false); } + else if (av[i][3] == 'd' && av[i][4] == 'r') + { + // No cdr support. + be_global->cdr_support (false); + } else { ACE_ERROR (( diff --git a/TAO/TAO_IDL/be/be_util.cpp b/TAO/TAO_IDL/be/be_util.cpp index 29b7ab2402b..7bce09bc700 100644 --- a/TAO/TAO_IDL/be/be_util.cpp +++ b/TAO/TAO_IDL/be/be_util.cpp @@ -793,6 +793,11 @@ be_util::usage (void) )); ACE_DEBUG (( LM_DEBUG, + ACE_TEXT (" -Scdr\t\t\tsuppress CDR support") + ACE_TEXT (" (support enabled by default)\n") + )); + ACE_DEBUG (( + LM_DEBUG, ACE_TEXT (" -Sat\t\t\tsuppress arg traits") ACE_TEXT (" generation") ACE_TEXT (" (arg traits generated by default)\n") 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 0a1dec62d25..ed167664904 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp @@ -370,9 +370,16 @@ be_visitor_root_ch::gen_any_ops (be_root *node) int be_visitor_root_ch::gen_cdr_ops (be_root *node) { - be_visitor_context ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CH); - be_visitor_root_cdr_op visitor (&ctx); - return node->accept (&visitor); + int status = 0; + + if (be_global->cdr_support ()) + { + be_visitor_context ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CH); + be_visitor_root_cdr_op visitor (&ctx); + status = node->accept (&visitor); + } + + return status; } 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 3a293267f84..8548f3fb939 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp @@ -136,10 +136,17 @@ be_visitor_root_cs::gen_any_ops (be_root *node) int be_visitor_root_cs::gen_cdr_ops (be_root *node) { - be_visitor_context ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CS); - be_visitor_root_cdr_op visitor (&ctx); - return node->accept (&visitor); + int status = 0; + + if (be_global->cdr_support ()) + { + be_visitor_context ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CS); + be_visitor_root_cdr_op visitor (&ctx); + status = node->accept (&visitor); + } + + return status; } diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp index b8282976d91..86fd728db6a 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp @@ -74,8 +74,7 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) int status = this->gen_anonymous_base_type ( bt, - TAO_CodeGen::TAO_ROOT_CDR_OP_CS - ); + TAO_CodeGen::TAO_ROOT_CDR_OP_CS); if (status == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp index b294dfa6ca0..10e4fcad29b 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp @@ -49,7 +49,7 @@ be_visitor_structure_cdr_op_cs::visit_structure (be_structure *node) TAO_OutStream *os = this->ctx_->stream (); *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; + << "// " << __FILE__ << ":" << __LINE__ << be_nl; *os << be_global->core_versioning_begin () << be_nl; @@ -58,8 +58,8 @@ be_visitor_structure_cdr_op_cs::visit_structure (be_structure *node) *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl << "TAO_OutputCDR &strm," << be_nl - << "const " << node->name () << " &_tao_aggregate" << be_uidt_nl - << ")" << be_uidt_nl + << "const " << node->name () << " &_tao_aggregate)" << be_uidt + << be_uidt_nl << "{" << be_idt_nl; be_visitor_context new_ctx (*this->ctx_); @@ -99,8 +99,7 @@ be_visitor_structure_cdr_op_cs::visit_structure (be_structure *node) *os << "_tao_aggregate"; } - *os << be_uidt_nl - << ")" << be_uidt_nl + *os << ")" << be_uidt << be_uidt_nl << "{" << be_idt_nl; if (node->is_local ()) @@ -144,6 +143,7 @@ be_visitor_structure_cdr_op_cs::visit_structure (be_structure *node) *os << be_global->core_versioning_end () << be_nl; node->cli_stub_cdr_op_gen (true); + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp index 403fe774109..63a8b393133 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp @@ -49,14 +49,14 @@ be_visitor_structure_cs::visit_structure (be_structure *node) } } - TAO_OutStream *os = this->ctx_->stream (); - - *os << be_nl_2; - *os << "// TAO_IDL - Generated from " << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; - if (be_global->any_support ()) { + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl_2; + *os << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; + *os << "void " << be_nl << node->name () << "::_tao_any_destructor (" << be_idt << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_traits.cpp b/TAO/TAO_IDL/be/be_visitor_traits.cpp index 0f0fa5c33f2..cb2616c223c 100644 --- a/TAO/TAO_IDL/be/be_visitor_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_traits.cpp @@ -53,32 +53,35 @@ be_visitor_traits::~be_visitor_traits (void) int be_visitor_traits::visit_root (be_root *node) { - TAO_OutStream *os = this->ctx_->stream (); + if (be_global->gen_arg_traits ()) + { + TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl_2 - << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__; + *os << be_nl_2 + << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; - *os << be_nl - << be_global->core_versioning_begin (); + *os << be_nl + << be_global->core_versioning_begin (); - *os << be_nl - << "// Traits specializations." << be_nl - << "namespace TAO" << be_nl - << "{" << be_idt; + *os << be_nl + << "// Traits specializations." << be_nl + << "namespace TAO" << be_nl + << "{" << be_idt; - if (this->visit_scope (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_traits::" - "visit_root - visit scope failed\n"), - -1); - } + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_traits::" + "visit_root - visit scope failed\n"), + -1); + } - *os << be_uidt_nl - << "}"; + *os << be_uidt_nl + << "}"; - *os << be_global->core_versioning_end () << be_nl; + *os << be_global->core_versioning_end () << be_nl; + } return 0; } diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index 80c01149d15..a7c0397d4ed 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -593,6 +593,12 @@ public: /// Check Any support. bool any_support (void) const; + /// Set cdr support. + void cdr_support (bool); + + /// Check cdr support. + bool cdr_support (void) const; + /// Set TypeCode support. void tc_support (bool); @@ -1028,6 +1034,9 @@ private: /// do we support Any operators? bool any_support_; + /// do we support cdr? + bool cdr_support_; + /// do we support typecodes? bool tc_support_; |