diff options
author | gokhale <gokhale@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-18 21:32:57 +0000 |
---|---|---|
committer | gokhale <gokhale@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-18 21:32:57 +0000 |
commit | 3755f9138bf64e39f0671488c1871036b61750b8 (patch) | |
tree | 0ab83f18abce5c661f58778c9a33bf93044e59d7 /TAO/TAO_IDL/be/be_operation.cpp | |
parent | 4a5b8b1a2c6fa3cacd3640bbc75324321ebba7f8 (diff) | |
download | ATCD-3755f9138bf64e39f0671488c1871036b61750b8.tar.gz |
*** empty log message ***
Diffstat (limited to 'TAO/TAO_IDL/be/be_operation.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_operation.cpp | 64 |
1 files changed, 62 insertions, 2 deletions
diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp index 7246c27031d..28bf7cb1c39 100644 --- a/TAO/TAO_IDL/be/be_operation.cpp +++ b/TAO/TAO_IDL/be/be_operation.cpp @@ -135,7 +135,35 @@ be_operation::gen_client_stubs (void) cs->incr_indent (); // entry for the return type - *cs << "{" << bt->tc_name () << ", PARAM_RETURN, 0}"; + *cs << "{" << bt->tc_name () << ", PARAM_RETURN, "; + // Are we returning a pointer to value? i.e., is the type variable? If it is, + // we must tell the stub what is the size of the top level structure + if (bt->size_type () == be_decl::VARIABLE) + { + switch (bt->node_type ()) + { + case AST_Decl::NT_interface: + case AST_Decl::NT_interface_fwd: + // no need of size here + *cs << "0}"; + break; + case AST_Decl::NT_pre_defined: + { + be_predefined_type *bpd = be_predefined_type::narrow_from_decl + (bt); + if (bpd->pt () == AST_PredefinedType::PT_pseudo) + // no need of size here + *cs << "0}"; + else + *cs << "sizeof (" << bt->name () << ")}"; + } + break; + default: + *cs << "sizeof (" << bt->name () << ")}"; + } + } + else + *cs << "0}"; paramtblsize++; // if we have any arguments, get each one of them if (this->nmembers () > 0) @@ -167,7 +195,39 @@ be_operation::gen_client_stubs (void) *cs << ", PARAM_INOUT, 0}"; break; case AST_Argument::dir_OUT: - *cs << ", PARAM_OUT, 0}"; + { + *cs << ", PARAM_OUT, 0}"; +#if 0 + // Are we returning a pointer to value? i.e., is the type variable? If it is, + // we must tell the stub what is the size of the top level structure + if (bt->size_type () == be_decl::VARIABLE) + { + switch (bt->node_type ()) + { + case AST_Decl::NT_interface: + case AST_Decl::NT_interface_fwd: + // no need of size here + *cs << "0}"; + break; + case AST_Decl::NT_pre_defined: + { + be_predefined_type *bpd = + be_predefined_type::narrow_from_decl (bt); + if (bpd->pt () == AST_PredefinedType::PT_pseudo) + // no need of size here + *cs << "0}"; + else + *cs << "sizeof (" << bt->name () << ")}"; + } + break; + default: + *cs << "sizeof (" << bt->name () << ")}"; + } + } + else + *cs << "0}"; +#endif + } break; } // end switch paramtblsize++; |