diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-18 19:23:58 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-18 19:23:58 +0000 |
commit | f993396f19ded44cb730f237d4a649543dba8a91 (patch) | |
tree | 9f9eadb82bbf104913d3152b22dec8bac944d707 | |
parent | efe1273cebec171c8c956c2d8e0b3d974c2de106 (diff) | |
download | ATCD-f993396f19ded44cb730f237d4a649543dba8a91.tar.gz |
ChangeLogTag: Thu Nov 18 13:17:49 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 20 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp | 36 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp | 33 | ||||
-rw-r--r-- | TAO/TAO_IDL/fe/idl.yy | 9 | ||||
-rw-r--r-- | TAO/TAO_IDL/fe/y.tab.cpp | 9 | ||||
-rw-r--r-- | TAO/TAO_IDL/include/utl_err.h | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/util/utl_err.cpp | 25 |
7 files changed, 52 insertions, 85 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 148140478e2..fdb0c074c46 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,23 @@ +Thu Nov 18 13:17:49 2004 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp: + * TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp: + * TAO_IDL/fe/idl.yy: + * TAO_IDL/fe/y.tab.cpp: + + Removed code generation of Any and CDR operator declarations + for undefined forward declared interfaces. Since this issue + was last addressed, we have added other features to code + generation that may enable us to eliminate this unnecessary + bit of code generation. + + * TAO_IDL/include/utl_err.h: + * TAO_IDL/util/utl_err.cpp: + + Added error for use of local type in a non-local interface's + operation signature. Formerly we had just an ACE_DEBUG message, + which is easily overlooked. + Thu Nov 18 19:08:12 UTC 2004 Martin Corino <mcorino@remedy.nl> * rules.tao.GNU: diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp index f7c297f2789..810ae9c41d0 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp @@ -39,41 +39,7 @@ be_visitor_interface_fwd_any_op_ch::~be_visitor_interface_fwd_any_op_ch (void) } int -be_visitor_interface_fwd_any_op_ch::visit_interface_fwd ( - be_interface_fwd *node - ) +be_visitor_interface_fwd_any_op_ch::visit_interface_fwd (be_interface_fwd *) { - AST_Interface *fd = node->full_definition (); - - // Only a forward declared interface that is not defined in the same file - // needs to have this generated here. The Any operators are needed by - // portable interceptor code if the interface is a parameter of an operation. - if (fd->is_defined () != 0) - { - return 0; - } - - if (node->cli_hdr_any_op_gen () - || node->imported ()) - { - return 0; - } - - TAO_OutStream *os = this->ctx_->stream (); - - *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - - *os << be_global->stub_export_macro () << " void" - << " operator<<= (CORBA::Any &, " << node->name () - << "_ptr); // copying" << be_nl; - *os << be_global->stub_export_macro () << " void" - << " operator<<= (CORBA::Any &, " << node->name () - << "_ptr *); // non-copying" << be_nl; - *os << be_global->stub_export_macro () << " CORBA::Boolean" - << " operator>>= (const CORBA::Any &, " - << node->name () << " *&);"; - - node->cli_hdr_any_op_gen (1); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp index ac208f83648..b5bdd077fb4 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp @@ -40,38 +40,7 @@ be_visitor_interface_fwd_cdr_op_ch::~be_visitor_interface_fwd_cdr_op_ch (void) } int -be_visitor_interface_fwd_cdr_op_ch::visit_interface_fwd (be_interface_fwd *node) +be_visitor_interface_fwd_cdr_op_ch::visit_interface_fwd (be_interface_fwd *) { - AST_Interface *fd = node->full_definition (); - - // If this forward declared interface is defined later in the file, - // the CDR operator declaration (along with the corresponding - // declarations for members of the interface's scope) will be - // generated then. - if (fd->is_defined ()) - { - return 0; - } - - // No CDR operations for locality constraint interfaces. - if (node->cli_hdr_cdr_op_gen () - || node->imported ()) - { - return 0; - } - - TAO_OutStream *os = this->ctx_->stream (); - - *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - - *os << be_global->stub_export_macro () << " CORBA::Boolean " - << "operator<< (TAO_OutputCDR &, const " << node->full_name () - << "_ptr );" << be_nl; - *os << be_global->stub_export_macro () << " CORBA::Boolean " - << "operator>> (TAO_InputCDR &, " - << node->full_name () << "_ptr &);\n"; - - node->cli_hdr_cdr_op_gen (1); return 0; } diff --git a/TAO/TAO_IDL/fe/idl.yy b/TAO/TAO_IDL/fe/idl.yy index 3ed6f111daa..943c733478d 100644 --- a/TAO/TAO_IDL/fe/idl.yy +++ b/TAO/TAO_IDL/fe/idl.yy @@ -3895,14 +3895,7 @@ parameter : { if (!s->is_local () && tp->is_local ()) { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("error in %s line %d\n"), - idl_global->filename ()->get_string (), - idl_global->lineno ())); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Cannot use a local type as an ") - ACE_TEXT ("argument of a remote ") - ACE_TEXT ("operation\n"))); + idl_global->err ()->local_remote_mismatch (tp, s); } else { diff --git a/TAO/TAO_IDL/fe/y.tab.cpp b/TAO/TAO_IDL/fe/y.tab.cpp index 1180d883048..c8b5bbff115 100644 --- a/TAO/TAO_IDL/fe/y.tab.cpp +++ b/TAO/TAO_IDL/fe/y.tab.cpp @@ -6061,14 +6061,7 @@ tao_yyreduce: { if (!s->is_local () && tp->is_local ()) { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("error in %s line %d\n"), - idl_global->filename ()->get_string (), - idl_global->lineno ())); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Cannot use a local type as an ") - ACE_TEXT ("argument of a remote ") - ACE_TEXT ("operation\n"))); + idl_global->err ()->local_remote_mismatch (tp, s); } else { diff --git a/TAO/TAO_IDL/include/utl_err.h b/TAO/TAO_IDL/include/utl_err.h index 5983c4ce49e..9aaabd9d5e8 100644 --- a/TAO/TAO_IDL/include/utl_err.h +++ b/TAO/TAO_IDL/include/utl_err.h @@ -135,6 +135,7 @@ public: EIDL_EMPTY_MODULE, // Empty modules not allowed in IDL. EIDL_BACK_END, // Back end error EIDL_ILLEGAL_INFIX, // Illegal infix operator in expression + EIDL_LOCAL_REMOTE_MISMATCH, // Local type used in remote operation EIDL_OK // No error }; @@ -324,6 +325,10 @@ public: // Report illegal infix operator error (they can be used // only with integer, floating point or fixed point expressions. void illegal_infix (void); + + // Report local type used in remote operation. + void local_remote_mismatch (AST_Decl *l, + UTL_Scope *s); }; #endif // _UTL_ERR_UTL_ERR_HH diff --git a/TAO/TAO_IDL/util/utl_err.cpp b/TAO/TAO_IDL/util/utl_err.cpp index 51b2afc7e7c..9771a2188ca 100644 --- a/TAO/TAO_IDL/util/utl_err.cpp +++ b/TAO/TAO_IDL/util/utl_err.cpp @@ -201,6 +201,8 @@ error_string (UTL_Error::ErrorCode c) return "back end: "; case UTL_Error::EIDL_ILLEGAL_INFIX: return "illegal infix operator in expression"; + case UTL_Error::EIDL_LOCAL_REMOTE_MISMATCH: + return ""; } return 0; @@ -1301,10 +1303,10 @@ UTL_Error::redefinition_in_scope (AST_Decl *d, idl_error_header (EIDL_REDEF_SCOPE, d->line (), d->file_name ()); - d->name ()->dump (*ACE_DEFAULT_LOG_STREAM);; + d->name ()->dump (*ACE_DEFAULT_LOG_STREAM); ACE_ERROR ((LM_ERROR, ", ")); - s->name ()->dump (*ACE_DEFAULT_LOG_STREAM);; + s->name ()->dump (*ACE_DEFAULT_LOG_STREAM); ACE_ERROR ((LM_ERROR, "\n")); idl_global->set_err_count (idl_global->err_count () + 1); @@ -1355,3 +1357,22 @@ UTL_Error::illegal_infix (void) idl_global->set_err_count (idl_global->err_count () + 1); } +void +UTL_Error::local_remote_mismatch (AST_Decl *l, + UTL_Scope *s) +{ + AST_Decl *r = ScopeAsDecl (s); + idl_error_header (EIDL_LOCAL_REMOTE_MISMATCH, + r->line (), + r->file_name ()); + ACE_ERROR ((LM_ERROR, + "local type ")); + l->name ()->dump (*ACE_DEFAULT_LOG_STREAM); + ACE_ERROR ((LM_ERROR, + " used in remote operation ")); + r->name ()->dump (*ACE_DEFAULT_LOG_STREAM); + ACE_ERROR ((LM_ERROR, + "\n")); + idl_global->set_err_count (idl_global->err_count () + 1); +} + |