diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-01-28 20:23:53 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-01-28 20:23:53 +0000 |
commit | d6c4e6b698dba41353390db65d8e6ce7a00762fb (patch) | |
tree | ed7b34126cf55c3df1744e2ceab14847b7a3e83e | |
parent | 77c7a31c5358a3813bac251990ba7cd986d70e1c (diff) | |
download | ATCD-d6c4e6b698dba41353390db65d8e6ce7a00762fb.tar.gz |
ChangeLogTag:Mon Jan 28 12:23:39 2002 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 24 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_argument/argument.cpp | 10 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp | 29 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp | 14 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_argument/argument.h | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_operation/amh_ss.h | 3 |
7 files changed, 69 insertions, 17 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 4a6514c4e9c..c1c3515e7aa 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,27 @@ +Mon Jan 28 12:23:39 2002 Carlos O'Ryan <coryan@uci.edu> + + * TAO_IDL/be_include/be_visitor_argument/argument.h: + * TAO_IDL/be/be_visitor_argument/argument.cpp: + Add functionality to support fixed-direction arguments, i.e. the + visitor caller can override the actual direction of the + argument. This is used in AMH to make all the INOUT arguments + behave as IN arguments. + + * TAO_IDL/be/be_visitor_operation/amh_sh.cpp: + * TAO_IDL/be/be_visitor_operation/amh_ss.cpp: + Use the set_fixed_direction() functionality in the + be_visitor_args visitors to generate correct code for the INOUT + arguments in an AMH function. + + * TAO_IDL/be_include/be_visitor_operation/amh_ss.h: + Removed extra argument in the generate_shared_section() helper, + the argument is no longer needed. + + + * TAO_IDL/be/be_visitor_amh_pre_proc.cpp: + Fixed problem in UTL_ScopeActiveIterator, a bogus si.next() was + left in the for()-loop body. + Mon Jan 28 12:15:43 2002 Ossama Othman <ossama@uci.edu> * tests/OBV/Forward/server.dsp: diff --git a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp index 201a142059c..ded2cc0d1af 100644 --- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp @@ -374,7 +374,6 @@ be_visitor_amh_pre_proc::visit_scope (be_scope *node) si.next ()) { elements[position++] = si.item (); - si.next (); } } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp index 58f17a07a22..c172a002252 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp @@ -26,6 +26,7 @@ ACE_RCSID(be_visitor_argument, argument, "$Id$") be_visitor_args::be_visitor_args (be_visitor_context *ctx) : be_visitor_decl (ctx) + , fixed_direction_ (-1) { } @@ -71,6 +72,9 @@ be_visitor_args::type_name (be_type *node, AST_Argument::Direction be_visitor_args::direction (void) { + if (this->fixed_direction_ != -1) + return AST_Argument::Direction (this->fixed_direction_); + // grab the argument node. We know that our context has stored the right // argument node be_argument *arg = this->ctx_->be_node_as_argument (); @@ -78,3 +82,9 @@ be_visitor_args::direction (void) ACE_ASSERT (arg != 0); return arg->direction (); } + +void +be_visitor_args::set_fixed_direction (AST_Argument::Direction direction) +{ + this->fixed_direction_ = direction; +} diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp index 11785ba8a24..f2ffde51842 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp @@ -56,14 +56,11 @@ be_visitor_amh_operation_sh::visit_operation (be_operation *node) this->generate_shared_prologue (node, os, ""); - int argument_count = - node->count_arguments_with_direction (AST_Argument::dir_IN - | AST_Argument::dir_INOUT); - be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS); - be_visitor_operation_arglist arglist_visitor (&ctx); + be_visitor_args_arglist arglist_visitor (&ctx); + arglist_visitor.set_fixed_direction (AST_Argument::dir_IN); ctx.scope (node); for (UTL_ScopeActiveIterator i (node, UTL_Scope::IK_decls); @@ -77,7 +74,7 @@ be_visitor_amh_operation_sh::visit_operation (be_operation *node) continue; *os << ","; - if (argument->accept (&arglist_visitor) == -1) + if (arglist_visitor.visit_argument (argument) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_amh_operation_sh::" @@ -89,9 +86,23 @@ be_visitor_amh_operation_sh::visit_operation (be_operation *node) } *os << "TAO_ENV_ARG_PARAMETER" << be_uidt_nl << ")" << be_uidt; - if (arglist_visitor.gen_throw_spec (node) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) - gen_throe_spec failed\n"), -1); + + if (be_global->use_raw_throw ()) + *os << be_idt_nl << "throw ("; + else + *os << be_idt_nl << "ACE_THROW_SPEC (("; + + *os << be_idt_nl << "CORBA::SystemException"; + + if (be_global->use_raw_throw ()) + { + *os << be_uidt_nl << ")" << be_uidt; + } + else + { + *os << be_uidt_nl << "))" << be_uidt; + } + *os << " = 0;\n" << be_nl; return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp index 2b21a13be43..7b5774e86b8 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp @@ -49,6 +49,8 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) vardecl_ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS); be_visitor_args_vardecl_ss vardecl_visitor (&vardecl_ctx); + vardecl_visitor.set_fixed_direction (AST_Argument::dir_IN); + for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls); !si.is_done (); si.next ()) @@ -82,6 +84,8 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) marshal_ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT); be_visitor_args_marshal_ss marshal_visitor (&marshal_ctx); + marshal_visitor.set_fixed_direction (AST_Argument::dir_IN); + for (UTL_ScopeActiveIterator sj (node, UTL_Scope::IK_decls); !sj.is_done (); sj.next ()) @@ -119,13 +123,14 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) *os << be_uidt << "\n"; } - if (this->generate_shared_section (node, os, argument_count) == -1) + if (this->generate_shared_section (node, os) == -1) return -1; { be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS); be_visitor_args_upcall_ss visitor (&ctx); + visitor.set_fixed_direction (AST_Argument::dir_IN); for (UTL_ScopeActiveIterator i (node, UTL_Scope::IK_decls); !i.is_done (); @@ -167,7 +172,7 @@ be_visitor_amh_operation_ss::visit_attribute (be_attribute *node) if (this->generate_shared_prologue (node, os, "_get_") == -1) return -1; - if (this->generate_shared_section (node, os, 0) == -1) + if (this->generate_shared_section (node, os) == -1) return -1; *os << "TAO_ENV_ARG_PARAMETER"; @@ -222,7 +227,7 @@ be_visitor_amh_operation_ss::visit_attribute (be_attribute *node) } *os << be_uidt << "\n"; - if (this->generate_shared_section (node, os, 1) == -1) + if (this->generate_shared_section (node, os) == -1) return -1; *os << ", " << node->local_name () @@ -292,8 +297,7 @@ be_visitor_amh_operation_ss::generate_shared_prologue (be_decl *node, int be_visitor_amh_operation_ss::generate_shared_section (be_decl *node, - TAO_OutStream *os, - int argument_count) + TAO_OutStream *os) { be_interface *intf = be_interface::narrow_from_scope (node->defined_in ()); diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/argument.h b/TAO/TAO_IDL/be_include/be_visitor_argument/argument.h index 882c8003b4a..dec4beb6a0a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/argument.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/argument.h @@ -54,6 +54,11 @@ public: virtual int visit_argument (be_argument *node); // must be overridden by derived classes + + void set_fixed_direction (AST_Argument::Direction direction); + +private: + int fixed_direction_; }; #endif /* _BE_VISITOR_ARGUMENT_ARGUMENT_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/amh_ss.h b/TAO/TAO_IDL/be_include/be_visitor_operation/amh_ss.h index 786e00263f3..ee9855c6fbd 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/amh_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/amh_ss.h @@ -34,8 +34,7 @@ protected: TAO_OutStream *os, const char *skel_prefix); int generate_shared_section (be_decl *node, - TAO_OutStream *os, - int argument_count); + TAO_OutStream *os); int generate_shared_epilogue (TAO_OutStream *os); }; |