diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-03-16 22:35:42 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-03-16 22:35:42 +0000 |
commit | f0b39cec86a7a22160261563ccdbe8b839969662 (patch) | |
tree | 91259fafec20d82b1dc5ac2c517a092f689f9942 | |
parent | 7fa7d76535e5e29daff1cf1b36fa3e975ff5b387 (diff) | |
download | ATCD-f0b39cec86a7a22160261563ccdbe8b839969662.tar.gz |
ChangeLogTag: Thu Mar 16 22:20:46 UTC 2006 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 27 | ||||
-rw-r--r-- | TAO/TAO_IDL/ast/ast_interface.cpp | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp | 42 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp | 15 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp | 128 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/include/ast_interface.h | 2 |
7 files changed, 181 insertions, 42 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index a14dc28da50..549b15367de 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,30 @@ +Thu Mar 16 22:20:46 UTC 2006 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/ast/ast_interface.cpp (be_add_operation): + * TAO_IDL/include/ast_interface.h (be_add_operation): + + Changed the return type from void to AST_Operation*, + the same type that is returned from the implementation's + delegation to the private method fe_add_operation. This + change allows an error in fe_add_operation (which will + return 0 and probably be the result of a name clash) to + get propagated up and be reflected in tao_idl's return + value. + + * TAO_IDL/be/be_visitor_amh_pre_proc.cpp: + * TAO_IDL/be/be_visitor_ami_pre_proc.cpp: + * TAO_IDL/be/be_visitor_ccm_pre_proc.cpp: + * TAO_IDL/be/be_visitor_interface/amh_sh.cpp: + + Changed usage of be_add_operation() to check the new + return type and return -1 if it is null. The IDL + compiler formerly would output a 'redefinition' + (name clash) diagnostic if a user operation name + clashed with an implied operation name of AMI or AMH, + and likewise if 2 ports of the same category in a + component had the same name. Now the IDL compiler + will also indicate failure when it exits. + Thu Mar 16 20:13:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> * tao/Object.cpp: diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index 01dd4f7b78e..b6fa8f38f18 100644 --- a/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/TAO/TAO_IDL/ast/ast_interface.cpp @@ -155,10 +155,10 @@ AST_Interface::be_replace_operation (AST_Decl *old_op, new_op); } -void +AST_Operation * AST_Interface::be_add_operation (AST_Operation *op) { - (void) this->fe_add_operation (op); + return this->fe_add_operation (op); } // Add an AST_Constant node (a constant declaration) to this scope. 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 a0ddcb7bb2a..138ed412013 100644 --- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp @@ -83,10 +83,10 @@ be_visitor_amh_pre_proc::visit_interface (be_interface *node) // interfaces, not because we want to generate code for them, but // because the (imported-AMH-) node could be needed to generate a // non-imported, AMH node, for example, for a derived interface. - + // (JP) Havinq AMH_* nodes inherit directly from AMH_* base classes // is also a problem if the base interface is abstract, since at - // the moment, no AMH code is generated for such interfaces. It + // the moment, no AMH code is generated for such interfaces. It // would be desirable to mimic the AMI design, where all AMI-related // classes inherit from a single base class, no matter what the // parentage of the IDL interface. Until we solve the problem of @@ -107,7 +107,7 @@ be_visitor_amh_pre_proc::visit_interface (be_interface *node) this->create_exception_holder (node); excep_holder->set_defined_in (node->defined_in ()); excep_holder->original_interface (node); - + AST_Module *module = AST_Module::narrow_from_scope (node->defined_in ()); module->set_has_nested_valuetype (); @@ -155,7 +155,7 @@ be_visitor_amh_pre_proc::create_response_handler ( dynamic_cast<UTL_ScopedName*> (node->name ()->copy ()); Identifier *local_name = amh_name->last_component (); local_name->replace_string (class_name.c_str ()); - + UTL_Scope *s = node->defined_in (); idl_global->scopes ().push (s); @@ -175,7 +175,7 @@ be_visitor_amh_pre_proc::create_response_handler ( 1, // local 0), // non-abstract 0); - + idl_global->scopes ().pop (); response_handler->set_name (amh_name); @@ -229,7 +229,7 @@ be_visitor_amh_pre_proc::add_rh_node_members ( be_interface *node, this->create_response_handler_attribute (attr, response_handler, exception_holder); - + if (status == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -250,7 +250,7 @@ be_visitor_amh_pre_proc::add_rh_node_members ( be_interface *node, this->create_response_handler_operation (operation, response_handler, exception_holder); - + if (status == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -319,12 +319,12 @@ be_visitor_amh_pre_proc::create_response_handler_attribute ( delete gos; gos = 0; } - + int status = this->create_response_handler_operation (get_operation, response_handler, exception_holder); - + if (status == -1) { return -1; @@ -334,7 +334,7 @@ be_visitor_amh_pre_proc::create_response_handler_attribute ( { return 0; } - + // Temporarily generate the set operation. be_operation *set_operation = this->generate_set_operation (node); @@ -361,7 +361,7 @@ be_visitor_amh_pre_proc::create_response_handler_attribute ( this->create_response_handler_operation (set_operation, response_handler, exception_holder); - + if (status == -1) { return -1; @@ -427,7 +427,11 @@ be_visitor_amh_pre_proc::add_exception_reply (be_operation *node, node_excep->be_add_argument (argument); node_excep->set_defined_in (response_handler); - response_handler->be_add_operation (node_excep); + + if (0 == response_handler->be_add_operation (node_excep)) + { + return -1; + } return 0; } @@ -552,7 +556,10 @@ be_visitor_amh_pre_proc::add_normal_reply (be_operation *node, // After having generated the operation we insert it into the // response handler interface. - response_handler->be_add_operation (operation); + if (0 == response_handler->be_add_operation (operation)) + { + return -1; + } return 0; } @@ -600,7 +607,7 @@ be_visitor_amh_pre_proc::create_exception_holder (be_interface *node) UTL_ScopedName *excep_holder_name = node->compute_name ("AMH_", "ExceptionHolder"); - + UTL_Scope *s = node->defined_in (); idl_global->scopes ().push (s); @@ -619,7 +626,7 @@ be_visitor_amh_pre_proc::create_exception_holder (be_interface *node) 0, 0), 0); - + idl_global->scopes ().pop (); excep_holder->set_name (excep_holder_name); @@ -788,7 +795,10 @@ be_visitor_amh_pre_proc::create_raise_operation ( // After having generated the operation we insert it into the // exceptionholder valuetype. - excep_holder->be_add_operation (operation); + if (0 == excep_holder->be_add_operation (operation)) + { + return -1; + } return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp index 76e04fbc7b1..49acedd3dab 100644 --- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp @@ -841,7 +841,10 @@ be_visitor_ami_pre_proc::create_raise_operation ( // After having generated the operation we insert it into the // exceptionholder valuetype. - excep_holder->be_add_operation (operation); + if (0 == excep_holder->be_add_operation (operation)) + { + return -1; + } return 0; } @@ -1174,7 +1177,10 @@ be_visitor_ami_pre_proc::create_reply_handler_operation ( // After having generated the operation we insert it into the // reply handler interface. - reply_handler->be_add_operation (operation); + if (0 == reply_handler->be_add_operation (operation)) + { + return -1; + } return 0; } @@ -1278,7 +1284,10 @@ be_visitor_ami_pre_proc::create_excep_operation (be_operation *node, // After having generated the operation we insert it into the // reply handler interface. - reply_handler->be_add_operation (operation); + if (0 == reply_handler->be_add_operation (operation)) + { + return -1; + } return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp index e9f8c41cdb7..2df3027db28 100644 --- a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp @@ -307,7 +307,11 @@ be_visitor_ccm_pre_proc::gen_provides (be_component *node) provides_op->set_defined_in (node); provides_op->set_imported (node->imported ()); provides_op->set_name (op_name); - node->be_add_operation (provides_op); + + if (0 == node->be_add_operation (provides_op)) + { + return -1; + } } return 0; @@ -509,7 +513,10 @@ be_visitor_ccm_pre_proc::gen_factories (be_home *node, -1); } - xplicit->be_add_operation (*item); + if (0 == xplicit->be_add_operation (*item)) + { + return -1; + } } return 0; @@ -543,7 +550,10 @@ be_visitor_ccm_pre_proc::gen_finders (be_home *node, -1); } - xplicit->be_add_operation (*item); + if (0 == xplicit->be_add_operation (*item)) + { + return -1; + } } return 0; @@ -651,7 +661,12 @@ be_visitor_ccm_pre_proc::gen_connect_single ( tail), -1); op->be_add_exceptions (connect_single); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -688,7 +703,12 @@ be_visitor_ccm_pre_proc::gen_disconnect_single ( 0), -1); op->be_add_exceptions (disconnect_single); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -718,7 +738,12 @@ be_visitor_ccm_pre_proc::gen_get_connection_single ( -1); op->set_name (op_full_name); op->set_defined_in (node); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -772,7 +797,12 @@ be_visitor_ccm_pre_proc::gen_connect_multiple ( tail), -1); op->be_add_exceptions (connect_multiple); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -820,7 +850,12 @@ be_visitor_ccm_pre_proc::gen_disconnect_multiple ( 0), -1); op->be_add_exceptions (disconnect_multiple); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -864,7 +899,12 @@ be_visitor_ccm_pre_proc::gen_get_connection_multiple ( op->set_name (op_full_name); op->set_defined_in (node); op->set_imported (node->imported ()); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -903,7 +943,12 @@ be_visitor_ccm_pre_proc::gen_push_op (be_eventtype *node, -1); arg_id.destroy (); push_op->be_add_argument (arg); - consumer->be_add_operation (push_op); + + if (0 == consumer->be_add_operation (push_op)) + { + return -1; + } + return 0; } @@ -955,7 +1000,12 @@ be_visitor_ccm_pre_proc::gen_subscribe (be_component *node, 0), -1); op->be_add_exceptions (subscribe); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -1006,7 +1056,12 @@ be_visitor_ccm_pre_proc::gen_unsubscribe (be_component *node, 0), -1); op->be_add_exceptions (unsubscribe); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -1059,7 +1114,12 @@ be_visitor_ccm_pre_proc::gen_emits_connect ( 0), -1); op->be_add_exceptions (emits_connect); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -1102,7 +1162,12 @@ be_visitor_ccm_pre_proc::gen_emits_disconnect ( 0), -1); op->be_add_exceptions (emits_disconnect); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -1139,7 +1204,12 @@ be_visitor_ccm_pre_proc::gen_get_consumer ( op->set_name (op_name); op->set_defined_in (node); op->set_imported (node->imported ()); - node->be_add_operation (op); + + if (0 == node->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -1196,7 +1266,12 @@ be_visitor_ccm_pre_proc::gen_create (be_home *node, op->be_add_exceptions (exceps); op->set_defined_in (implicit); op->set_imported (node->imported ()); - implicit->be_add_operation (op); + + if (0 == implicit->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -1247,7 +1322,12 @@ be_visitor_ccm_pre_proc::gen_find_by_primary_key (be_home *node, op->be_add_exceptions (exceps); op->set_defined_in (implicit); op->set_imported (node->imported ()); - implicit->be_add_operation (op); + + if (0 == implicit->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -1298,7 +1378,12 @@ be_visitor_ccm_pre_proc::gen_remove (be_home *node, op->be_add_exceptions (exceps); op->set_defined_in (implicit); op->set_imported (node->imported ()); - implicit->be_add_operation (op); + + if (0 == implicit->be_add_operation (op)) + { + return -1; + } + return 0; } @@ -1332,7 +1417,12 @@ be_visitor_ccm_pre_proc::gen_get_primary_key (be_home *node, op->be_add_argument (arg); op->set_defined_in (implicit); op->set_imported (node->imported ()); - implicit->be_add_operation (op); + + if (0 == implicit->be_add_operation (op)) + { + return -1; + } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp index e3454aecd71..19e7340f37c 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp @@ -377,7 +377,10 @@ be_visitor_amh_interface_sh::add_amh_operation (be_operation *node, // After having generated the operation we insert it into the // AMH node interface. - amh_node->be_add_operation (operation); + if (0 == amh_node->be_add_operation (operation)) + { + return -1; + } return 0; } diff --git a/TAO/TAO_IDL/include/ast_interface.h b/TAO/TAO_IDL/include/ast_interface.h index f085eb3055f..a173d6d05d6 100644 --- a/TAO/TAO_IDL/include/ast_interface.h +++ b/TAO/TAO_IDL/include/ast_interface.h @@ -109,7 +109,7 @@ public: ACE_Unbounded_Queue<AST_Interface *> &get_insert_queue (void); ACE_Unbounded_Queue<AST_Interface *> &get_del_queue (void); - void be_add_operation (AST_Operation *); + AST_Operation *be_add_operation (AST_Operation *); void be_replace_operation (AST_Decl *old_op, AST_Decl *new_op); |