summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-09-02 01:25:21 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-09-02 01:25:21 +0000
commit11204c986d6d29a2eedd8d63f31688984719535a (patch)
tree0b6129b64b9bd2e2d3fb8c3d1373b43987020027
parente1885fb61da097c8311dcbfa1883bd6f3fe035bc (diff)
downloadATCD-11204c986d6d29a2eedd8d63f31688984719535a.tar.gz
ChangeLogTag:Fri Sep 1 18:16:47 2000 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a14
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp46
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp17
3 files changed, 44 insertions, 33 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index d45add8095f..058174fe3f0 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,17 @@
+Fri Sep 1 18:16:47 2000 Carlos O'Ryan <coryan@uci.edu>
+
+ * TAO_IDL/be/be_visitor_operation/operation_ss.cpp:
+ * TAO_IDL/be/be_visitor_operation/operation_cs.cpp:
+ Moved the declaration and use of the _tao_retval_info variable
+ to code protected by TAO_HAS_INTERCEPTORS==1.
+ This was important because sometimes the initialization of the
+ variable had side-effects (like clearing the real return
+ argument), normally the side-effects would be compesated by the
+ interceptors code, but sometimes the code is not there !
+ Several annoying "unused variable" warnings were hinting at this
+ problem, another lesson into "why listening to warnings is
+ important".
+
Fri Sep 01 16:15:52 2000 Carlos O'Ryan <coryan@uci.edu>
* tao/PortableServer/Collocated_Object.cpp:
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 d6a1c3d7d8d..b405dc1a7c8 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
@@ -374,7 +374,7 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
be_decl *parent =
be_scope::narrow_from_scope (node->defined_in ())->decl ();
// But since we are at the interface level our parents full_name
- // will include the interface name which we dont want and so we
+ // will include the interface name which we dont want and so we
// get our parent's parent's full name.
// be_interface *parent_interface = be_interface::narrow_from_decl (parent);
// be_decl *parents_parent = be_interface::narrow_from_scope (parent_interface->scope ())->decl ();
@@ -383,7 +383,7 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
*os << parent->full_name () << "::";
}
- *os << "TAO_ClientRequest_Info_"<< node->flat_name ();
+ *os << "TAO_ClientRequest_Info_"<< node->flat_name ();
// We need the interface node in which this operation was defined. However,
// if this operation node was an attribute node in disguise, we get this
// information from the context and add a "_get"/"_set" to the flat
@@ -400,7 +400,7 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
"Bad return type\n"),
-1);
}
-
+
// grab the right visitor to generate the return type if its not
// void it means it is not the accessor.
if (!this->void_return_type (bt))
@@ -448,7 +448,7 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
}
os->decr_indent ();
-
+
*os << "ACE_TRY" << be_idt_nl
<< "{\n"
<< "#endif /* TAO_HAS_INTERCEPTORS */\n";
@@ -468,11 +468,11 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
-1);
}
-
+
// Invoke preinvoke interceptor
*os << be_nl << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl
// Get the request_id field for the Request Info. In TAO, request id's
- // change with differnet profiles so this seems to be the appropriate
+ // change with differnet profiles so this seems to be the appropriate
// place to populate the Request Info with it.
<< "ri.request_id (_tao_call.request_id ()); "<< be_nl
<< " _tao_vfr.send_request ("<< be_idt << be_idt_nl
@@ -726,7 +726,7 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
*os << be_uidt;
}
-
+
// Populate the Request Info with result if any of the invocation
if (!this->void_return_type (bt))
{
@@ -741,11 +741,11 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
// And finally the _retn () is returned from the operation w.o
// causing any problems.
+ *os << be_nl << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl;
// Generate the return type mapping (same as in the header file)
ctx = *this->ctx_;
ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
visitor = tao_cg->make_visitor (&ctx);
-
if ((!visitor) || (bt->accept (visitor) == -1))
{
delete visitor;
@@ -756,24 +756,22 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
-1);
}
delete visitor;
- *os << " _tao_retval_info = ";
+
if (bt->size_type () == be_decl::VARIABLE
|| bt->base_node_type () == AST_Decl::NT_array)
{
- *os << "_tao_safe_retval._retn ();";
- *os << be_nl << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl;
- *os << be_nl << " ri.result (_tao_retval_info);"
- << be_nl << "_tao_safe_retval = _tao_retval_info;" <<be_nl;
- *os <<be_uidt << be_uidt_nl << ");"<<be_nl;
+ *os << " _tao_retval_info = _tao_safe_retval._retn ();" << be_nl
+ << "ri.result (_tao_retval_info);" << be_nl
+ << "_tao_safe_retval = _tao_retval_info;" << be_uidt_nl
+ << ");" << be_uidt_nl;
}
else
{
- *os << "_tao_retval;";
- *os << be_nl << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl;
- *os << be_nl << " ri.result (_tao_retval_info);" << be_nl;
- *os <<be_uidt << be_uidt_nl << ");"<<be_nl;
+ *os << " _tao_retval_info = _tao_retval;" << be_nl
+ << " ri.result (_tao_retval_info);" << be_uidt_nl
+ << ");" << be_uidt_nl;
}
-
+
// get the return val
/* ctx = *this->ctx_;
ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS);
@@ -790,15 +788,15 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
}*/
// *os <<");" << be_nl;
}
-
+
// Oneway operations dont have receive reply since once the request
// goes over the wire, its the end of the story!
if (node->flags () != AST_Operation::OP_oneway)
{
// Invoke postinvoke interceptor
*os << be_nl << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl;
- *os << "_tao_vfr.receive_reply (" << be_idt_nl
- << "&ri,"
+ *os << "_tao_vfr.receive_reply (" << be_idt_nl
+ << "&ri,"
<< be_nl << "ACE_TRY_ENV" << be_uidt_nl
<< ")" << be_uidt << be_uidt_nl << ");\n";
if (this->gen_check_interceptor_exception (bt) == -1)
@@ -820,10 +818,10 @@ be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
<< be_uidt_nl << "}" << be_uidt_nl
<< "ACE_CATCHANY" << be_idt_nl
<< "{" << be_idt_nl;
-
+
// Update the exception field of teh request info.
*os << "ri.exception (&ACE_ANY_EXCEPTION);"<< be_nl;
-
+
*os << "_tao_vfr.receive_exception (" << be_idt << be_idt_nl
<< "&ri," << be_nl
<< "ACE_TRY_ENV" << be_uidt_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
index 6e3e1c8a65c..9bdc4b08e8e 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
@@ -322,6 +322,8 @@ be_visitor_operation_ss::visit_operation (be_operation *node)
// type.
if (!this->void_return_type (bt))
{
+ *os <<"\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl;
+
// Heres what we are going to do to have a uniform way of getting the
// return value updated for the Request Info:
// declare a operation_retval type object and assign the
@@ -347,21 +349,18 @@ be_visitor_operation_ss::visit_operation (be_operation *node)
-1);
}
delete visitor;
- *os << " _tao_retval_info = ";
if (bt->size_type () == be_decl::VARIABLE
|| bt->base_node_type () == AST_Decl::NT_array)
{
- *os << "_tao_retval._retn ();\n";
- *os <<"#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl;
- *os << be_nl << " ri.result (_tao_retval_info);"
- << be_nl << "_tao_retval = _tao_retval_info;\n"
+ *os << " _tao_retval_info = _tao_retval._retn ();" << be_nl
+ << " ri.result (_tao_retval_info);" << be_nl
+ << " _tao_retval = _tao_retval_info;\n"
<< "#endif /* TAO_HAS_INTERCEPTORS */\n\n";
}
else
{
- *os << "_tao_retval;\n";
- *os <<"#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl
- << "ri.result (_tao_retval_info);\n"
+ *os << " _tao_retval_info = _tao_retval;" << be_nl
+ << " ri.result (_tao_retval_info);\n"
<< "#endif /* TAO_HAS_INTERCEPTORS */\n\n";
}
#if 0
@@ -384,7 +383,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node)
*os << ");"<< be_nl;
#endif /* 0 */
}
- *os << "TAO_INTERCEPTOR_CHECK;\n\n";
+ *os << be_nl << "TAO_INTERCEPTOR_CHECK;\n\n";
// do postinvoke, and check for exception.
*os << "#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl;