summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp125
1 files changed, 31 insertions, 94 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp
index 1093490547c..5873b0d412f 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp
@@ -57,10 +57,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_array (be_array *node)
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "_slice *_tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "_slice *_tao_retval = 0;";
+ *os << bt->name () << "_slice *_tao_retval = 0;";
*os << be_nl << be_nl;
@@ -79,10 +76,8 @@ be_visitor_operation_rettype_vardecl_cs::visit_enum (be_enum *node)
bt = node;
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << " _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << " _tao_retval = (" << bt->name () << ")0;";
+
+ *os << bt->name () << " _tao_retval = (" << bt->name () << ")0;";
*os << be_nl << be_nl;
@@ -101,10 +96,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface (be_interface *node)
bt = node;
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "_ptr _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();";
+ *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();";
*os << be_nl << be_nl;
@@ -123,10 +115,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface_fwd (be_interface_fwd *
bt = node;
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "_ptr _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();";
+ *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();";
*os << be_nl << be_nl;
@@ -148,10 +137,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype (be_valuetype *node)
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "* _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "* _tao_retval = 0;";
+ *os << bt->name () << "* _tao_retval = 0;";
*os << be_nl << be_nl;
@@ -170,10 +156,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd *
bt = node;
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "* _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "* _tao_retval = 0;";
+ *os << bt->name () << "* _tao_retval = 0;";
*os << be_nl << be_nl;
@@ -197,26 +180,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_predefined_type (be_predefined_ty
{
case AST_PredefinedType::PT_pseudo:
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "_ptr _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "_ptr _tao_retval = 0;";
+ *os << bt->name () << "_ptr _tao_retval = 0;";
break;
case AST_PredefinedType::PT_any:
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "* _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "* _tao_retval = 0;";
+ *os << bt->name () << "* _tao_retval = 0;";
break;
case AST_PredefinedType::PT_void:
break;
default:
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << " _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << " _tao_retval = 0;";
+ *os << bt->name () << " _tao_retval = 0;";
break;
}
@@ -239,10 +213,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_sequence (be_sequence *node)
bt = node;
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "* _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "* _tao_retval = 0;";
+ *os << bt->name () << "* _tao_retval = 0;";
*os << be_nl << be_nl;
return 0;
@@ -254,10 +225,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_string (be_string * /* node*/)
TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- *os << bt->name () << "char* _tao_ami_result;";
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- *os << "char* _tao_retval = 0;";
+ *os << "char* _tao_retval = 0;";
*os << be_nl << be_nl;
return 0;
@@ -276,34 +244,19 @@ be_visitor_operation_rettype_vardecl_cs::visit_structure (be_structure *node)
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
- {
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- {
- *os << bt->name () << "* _tao_ami_result;" << be_nl;
- }
- else
- {
- *os << bt->name () << " _tao_ami_result;" << be_nl;
- }
- }
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
- {
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- {
- *os << bt->name () << "* _tao_retval = 0;" << be_nl;
- }
- else
- {
- *os << bt->name () << " _tao_retval;" << be_nl;
- *os << "ACE_OS::memset (&_tao_retval, 0, sizeof (" << bt->name () << "));"
- << be_nl;
- }
- }
+ // based on whether we are variable or not, we return a pointer or the
+ // aggregate type
+ if (node->size_type () == be_decl::VARIABLE)
+ {
+ *os << bt->name () << "* _tao_retval = 0;" << be_nl;
+ }
+ else
+ {
+ *os << bt->name () << " _tao_retval;" << be_nl;
+ *os << "ACE_OS::memset (&_tao_retval, 0, sizeof (" << bt->name () << "));"
+ << be_nl;
+ }
+
return 0;
}
@@ -336,31 +289,15 @@ be_visitor_operation_rettype_vardecl_cs::visit_union (be_union *node)
os->indent ();
- if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
+ // based on whether we are variable or not, we return a pointer or the
+ // aggregate type
+ if (node->size_type () == be_decl::VARIABLE)
{
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- {
- *os << bt->name () << "* _tao_ami_result = 0;";
- }
- else
- {
- *os << bt->name () << " _tao_ami_result;";
- }
+ *os << bt->name () << "* _tao_retval = 0;";
}
- else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS)
+ else
{
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- {
- *os << bt->name () << "* _tao_retval = 0;";
- }
- else
- {
- *os << bt->name () << " _tao_retval;";
- }
+ *os << bt->name () << " _tao_retval;";
}
*os << be_nl;