diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-08-02 19:56:23 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-08-02 19:56:23 +0000 |
commit | 52a1badefe4b7318cd74f1b8c9bb0dd73c121c1e (patch) | |
tree | b898f976d77eefd3fba2dcaa9f72449f6251ae82 /TAO | |
parent | da5dd9d6f9c00ae5e6edd39bcd138df8ebbe90bb (diff) | |
download | ATCD-52a1badefe4b7318cd74f1b8c9bb0dd73c121c1e.tar.gz |
ChangeLogTag: Thu Aug 2 10:17:12 2001 Jeff Parsons <parsons@cs.wustl.edu>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp | 60 |
1 files changed, 33 insertions, 27 deletions
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 a820cb4be7f..d6f01e8fd34 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp @@ -91,12 +91,6 @@ be_visitor_operation_cs::visit_operation (be_operation *node) -1); } - if (bt->node_type () == AST_Decl::NT_typedef) - { - be_typedef *btd = be_typedef::narrow_from_decl (bt); - bt = btd->primitive_base_type (); - } - // Generate the return type mapping (same as in the header file) be_visitor_context ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS); @@ -111,6 +105,7 @@ be_visitor_operation_cs::visit_operation (be_operation *node) "codegen for return type failed\n"), -1); } + delete visitor; // Generate the operation name @@ -121,6 +116,7 @@ be_visitor_operation_cs::visit_operation (be_operation *node) ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS); visitor = tao_cg->make_visitor (&ctx); + if ((!visitor) || (node->accept (visitor) == -1)) { delete visitor; @@ -130,6 +126,7 @@ be_visitor_operation_cs::visit_operation (be_operation *node) "codegen for argument list failed\n"), -1); } + delete visitor; *os << "{" << be_idt_nl; @@ -140,27 +137,31 @@ be_visitor_operation_cs::visit_operation (be_operation *node) *os << be_nl << be_nl; } + // For what follows, the return type node nust be unaliased. + if (bt->node_type () == AST_Decl::NT_typedef) + { + be_typedef *btd = be_typedef::narrow_from_decl (bt); + bt = btd->primitive_base_type (); + } + AST_Decl::NodeType bnt = bt->base_node_type (); be_predefined_type *bpt = 0; AST_PredefinedType::PredefinedType pdt = AST_PredefinedType::PT_void; - if (!this->void_return_type (bt)) + if (bnt == AST_Decl::NT_pre_defined) { - if (bnt == AST_Decl::NT_pre_defined) - { - bpt = be_predefined_type::narrow_from_decl (bt); - pdt = bpt->pt (); + bpt = be_predefined_type::narrow_from_decl (bt); + pdt = bpt->pt (); - if (pdt == AST_PredefinedType::PT_longlong) - { - *os << "CORBA::LongLong _tao_retval = " - << "ACE_CDR_LONGLONG_INITIALIZER;" << be_nl << be_nl; - } - else if (pdt == AST_PredefinedType::PT_longdouble) - { - *os << "CORBA::LongDouble _tao_retval = " - << "ACE_CDR_LONG_DOUBLE_INITIALIZER;" << be_nl << be_nl; - } + if (pdt == AST_PredefinedType::PT_longlong) + { + *os << "CORBA::LongLong _tao_retval = " + << "ACE_CDR_LONGLONG_INITIALIZER;" << be_nl << be_nl; + } + else if (pdt == AST_PredefinedType::PT_longdouble) + { + *os << "CORBA::LongDouble _tao_retval = " + << "ACE_CDR_LONG_DOUBLE_INITIALIZER;" << be_nl << be_nl; } } @@ -248,18 +249,23 @@ be_visitor_operation_cs::visit_operation (be_operation *node) -1); } - *os << "," << be_nl; + + *os << "," << be_nl; be_decl *decl = be_decl::narrow_from_decl (d); - *os << decl->local_name(); - si->next (); - } + *os << decl->local_name(); + si->next (); + } } + if (!be_global->exception_support ()) - *os << "," << be_nl << "ACE_TRY_ENV"; + { + *os << "," << be_nl << "ACE_TRY_ENV"; + } + *os << be_uidt_nl << ");" << be_uidt << be_uidt_nl << "}\n\n"; -return 0; + return 0; } int |