summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-05-31 19:35:12 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-05-31 19:35:12 +0000
commita418f29afd0e60cd1c7fb7e48868e11b061f810f (patch)
treed8afbd416979d1dfa15274783159c183e8e6202d
parent37555de3f52d3b26177100c42815ff10d7b2b26a (diff)
downloadATCD-a418f29afd0e60cd1c7fb7e48868e11b061f810f.tar.gz
ChangeLogTag: Tue May 31 19:28:48 UTC 2005 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog20
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp40
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp47
-rw-r--r--TAO/TAO_IDL/include/utl_err.h4
-rw-r--r--TAO/TAO_IDL/util/utl_err.cpp14
-rw-r--r--TAO/docs/compiler.html10
7 files changed, 92 insertions, 45 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index ba04cbc68b7..6f0a15a3315 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,23 @@
+Tue May 31 19:28:48 UTC 2005 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_codegen.cpp:
+ * TAO_IDL/be/be_visitor_exception/exception_ch.cpp:
+ * TAO_IDL/be/be_visitor_exception/exception_cs.cpp:
+ * TAO_IDL/include/utl_err.h:
+ * TAO_IDL/util/utl_err.cpp:
+
+ Since the typecode of a user-defined IDL exception is required
+ by any IDL operation that raises it, changed the logic of the
+ -St option to be ignored for user exceptions. An informative
+ message is also output for each user exception encountered if
+ the -St option is used. Formerly, the simultaneous appearance
+ of -St and user exceptions would be made apparent only by a
+ C++ compile failure.
+
+ * docs/compiler.html:
+
+ Updated IDL compiler documentation to reflect the above change.
+
Tue May 31 10:08:27 2005 Justin Michel <michel_j@ociweb.com>
* tao/IIOP_Endpoint.cpp:
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 9f09c7bbccb..3bfea4a99bb 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -1551,7 +1551,7 @@ TAO_CodeGen::gen_stub_src_includes (void)
"tao/ORB_Core.h");
}
- if (be_global->tc_support ()
+ if ((be_global->tc_support () || idl_global->exception_seen_)
&& !be_global->gen_anyop_files ())
{
this->gen_typecode_includes (this->client_stubs_);
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
index 045dfb74283..93d4da131b4 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
@@ -19,6 +19,8 @@
// ============================================================================
#include "be_visitor_typecode/typecode_decl.h"
+#include "global_extern.h"
+#include "utl_err.h"
ACE_RCSID (be_visitor_exception,
exception_ch,
@@ -126,27 +128,33 @@ int be_visitor_exception_ch::visit_exception (be_exception *node)
*os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
- if (be_global->tc_support ())
- {
- *os << be_nl << be_nl
- << "virtual CORBA::TypeCode_ptr _tao_type (void) const;";
- }
+ // No check for typecode suppression here, since the typecode is
+ // required in generated code for an operation that raises the
+ // exception. We have already output a warning message when
+ // launching the stub header typecode visitor.
+ *os << be_nl << be_nl
+ << "virtual CORBA::TypeCode_ptr _tao_type (void) const;";
*os << be_uidt_nl << "};";
- if (be_global->tc_support ())
+ // If typecode generation is suppressed, we just output a warning
+ // and generate the typecode anyway, since the typecode is required
+ // if an operation raises the exception.
+ if (!be_global->tc_support ())
{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_typecode_decl visitor (&ctx);
+ idl_global->err ()->tc_suppression_warning (node);
+ }
+
+ be_visitor_context ctx (*this->ctx_);
+ be_visitor_typecode_decl visitor (&ctx);
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_ch::"
- "visit_exception - "
- "TypeCode declaration failed\n"),
- -1);
- }
+ if (node->accept (&visitor) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_exception_ch::"
+ "visit_exception - "
+ "TypeCode declaration failed\n"),
+ -1);
}
os->gen_endif ();
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
index 4640ef03b3d..89d6604b061 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
@@ -119,9 +119,9 @@ int be_visitor_exception_cs::visit_exception (be_exception *node)
// Assign each individual member.
ctx = *this->ctx_;
- be_visitor_exception_ctor_assign visitor (&ctx);
+ be_visitor_exception_ctor_assign ca_visitor (&ctx);
- if (node->accept (&visitor) == -1)
+ if (node->accept (&ca_visitor) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_visitor_exception_cs::"
@@ -325,30 +325,31 @@ int be_visitor_exception_cs::visit_exception (be_exception *node)
*os << be_uidt_nl << "}" << be_nl << be_nl;
}
- if (be_global->tc_support ())
- {
- *os << "// TAO extension - the virtual _type method." << be_nl;
- *os << "CORBA::TypeCode_ptr " << node->name ()
- << "::_tao_type (void) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return ::" << node->tc_name () << ";" << be_uidt_nl;
+ // No check for typecode suppression here, since the typecode is
+ // required in generated code for an operation that raises the
+ // exception. We have already output a warning message when
+ // launching the stub header typecode visitor.
+ *os << "// TAO extension - the virtual _type method." << be_nl;
+ *os << "CORBA::TypeCode_ptr " << node->name ()
+ << "::_tao_type (void) const" << be_nl;
+ *os << "{" << be_idt_nl;
+ *os << "return ::" << node->tc_name () << ";" << be_uidt_nl;
*os << "}";
- }
+
+ // No check for typecode suppression here, since the typecode is
+ // required in generated code for an operation that raises the
+ // exception. We have already output a warning message when
+ // launching the stub header typecode visitor.
+ ctx = *this->ctx_;
+ TAO::be_visitor_struct_typecode tc_visitor (&ctx);
- if (be_global->tc_support ())
+ if (tc_visitor.visit_exception (node) == -1)
{
- ctx = *this->ctx_;
- // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- TAO::be_visitor_struct_typecode visitor (&ctx);
-
- if (visitor.visit_exception (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception - "
- "TypeCode definition failed\n"),
- -1);
- }
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_exception_cs::"
+ "visit_exception - "
+ "TypeCode definition failed\n"),
+ -1);
}
node->cli_stub_gen (I_TRUE);
diff --git a/TAO/TAO_IDL/include/utl_err.h b/TAO/TAO_IDL/include/utl_err.h
index 4570f9038e2..a5c90ce1595 100644
--- a/TAO/TAO_IDL/include/utl_err.h
+++ b/TAO/TAO_IDL/include/utl_err.h
@@ -137,6 +137,7 @@ public:
EIDL_ILLEGAL_INFIX, // Illegal infix operator in expression
EIDL_LOCAL_REMOTE_MISMATCH, // Local type used in remote operation
EIDL_IGNORE_IDL3_ERROR, // -Sm option used with component or home decl
+ EIDL_TC_SUPPRESSION_WARNING,// -St option used with exception decl
EIDL_OK // No error
};
@@ -333,6 +334,9 @@ public:
// Improper use of -Sm option.
void ignore_idl3_error (AST_Decl *d);
+
+ // Improper use of -St option.
+ void tc_suppression_warning (AST_Decl *d);
};
#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 d0da0e37176..df18556b3e2 100644
--- a/TAO/TAO_IDL/util/utl_err.cpp
+++ b/TAO/TAO_IDL/util/utl_err.cpp
@@ -205,6 +205,9 @@ error_string (UTL_Error::ErrorCode c)
return "";
case UTL_Error::EIDL_IGNORE_IDL3_ERROR:
return "improper use of -Sm option with ";
+ case UTL_Error::EIDL_TC_SUPPRESSION_WARNING:
+ /* More intelligible message printed by warning routine */
+ return "";
}
return 0;
@@ -1390,4 +1393,15 @@ UTL_Error::ignore_idl3_error (AST_Decl *d)
idl_global->set_err_count (idl_global->err_count () + 1);
}
+void
+UTL_Error::tc_suppression_warning (AST_Decl *d)
+{
+ this->warning1 (EIDL_TC_SUPPRESSION_WARNING, d);
+ ACE_ERROR ((LM_ERROR,
+ "-St option ignored for "));
+ d->name ()->dump (*ACE_DEFAULT_LOG_STREAM);
+ ACE_ERROR ((LM_ERROR,
+ ". Type code required to raise IDL exception.\n"));
+}
+
diff --git a/TAO/docs/compiler.html b/TAO/docs/compiler.html
index 1ef51454f18..b89b41b9ae3 100644
--- a/TAO/docs/compiler.html
+++ b/TAO/docs/compiler.html
@@ -721,12 +721,12 @@ also receives other options that are specific to it. <p>
<tr><a name="St">
<td><tt>-St</tt></td>
- <td>Suppress generation of the TypeCodes</td>
+ <td>Suppress generation of typecodes</td>
<td>Also suppresses the generation of the Any operators, since they need the
- associated typecode. User exceptions also need the generated typecode, and
- a user exception in an IDL file compiled with this option will cause a
- C++ compilation error.</td>
+ associated typecode. IDL operations that may raise a user-defined exception
+ require the exception's typecode, so this option is ignored for user
+ exception typecode generation, and a warning message is output.</td>
</tr>
<tr><a name="Sc">
@@ -744,7 +744,7 @@ also receives other options that are specific to it. <p>
that modified the AST and is launched just before the code generating
visitors. There is a new tool in CIAO that converts the entire IDL file
into one containing explicit declarations of the implied IDL types.
- For such a file, we don't want the preprocessing visitor to bve launched,
+ For such a file, we don't want the preprocessing visitor to be launched,
so this command line option will suppress it.</td>
</tr>