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.cpp149
1 files changed, 125 insertions, 24 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 2dc75fbe214..1093490547c 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
@@ -56,7 +56,14 @@ be_visitor_operation_rettype_vardecl_cs::visit_array (be_array *node)
bt = node;
os->indent ();
- *os << bt->name () << "_slice *_tao_retval = 0;\n\n";
+
+ 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 << be_nl << be_nl;
+
return 0;
}
@@ -72,7 +79,13 @@ be_visitor_operation_rettype_vardecl_cs::visit_enum (be_enum *node)
bt = node;
os->indent ();
- *os << bt->name () << " _tao_retval = (" << bt->name () << ")0;\n";
+ 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 << be_nl << be_nl;
+
return 0;
}
@@ -88,7 +101,13 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface (be_interface *node)
bt = node;
os->indent ();
- *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();\n";
+ 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 << be_nl << be_nl;
+
return 0;
}
@@ -104,7 +123,13 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface_fwd (be_interface_fwd *
bt = node;
os->indent ();
- *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();\n";
+ 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 << be_nl << be_nl;
+
return 0;
}
@@ -122,7 +147,14 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype (be_valuetype *node)
bt = node;
os->indent ();
- *os << bt->name () << "* _tao_retval = 0;\n";
+
+ 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 << be_nl << be_nl;
+
return 0;
}
@@ -138,7 +170,13 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd *
bt = node;
os->indent ();
- *os << bt->name () << "* _tao_retval = 0;\n";
+ 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 << be_nl << be_nl;
+
return 0;
}
@@ -159,19 +197,31 @@ be_visitor_operation_rettype_vardecl_cs::visit_predefined_type (be_predefined_ty
{
case AST_PredefinedType::PT_pseudo:
os->indent ();
- *os << bt->name () << "_ptr _tao_retval = 0;\n";
+ 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;";
break;
case AST_PredefinedType::PT_any:
os->indent ();
- *os << bt->name () << " *_tao_retval = 0;\n";
+ 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;";
break;
case AST_PredefinedType::PT_void:
break;
default:
os->indent ();
- *os << bt->name () << " _tao_retval = 0;\n";
+ 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;";
break;
}
+
+ *os << be_nl << be_nl;
+
return 0;
}
@@ -189,7 +239,12 @@ be_visitor_operation_rettype_vardecl_cs::visit_sequence (be_sequence *node)
bt = node;
os->indent ();
- *os << bt->name () << " *_tao_retval = 0;\n";
+ 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 << be_nl << be_nl;
return 0;
}
@@ -199,7 +254,12 @@ be_visitor_operation_rettype_vardecl_cs::visit_string (be_string * /* node*/)
TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
os->indent ();
- *os << "char *_tao_retval = 0;\n";
+ 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 << be_nl << be_nl;
return 0;
}
@@ -215,14 +275,34 @@ be_visitor_operation_rettype_vardecl_cs::visit_structure (be_structure *node)
bt = node;
os->indent ();
- // 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;\n";
- else
+
+ if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
{
- *os << bt->name () << " _tao_retval;" << be_nl;
- *os << "ACE_OS::memset (&_tao_retval, 0, sizeof (" << bt->name () << "));\n";
+ // 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;
+ }
}
return 0;
}
@@ -255,13 +335,34 @@ be_visitor_operation_rettype_vardecl_cs::visit_union (be_union *node)
bt = node;
os->indent ();
- // 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;\n";
- else
+
+ if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS)
{
- *os << bt->name () << " _tao_retval;\n";
+ // 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;";
+ }
}
+ 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;";
+ }
+ else
+ {
+ *os << bt->name () << " _tao_retval;";
+ }
+ }
+
+ *os << be_nl;
return 0;
}