summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgokhale <asgokhale@users.noreply.github.com>1998-04-04 10:53:07 +0000
committergokhale <asgokhale@users.noreply.github.com>1998-04-04 10:53:07 +0000
commit144009ea0af7ad12df59488002110106ff4551af (patch)
treeaf7d5cca974877f7a6737ad0c767b658e41aaa55
parentbe80db5c6cc05809f73374b869c46198110921a4 (diff)
downloadATCD-144009ea0af7ad12df59488002110106ff4551af.tar.gz
*** empty log message ***
-rw-r--r--TAO/ChangeLog-98c50
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception.cpp101
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field.cpp14
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef.cpp4
7 files changed, 132 insertions, 51 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index 9744642a66b..7800b25c108 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,21 @@
+Sat Apr 4 04:26:49 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu>
+
+ * TAO_IDL/be/be_visitor_interface_fwd.cpp: We were not checking if
+ the node was imported. Due to this, code was getting generated for
+ forward declared interfaces from "#include"d IDL files.
+
+ * TAO_IDL/be/be_visitor_sequence.cpp: We were not calling
+ "nested_type_name" while generating the return type of the
+ operator [] in the sequence var class. As a result, a fully scoped
+ name was getting generated instead of a relative scoped name which
+ the MSVC++ compiler does not like.
+
+ * TAO_IDL/be/be_visitor_exception.cpp: For "typedefed" nodes, we
+ were using their base types to generate the code. This is fixed.
+
+ In addition, some files from the above and others were modified to
+ correct some formatting problems in the generated code.
+
Sat Apr 4 00:24:01 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
* tests/Cubit/TAO/MT_Cubit/client.cpp: Fixed a typo where
@@ -18,15 +36,15 @@ Fri Apr 3 18:39:21 1998 Steve Huston <shuston@riverace.com>
Fri Apr 3 17:43:07 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
- * tao/CDR.h:
- * tao/orbconf.h:
- * tao/CDR.cpp:
+ * tao/CDR.h:
+ * tao/orbconf.h:
+ * tao/CDR.cpp:
Added configuration macros to enable swap on write, and to
disable swap on read.
Also increased the default size of a CDR buffer.
- * tests/CDR/Makefile:
- * tests/CDR/growth.cpp:
+ * tests/CDR/Makefile:
+ * tests/CDR/growth.cpp:
Added another simple test of the CDR buffer, this one tries to
measure performance.
@@ -38,7 +56,7 @@ Fri Apr 3 17:15:22 1998 Steve Huston <shuston@riverace.com>
Fri Apr 3 17:07:18 1998 Sergio Flores <sergio@polka.cs.wustl.edu>
- * tao/TAO_Internal.cpp (FAKE_SVC_ENTRY):
+ * tao/TAO_Internal.cpp (FAKE_SVC_ENTRY):
* tao/orbconf.h: Made minor changes to have the fake service
configurator receive its values through macros, instead of
changing the ".cpp" file. Seems cleaner this way.
@@ -46,32 +64,32 @@ Fri Apr 3 17:07:18 1998 Sergio Flores <sergio@polka.cs.wustl.edu>
Fri Apr 3 15:35:39 1998 Alexander Babu Arulanthu <alex@merengue.cs.wustl.edu>
* orbsvcs/tests/AVStreams/client.h, client.cpp: All PropertySet
- methods and the Iterator class methods tested.
-
+ methods and the Iterator class methods tested.
+
Fri Apr 3 08:59:16 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
- * tao/CDR.cpp:
+ * tao/CDR.cpp:
Null strings are transmitted as empty strings.
- Fixed
+ Fixed
- * tao/IIOP_ORB.cpp:
+ * tao/IIOP_ORB.cpp:
Ensure that CDR buffer created from the IOR string is properly
aligned.
- * tao/Server_Request.cpp:
+ * tao/Server_Request.cpp:
More checking for exceptions while decoding parameters and we
print an error message if decoding fails.
- * tao/Typecode.cpp:
+ * tao/Typecode.cpp:
Only the first byte of the encapsulation stores the byte order,
the next three bytes are ignored because the <kind> is stored as
a long.
- * tao/decode.cpp:
+ * tao/decode.cpp:
Removed dead code, improve error message when decoding object
references and fix an off by one error in ObjRef::decode.
- * tao/encode.cpp:
+ * tao/encode.cpp:
When encoding Object References an encapsulated stream is
created in place, I debugged the computation of the length for
that stream and left some debug messages commented out.
@@ -79,7 +97,7 @@ Fri Apr 3 08:59:16 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
strings is in the CDR classes, no need to duplicate the effort
here.
- * tao/Connect.cpp:
+ * tao/Connect.cpp:
Cosmetic changes.
Fri Apr 03 09:01:00 1998 David L. Levine <levine@cs.wustl.edu>
diff --git a/TAO/TAO_IDL/be/be_visitor_exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception.cpp
index 88136b1c1fd..712202ba83f 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception.cpp
@@ -143,7 +143,7 @@ int be_visitor_exception_ch::visit_exception (be_exception *node)
*os << node->local_name () << " (void); // default ctor" << be_nl;
*os << node->local_name () << " (const " << node->local_name ()
<< " &); // copy ctor" << be_nl;
- *os << "~" << node->local_name () << "(void); // dtor" << be_nl;
+ *os << "~" << node->local_name () << " (void); // dtor" << be_nl;
// generate constructor that takes each member as a parameter. We need a
// new state. Such a constructor exists if we have members
@@ -163,6 +163,7 @@ int be_visitor_exception_ch::visit_exception (be_exception *node)
delete visitor;
}
+ os->indent ();
// assignment operator
*os << node->local_name () << " &operator= (const "
<< node->local_name () << " &);" << be_nl;
@@ -186,14 +187,12 @@ int be_visitor_exception_ch::visit_exception (be_exception *node)
if (node->is_nested ())
{
// we have a scoped name
- os->indent ();
*os << "static CORBA::TypeCode_ptr "
<< node->tc_name ()->last_component () << ";\n\n";
}
else
{
// we are in the ROOT scope
- os->indent ();
*os << "extern "
<< idl_global->export_macro ()
<< " CORBA::TypeCode_ptr "
@@ -510,10 +509,17 @@ int be_visitor_exception_ctor::visit_array (be_array *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ // set the right type;
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << "const " << node->nested_type_name (this->ctx_->scope ());
+ *os << "const " << bt->nested_type_name (this->ctx_->scope ());
else
- *os << "const " << node->name ();
+ *os << "const " << bt->name ();
return 0;
}
@@ -521,10 +527,17 @@ int be_visitor_exception_ctor::visit_enum (be_enum *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ // set the right type;
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << node->nested_type_name (this->ctx_->scope ());
+ *os << bt->nested_type_name (this->ctx_->scope ());
else
- *os << node->name ();
+ *os << bt->name ();
return 0;
}
@@ -532,10 +545,17 @@ int be_visitor_exception_ctor::visit_interface (be_interface *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ // set the right type;
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << "const " << node->nested_type_name (this->ctx_->scope ());
+ *os << "const " << bt->nested_type_name (this->ctx_->scope ());
else
- *os << "const " << node->name ();
+ *os << "const " << bt->name ();
*os << "_ptr ";
return 0;
}
@@ -544,10 +564,17 @@ int be_visitor_exception_ctor::visit_interface_fwd (be_interface_fwd *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ // set the right type;
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << "const " << node->nested_type_name (this->ctx_->scope ());
+ *os << "const " << bt->nested_type_name (this->ctx_->scope ());
else
- *os << "const " << node->name ();
+ *os << "const " << bt->name ();
*os << "_ptr ";
return 0;
}
@@ -556,30 +583,37 @@ int be_visitor_exception_ctor::visit_predefined_type (be_predefined_type *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ // set the right type;
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
// check if the type is an any
if (node->pt () == AST_PredefinedType::PT_any)
{
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << "const " << node->nested_type_name (this->ctx_->scope ());
+ *os << "const " << bt->nested_type_name (this->ctx_->scope ());
else
- *os << "const " << node->name ();
+ *os << "const " << bt->name ();
*os << " &";
return 0;
} // end of if
else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
{
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << "const " << node->nested_type_name (this->ctx_->scope ());
+ *os << "const " << bt->nested_type_name (this->ctx_->scope ());
else
- *os << "const " << node->name ();
+ *os << "const " << bt->name ();
*os << "_ptr ";
} // end else if
else // simple predefined types
{
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << node->nested_type_name (this->ctx_->scope ());
+ *os << bt->nested_type_name (this->ctx_->scope ());
else
- *os << node->name ();
+ *os << bt->name ();
} // end of else
return 0;
@@ -589,10 +623,17 @@ int be_visitor_exception_ctor::visit_sequence (be_sequence *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ // set the right type;
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << "const " << node->nested_type_name (this->ctx_->scope ());
+ *os << "const " << bt->nested_type_name (this->ctx_->scope ());
else
- *os << "const " << node->name ();
+ *os << "const " << bt->name ();
*os << " &";
return 0;
}
@@ -609,10 +650,17 @@ int be_visitor_exception_ctor::visit_structure (be_structure *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ // set the right type;
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << "const " << node->nested_type_name (this->ctx_->scope ());
+ *os << "const " << bt->nested_type_name (this->ctx_->scope ());
else
- *os << "const " << node->name ();
+ *os << "const " << bt->name ();
*os << " &";
return 0;
}
@@ -621,10 +669,17 @@ int be_visitor_exception_ctor::visit_union (be_union *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ // set the right type;
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << "const " << node->nested_type_name (this->ctx_->scope ());
+ *os << "const " << bt->nested_type_name (this->ctx_->scope ());
else
- *os << "const " << node->name ();
+ *os << "const " << bt->name ();
*os << " &";
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_field.cpp b/TAO/TAO_IDL/be/be_visitor_field.cpp
index 655dfc073ca..aea7858ea37 100644
--- a/TAO/TAO_IDL/be/be_visitor_field.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field.cpp
@@ -77,6 +77,7 @@ be_visitor_field_ch::visit_field (be_field *node)
int
be_visitor_field_ch::visit_array (be_array *node)
{
+ // TO-DO
return 0;
}
@@ -256,7 +257,14 @@ be_visitor_field_ch::visit_string (be_string *node)
os = this->ctx_->stream ();
os->indent (); // start from current indentation level
- *os << "CORBA::String_var";
+ // set the right type;
+ if (this->ctx_->alias ())
+ {
+ *os << this->ctx_->alias ()->nested_type_name (this->ctx_->scope ())
+ << "_var";
+ }
+ else
+ *os << "CORBA::String_var";
return 0;
}
@@ -316,10 +324,6 @@ be_visitor_field_ch::visit_structure (be_structure *node)
int
be_visitor_field_ch::visit_typedef (be_typedef *node)
{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- os->indent (); // start from current indentation level
this->ctx_->alias (node); // save the node for use in code generation and
// indicate that the field of the field node
// is a typedefed quantity
diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp
index 03fa5598afc..3e9ce97d5cf 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp
@@ -44,7 +44,7 @@ be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node)
{
TAO_OutStream *os = this->ctx_->stream ();
- if (!node->cli_hdr_gen ())
+ if (!node->cli_hdr_gen () && !node->imported ())
{
os->indent (); // start from the current
@@ -112,7 +112,7 @@ be_visitor_interface_fwd_ci::visit_interface_fwd (be_interface_fwd *node)
{
TAO_OutStream *os = this->ctx_->stream ();
- if (!node->cli_inline_gen ())
+ if (!node->cli_inline_gen () && !node->imported ())
{
// generate the ifdefined macro for the _var type
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence.cpp b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
index 2b4a8863722..e18db8592d9 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
@@ -1411,7 +1411,13 @@ be_visitor_sequence_elemtype::visit_predefined_type (be_predefined_type *node)
switch (node->pt ())
{
case AST_PredefinedType::PT_pseudo:
- *os << "TAO_Object_Manager<" << bt->name () << "> ";
+ if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH)
+ {
+ *os << "TAO_Object_Manager<" << bt->nested_type_name
+ (this->ctx_->scope ()) << "> ";
+ }
+ else
+ *os << "TAO_Object_Manager<" << bt->name () << "> ";
break;
default:
if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH)
diff --git a/TAO/TAO_IDL/be/be_visitor_structure.cpp b/TAO/TAO_IDL/be/be_visitor_structure.cpp
index 68df8b4baf6..d0fd88b13e1 100644
--- a/TAO/TAO_IDL/be/be_visitor_structure.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_structure.cpp
@@ -123,7 +123,7 @@ int be_visitor_structure_ch::visit_structure (be_structure *node)
os->indent (); // start from whatever indentation level we were at
*os << "struct " << node->local_name () << be_nl
- << "{\n" << be_idt;
+ << "{" << be_idt << "\n";
// generate code for field members
if (this->visit_scope (node) == -1)
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef.cpp
index 5c3f0abb3d8..deb36563a5e 100644
--- a/TAO/TAO_IDL/be/be_visitor_typedef.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typedef.cpp
@@ -529,14 +529,12 @@ be_visitor_typedef_ch::visit_typedef (be_typedef *node)
if (node->is_nested ())
{
// we have a scoped name
- os->indent ();
*os << "static CORBA::TypeCode_ptr "
<< node->tc_name ()->last_component () << ";\n\n";
}
else
{
// we are in the ROOT scope
- os->indent ();
*os << "extern CORBA::TypeCode_ptr "
<< node->tc_name ()->last_component () << ";\n\n";
}
@@ -718,7 +716,7 @@ be_visitor_typedef_ch::visit_sequence (be_sequence *node)
{
// now generate the typedefs
os->indent ();
- // typedef the type and the _slice type
+ // typedef the type
*os << "typedef " << bt->nested_type_name (scope)
<< " " << tdef->nested_type_name (scope) << ";" << be_nl;
// typedef the _var, _out types