summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-05-31 16:44:22 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-05-31 16:44:22 +0000
commit681bba0315dd2045ec381baf842960387d335a2b (patch)
tree47140e34dad7ba9e9aad9aedd5a0500d448aa637
parent843c3c792dc787740ebc9db5cb146c762c8d7544 (diff)
downloadATCD-681bba0315dd2045ec381baf842960387d335a2b.tar.gz
ChangeLogTag: Mon May 31 16:41:48 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception.cpp1
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp1
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp68
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp21
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp20
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp20
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp21
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp21
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp21
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h36
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h19
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h6
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h43
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h19
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h21
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h33
-rw-r--r--TAO/tests/IDL_Test/included.idl17
-rw-r--r--TAO/tests/IDL_Test/including.idl31
20 files changed, 268 insertions, 192 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 1475d2720ab..1c07a9d1229 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,40 @@
+Mon May 31 16:41:48 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_visitor_exception/exception.cpp:
+ * TAO_IDL/be/be_visitor_exception/exception_ctor.cpp:
+ * TAO_IDL/be/be_visitor_exception/exception_ch.cpp:
+ * TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp:
+ * TAO_IDL/be/be_visitor_exception.cpp:
+ * TAO_IDL/be/be_visitor_union_branch.cpp:
+ * TAO_IDL/be/be_visitor_union_branch/public_ch.cpp:
+ * TAO_IDL/be/be_visitor_field.cpp:
+ * TAO_IDL/be/be_visitor_field/field_ci.cpp:
+ * TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp:
+ * TAO_IDL/be/be_visitor_field/field_cs.cpp:
+ * TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp:
+ * TAO_IDL/be/be_visitor_field/field_ch.cpp:
+ * TAO_IDL/be_include/be_visitor_exception/ctor.h:
+ * TAO_IDL/be_include/be_visitor_union_branch/public_ch.h:
+ * TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h:
+ * TAO_IDL/be_include/be_visitor_field/field_ch.h:
+ * TAO_IDL/be_include/be_visitor_field/field_ci.h:
+ * TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h:
+ * TAO_IDL/be_include/be_visitor_field/field_cs.h:
+
+ Added overrides of visit_structure_fwd() and
+ visit_union_fwd() to various visitors that were
+ generating and empty typename for these nodes.
+ When a struct or union is referenced that was
+ forward declared (and defined) in an included
+ IDL file, the lookup returns the forward declaration.
+
+ * tests/IDL_Test/included.idl:
+ * tests/IDL_Test/including.idl:
+
+ Use case above added to the test suite. Thanks to
+ Thanks to Bogdan Jeram <bjeram at eso dot org> for
+ reporting the problem and supplying the test case.
+
Mon May 31 14:57:57 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_interface.cpp(gen_gperf_lookup_methods):
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
index 90da8e330aa..6b4a0e5759e 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
@@ -12,10 +12,8 @@
*/
//=============================================================================
-
be_visitor_exception_cdr_op_cs::be_visitor_exception_cdr_op_cs (
- be_visitor_context *ctx
- )
+ be_visitor_context *ctx)
: be_visitor_exception (ctx)
{
}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
index be772c13e67..5b8597eb330 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
// Generic exception visitor.
be_visitor_exception::be_visitor_exception (be_visitor_context *ctx)
: be_visitor_scope (ctx)
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 968118c2e61..02fa0ade88f 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
#include "be_visitor_typecode/typecode_decl.h"
#include "global_extern.h"
#include "utl_err.h"
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp
index e2cb463efca..ff8de1848d2 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
// ************************************************************************
// code to generate the special ctor
// ************************************************************************
@@ -47,7 +46,8 @@ be_visitor_exception_ctor::post_process (be_decl *bd)
return 0;
}
-int be_visitor_exception_ctor::visit_exception (be_exception *node)
+int
+be_visitor_exception_ctor::visit_exception (be_exception *node)
{
TAO_OutStream *os = this->ctx_->stream ();
this->ctx_->node (node);
@@ -89,7 +89,8 @@ int be_visitor_exception_ctor::visit_exception (be_exception *node)
return 0;
}
-int be_visitor_exception_ctor::visit_field (be_field *node)
+int
+be_visitor_exception_ctor::visit_field (be_field *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
@@ -119,7 +120,8 @@ int be_visitor_exception_ctor::visit_field (be_field *node)
return 0;
}
-int be_visitor_exception_ctor::visit_array (be_array *node)
+int
+be_visitor_exception_ctor::visit_array (be_array *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
@@ -153,7 +155,8 @@ int be_visitor_exception_ctor::visit_array (be_array *node)
return 0;
}
-int be_visitor_exception_ctor::visit_enum (be_enum *node)
+int
+be_visitor_exception_ctor::visit_enum (be_enum *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
@@ -179,7 +182,8 @@ int be_visitor_exception_ctor::visit_enum (be_enum *node)
return 0;
}
-int be_visitor_exception_ctor::visit_interface (be_interface *node)
+int
+be_visitor_exception_ctor::visit_interface (be_interface *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
@@ -205,7 +209,8 @@ int be_visitor_exception_ctor::visit_interface (be_interface *node)
return 0;
}
-int be_visitor_exception_ctor::visit_interface_fwd (be_interface_fwd *node)
+int
+be_visitor_exception_ctor::visit_interface_fwd (be_interface_fwd *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
@@ -231,22 +236,26 @@ int be_visitor_exception_ctor::visit_interface_fwd (be_interface_fwd *node)
return 0;
}
-int be_visitor_exception_ctor::visit_valuebox (be_valuebox *node)
+int
+be_visitor_exception_ctor::visit_valuebox (be_valuebox *node)
{
return this->emit_common (node);
}
-int be_visitor_exception_ctor::visit_valuetype (be_valuetype *node)
+int
+be_visitor_exception_ctor::visit_valuetype (be_valuetype *node)
{
return this->emit_common (node);
}
-int be_visitor_exception_ctor::visit_valuetype_fwd (be_valuetype_fwd *node)
+int
+be_visitor_exception_ctor::visit_valuetype_fwd (be_valuetype_fwd *node)
{
return this->emit_common (node);
}
-int be_visitor_exception_ctor::visit_predefined_type (be_predefined_type *node)
+int
+be_visitor_exception_ctor::visit_predefined_type (be_predefined_type *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
@@ -307,7 +316,8 @@ int be_visitor_exception_ctor::visit_predefined_type (be_predefined_type *node)
return 0;
}
-int be_visitor_exception_ctor::visit_sequence (be_sequence *node)
+int
+be_visitor_exception_ctor::visit_sequence (be_sequence *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
@@ -335,7 +345,8 @@ int be_visitor_exception_ctor::visit_sequence (be_sequence *node)
return 0;
}
-int be_visitor_exception_ctor::visit_string (be_string *node)
+int
+be_visitor_exception_ctor::visit_string (be_string *node)
{
TAO_OutStream *os = this->ctx_->stream (); // get output stream
@@ -351,7 +362,8 @@ int be_visitor_exception_ctor::visit_string (be_string *node)
return 0;
}
-int be_visitor_exception_ctor::visit_structure (be_structure *node)
+int
+be_visitor_exception_ctor::visit_structure (be_structure *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
@@ -379,7 +391,18 @@ int be_visitor_exception_ctor::visit_structure (be_structure *node)
return 0;
}
-int be_visitor_exception_ctor::visit_union (be_union *node)
+int
+be_visitor_exception_ctor::visit_structure_fwd (
+ be_structure_fwd *node)
+{
+ be_structure *s =
+ be_structure::narrow_from_decl (node->full_definition ());
+
+ return this->visit_structure (s);
+}
+
+int
+be_visitor_exception_ctor::visit_union (be_union *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
@@ -407,7 +430,17 @@ int be_visitor_exception_ctor::visit_union (be_union *node)
return 0;
}
-int be_visitor_exception_ctor::visit_typedef (be_typedef *node)
+int
+be_visitor_exception_ctor::visit_union_fwd (be_union_fwd *node)
+{
+ be_union *u =
+ be_union::narrow_from_decl (node->full_definition ());
+
+ return this->visit_union (u);
+}
+
+int
+be_visitor_exception_ctor::visit_typedef (be_typedef *node)
{
this->ctx_->alias (node);
@@ -424,7 +457,8 @@ int be_visitor_exception_ctor::visit_typedef (be_typedef *node)
return 0;
}
-int be_visitor_exception_ctor::emit_common (be_type *node)
+int
+be_visitor_exception_ctor::emit_common (be_type *node)
{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp
index c83b2e29807..c3337ae628f 100644
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
#include "be_visitor_array/cdr_op_ch.h"
#include "be_visitor_enum/cdr_op_ch.h"
#include "be_visitor_sequence/cdr_op_ch.h"
@@ -185,6 +184,16 @@ be_visitor_field_cdr_op_ch::visit_structure (be_structure *node)
}
int
+be_visitor_field_cdr_op_ch::visit_structure_fwd (
+ be_structure_fwd *node)
+{
+ be_structure *s =
+ be_structure::narrow_from_decl (node->full_definition ());
+
+ return this->visit_structure (s);
+}
+
+int
be_visitor_field_cdr_op_ch::visit_typedef (be_typedef *node)
{
// Save the node for use in code generation and
@@ -236,3 +245,13 @@ be_visitor_field_cdr_op_ch::visit_union (be_union *node)
return 0;
}
+
+int
+be_visitor_field_cdr_op_ch::visit_union_fwd (be_union_fwd *node)
+{
+ be_union *u =
+ be_union::narrow_from_decl (node->full_definition ());
+
+ return this->visit_union (u);
+}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
index aa707202c06..707c33f646c 100644
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
#include "be_visitor_array/cdr_op_cs.h"
#include "be_visitor_sequence/cdr_op_cs.h"
#include "be_visitor_structure/cdr_op_cs.h"
@@ -771,6 +770,16 @@ be_visitor_field_cdr_op_cs::visit_structure (be_structure *node)
}
int
+be_visitor_field_cdr_op_cs::visit_structure_fwd (
+ be_structure_fwd *node)
+{
+ be_structure *s =
+ be_structure::narrow_from_decl (node->full_definition ());
+
+ return this->visit_structure (s);
+}
+
+int
be_visitor_field_cdr_op_cs::visit_typedef (be_typedef *node)
{
this->ctx_->alias (node);
@@ -855,6 +864,15 @@ be_visitor_field_cdr_op_cs::visit_union (be_union *node)
return 0;
}
+int
+be_visitor_field_cdr_op_cs::visit_union_fwd (be_union_fwd *node)
+{
+ be_union *u =
+ be_union::narrow_from_decl (node->full_definition ());
+
+ return this->visit_union (u);
+}
+
// ****************************************************************
be_visitor_cdr_op_field_decl::be_visitor_cdr_op_field_decl (
diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp
index bab882abfc3..35a9011d92f 100644
--- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp
@@ -454,7 +454,15 @@ be_visitor_field_ch::visit_structure (be_structure *node)
return 0;
}
-// Visit typedefed type.
+int
+be_visitor_field_ch::visit_structure_fwd (be_structure_fwd *node)
+{
+ be_structure *s =
+ be_structure::narrow_from_decl (node->full_definition ());
+
+ return this->visit_structure (s);
+}
+
int
be_visitor_field_ch::visit_typedef (be_typedef *node)
{
@@ -477,7 +485,6 @@ be_visitor_field_ch::visit_typedef (be_typedef *node)
return 0;
}
-// visit union type
int
be_visitor_field_ch::visit_union (be_union *node)
{
@@ -535,6 +542,15 @@ be_visitor_field_ch::visit_union (be_union *node)
}
int
+be_visitor_field_ch::visit_union_fwd (be_union_fwd *node)
+{
+ be_union *u =
+ be_union::narrow_from_decl (node->full_definition ());
+
+ return this->visit_union (u);
+}
+
+int
be_visitor_field_ch::visit_component (
be_component *node
)
diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp
index eb7cde0e9be..83dc00f14ea 100644
--- a/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
#include "be_visitor_array/array_ci.h"
#include "be_visitor_structure/structure_ci.h"
#include "be_visitor_union/union_ci.h"
@@ -110,6 +109,16 @@ be_visitor_field_ci::visit_structure (be_structure *node)
}
int
+be_visitor_field_ci::visit_structure_fwd (
+ be_structure_fwd *node)
+{
+ be_structure *s =
+ be_structure::narrow_from_decl (node->full_definition ());
+
+ return this->visit_structure (s);
+}
+
+int
be_visitor_field_ci::visit_typedef (be_typedef *node)
{
this->ctx_->alias (node);
@@ -150,3 +159,13 @@ be_visitor_field_ci::visit_union (be_union *node)
return 0;
}
+
+int
+be_visitor_field_ci::visit_union_fwd (be_union_fwd *node)
+{
+ be_union *u =
+ be_union::narrow_from_decl (node->full_definition ());
+
+ return this->visit_union (u);
+}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp
index af26f8b3d66..348139582bc 100644
--- a/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
#include "be_visitor_array/array_cs.h"
#include "be_visitor_enum/enum_cs.h"
#include "be_visitor_sequence/sequence_cs.h"
@@ -153,6 +152,16 @@ be_visitor_field_cs::visit_structure (be_structure *node)
}
int
+be_visitor_field_cs::visit_structure_fwd (
+ be_structure_fwd *node)
+{
+ be_structure *s =
+ be_structure::narrow_from_decl (node->full_definition ());
+
+ return this->visit_structure (s);
+}
+
+int
be_visitor_field_cs::visit_typedef (be_typedef *node)
{
this->ctx_->alias (node);
@@ -193,3 +202,13 @@ be_visitor_field_cs::visit_union (be_union *node)
return 0;
}
+
+int
+be_visitor_field_cs::visit_union_fwd (be_union_fwd *node)
+{
+ be_union *u =
+ be_union::narrow_from_decl (node->full_definition ());
+
+ return this->visit_union (u);
+}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp
index 57eb0548932..3510fbb126f 100644
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
// **********************************************
// Visitor for union_branch in the client header file.
// **********************************************
@@ -670,6 +669,16 @@ be_visitor_union_branch_public_ch::visit_structure (be_structure *node)
}
int
+be_visitor_union_branch_public_ch::visit_structure_fwd (
+ be_structure_fwd *node)
+{
+ be_structure *s =
+ be_structure::narrow_from_decl (node->full_definition ());
+
+ return this->visit_structure (s);
+}
+
+int
be_visitor_union_branch_public_ch::visit_typedef (be_typedef *node)
{
this->ctx_->alias (node);
@@ -751,3 +760,13 @@ be_visitor_union_branch_public_ch::visit_union (be_union *node)
return 0;
}
+
+int
+be_visitor_union_branch_public_ch::visit_union_fwd (be_union_fwd *node)
+{
+ be_union *u =
+ be_union::narrow_from_decl (node->full_definition ());
+
+ return this->visit_union (u);
+}
+
diff --git a/TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h b/TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h
index 855d5e7403c..05f4611b87b 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h
@@ -28,60 +28,28 @@
class be_visitor_exception_ctor : public be_visitor_scope
{
public:
- /// ctor
be_visitor_exception_ctor (be_visitor_context *ctx);
-
- /// dtor
~be_visitor_exception_ctor (void);
- /// post processing after each element
virtual int post_process (be_decl *);
- /// visit exception. We provide code for this method in the derived class
virtual int visit_exception (be_exception *node);
-
- /// visit the argument node
virtual int visit_field (be_field *node);
- // =visit all the nodes that can be the types for the field
-
- /// visit array type
virtual int visit_array (be_array *node);
-
- /// visit the enum node
virtual int visit_enum (be_enum *node);
-
- /// visit interface
virtual int visit_interface (be_interface *node);
-
- /// visit interface forward
virtual int visit_interface_fwd (be_interface_fwd *node);
-
- /// visit valuebox
virtual int visit_valuebox (be_valuebox *node);
-
- /// visit valuetype
virtual int visit_valuetype (be_valuetype *node);
-
- /// visit valuetype forward
virtual int visit_valuetype_fwd (be_valuetype_fwd *node);
-
- /// visit predefined type
virtual int visit_predefined_type (be_predefined_type *node);
-
- /// visit sequence type
virtual int visit_sequence (be_sequence *node);
-
- /// visit string type
virtual int visit_string (be_string *node);
-
- /// visit structure type
virtual int visit_structure (be_structure *node);
-
- /// visit union type
+ virtual int visit_structure_fwd (be_structure_fwd *node);
virtual int visit_union (be_union *node);
-
- /// visit the typedef type
+ virtual int visit_union_fwd (be_union_fwd *node);
virtual int visit_typedef (be_typedef *node);
private:
diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h
index 10375d55668..f350e673c36 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h
@@ -27,34 +27,19 @@
class be_visitor_field_cdr_op_ch : public be_visitor_decl
{
public:
- /// constructor
be_visitor_field_cdr_op_ch (be_visitor_context *ctx);
-
- /// destructor
~be_visitor_field_cdr_op_ch (void);
- /// visit the field node
virtual int visit_field (be_field *node);
- // =visit operations on all possible data types that a field can be
-
- /// visit array type
virtual int visit_array (be_array *node);
-
- /// visit enum type
virtual int visit_enum (be_enum *node);
-
- /// visit sequence type
virtual int visit_sequence (be_sequence *node);
-
- /// visit structure type
virtual int visit_structure (be_structure *node);
-
- /// visit typedefed type
+ virtual int visit_structure_fwd (be_structure_fwd *node);
virtual int visit_typedef (be_typedef *node);
-
- /// visit union type
virtual int visit_union (be_union *node);
+ virtual int visit_union_fwd (be_union_fwd *node);
};
#endif /* _BE_VISITOR_FIELD_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h
index 67673c9378f..45d1175be04 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h
@@ -13,7 +13,6 @@
*/
//=============================================================================
-
#ifndef _BE_VISITOR_FIELD_CDR_OP_CS_H_
#define _BE_VISITOR_FIELD_CDR_OP_CS_H_
@@ -27,10 +26,7 @@
class be_visitor_field_cdr_op_cs : public be_visitor_decl
{
public:
- /// constructor
be_visitor_field_cdr_op_cs (be_visitor_context *ctx);
-
- /// destructor
~be_visitor_field_cdr_op_cs (void);
/// visit the field node
@@ -53,8 +49,10 @@ public:
virtual int visit_sequence (be_sequence *node);
virtual int visit_string (be_string *node);
virtual int visit_structure (be_structure *node);
+ virtual int visit_structure_fwd (be_structure_fwd *node);
virtual int visit_typedef (be_typedef *node);
virtual int visit_union (be_union *node);
+ virtual int visit_union_fwd (be_union_fwd *node);
private:
int emit_valuetype_common (void);
diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h b/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h
index 7abf0142528..7629d62a4c9 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h
@@ -13,7 +13,6 @@
*/
//=============================================================================
-
#ifndef _BE_VISITOR_FIELD_CH_H_
#define _BE_VISITOR_FIELD_CH_H_
@@ -27,66 +26,28 @@
class be_visitor_field_ch : public be_visitor_decl
{
public:
- /// constructor
be_visitor_field_ch (be_visitor_context *ctx);
-
- /// destructor
~be_visitor_field_ch (void);
- /// visit the field node
virtual int visit_field (be_field *node);
-
- // =visit operations on all possible data types that a field can be
-
- /// visit array type
virtual int visit_array (be_array *node);
-
- /// visit enum type
virtual int visit_enum (be_enum *node);
-
- /// visit interface type
virtual int visit_interface (be_interface *node);
-
- /// visit interface forward type
virtual int visit_interface_fwd (be_interface_fwd *node);
-
- /// visit valuebox type
virtual int visit_valuebox (be_valuebox *node);
-
- /// visit valuetype type
virtual int visit_valuetype (be_valuetype *node);
-
- /// visit valuetype forward type
virtual int visit_valuetype_fwd (be_valuetype_fwd *node);
-
- /// visit predefined type
virtual int visit_predefined_type (be_predefined_type *node);
-
- /// visit sequence type
virtual int visit_sequence (be_sequence *node);
-
- /// visit string type
virtual int visit_string (be_string *node);
-
- /// visit structure type
virtual int visit_structure (be_structure *node);
-
- /// visit typedefed type
+ virtual int visit_structure_fwd (be_structure_fwd *node);
virtual int visit_typedef (be_typedef *node);
-
- /// visit union type
virtual int visit_union (be_union *node);
-
- /// visit a component node
+ virtual int visit_union_fwd (be_union_fwd *node);
virtual int visit_component (be_component *node);
-
- /// visit a forward declared component node
virtual int visit_component_fwd (be_component_fwd *node);
-
- /// visit an eventtype node
virtual int visit_eventtype (be_eventtype *node);
-
- /// visit a forward declared eventtype node
virtual int visit_eventtype_fwd (be_eventtype_fwd *node);
private:
diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h b/TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h
index 2a58f758415..1a570fe2b89 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h
@@ -13,7 +13,6 @@
*/
//=============================================================================
-
#ifndef _BE_VISITOR_FIELD_CI_H_
#define _BE_VISITOR_FIELD_CI_H_
@@ -28,32 +27,18 @@
class be_visitor_field_ci : public be_visitor_decl
{
public:
- /// constructor
be_visitor_field_ci (be_visitor_context *ctx);
-
- /// destructor
~be_visitor_field_ci (void);
- /// visit the field node
virtual int visit_field (be_field *node);
- // =visit operations on all possible data types that a field can be and for
- // which inline code must be generated
-
- /// visit array type
virtual int visit_array (be_array *node);
-
- /// visit sequence type
virtual int visit_sequence (be_sequence *node);
-
- /// visit structure type
virtual int visit_structure (be_structure *node);
-
- /// visit typedefed type
+ virtual int visit_structure_fwd (be_structure_fwd *node);
virtual int visit_typedef (be_typedef *node);
-
- /// visit union type
virtual int visit_union (be_union *node);
+ virtual int visit_union_fwd (be_union_fwd *node);
};
#endif /* _BE_VISITOR_FIELD_CI_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h b/TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h
index 3f6949fd867..693f032cb69 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h
@@ -13,7 +13,6 @@
*/
//=============================================================================
-
#ifndef _BE_VISITOR_FIELD_CS_H_
#define _BE_VISITOR_FIELD_CS_H_
@@ -28,35 +27,19 @@
class be_visitor_field_cs : public be_visitor_decl
{
public:
- /// constructor
be_visitor_field_cs (be_visitor_context *ctx);
-
- /// destructor
~be_visitor_field_cs (void);
- /// visit the field node
virtual int visit_field (be_field *node);
- // =visit operations on all possible data types that a field can be and impl
- // code must be generated
-
- /// visit array type
virtual int visit_array (be_array *node);
-
- /// visit enum type
virtual int visit_enum (be_enum *node);
-
- /// visit sequence type
virtual int visit_sequence (be_sequence *node);
-
- /// visit structure type
virtual int visit_structure (be_structure *node);
-
- /// visit typedefed type
+ virtual int visit_structure_fwd (be_structure_fwd *node);
virtual int visit_typedef (be_typedef *node);
-
- /// visit union type
virtual int visit_union (be_union *node);
+ virtual int visit_union_fwd (be_union_fwd *node);
};
#endif /* _BE_VISITOR_FIELD_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h
index 88ff98b8298..f0691812f88 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h
@@ -31,55 +31,26 @@
class be_visitor_union_branch_public_ch : public be_visitor_decl
{
public:
- /// constructor
be_visitor_union_branch_public_ch (be_visitor_context *ctx);
-
- /// destructor
~be_visitor_union_branch_public_ch (void);
- /// visit the union_branch node
virtual int visit_union_branch (be_union_branch *node);
- // =visit operations on all possible data types that a union_branch can be
-
- /// visit array type
virtual int visit_array (be_array *node);
-
- /// visit enum type
virtual int visit_enum (be_enum *node);
-
- /// visit interface type
virtual int visit_interface (be_interface *node);
-
- /// visit interface forward type
virtual int visit_interface_fwd (be_interface_fwd *node);
-
- /// visit valuebox type
virtual int visit_valuebox (be_valuebox *node);
-
- /// visit valuetype type
virtual int visit_valuetype (be_valuetype *node);
-
- /// visit valuetype forward type
virtual int visit_valuetype_fwd (be_valuetype_fwd *node);
-
- /// visit predefined type
virtual int visit_predefined_type (be_predefined_type *node);
-
- /// visit sequence type
virtual int visit_sequence (be_sequence *node);
-
- /// visit string type
virtual int visit_string (be_string *node);
-
- /// visit structure type
virtual int visit_structure (be_structure *node);
-
- /// visit typedefed type
+ virtual int visit_structure_fwd (be_structure_fwd *node);
virtual int visit_typedef (be_typedef *node);
-
- /// visit union type
virtual int visit_union (be_union *node);
+ virtual int visit_union_fwd (be_union_fwd *node);
};
#endif /* _BE_VISITOR_UNION_BRANCH_PUBLIC_CH_H_ */
diff --git a/TAO/tests/IDL_Test/included.idl b/TAO/tests/IDL_Test/included.idl
index 09bbab318ad..f10dd53a1a5 100644
--- a/TAO/tests/IDL_Test/included.idl
+++ b/TAO/tests/IDL_Test/included.idl
@@ -54,4 +54,21 @@ valuetype IncludedBase
public sequence<long> DeprecatedMember;
};
+// References to MyStructA in including.idl get the
+// forward declaration from lookup, and we were
+// getting empty typename generation in various places,
+// before overriding the visit methods for forward
+// declared structs and unions in the relevant visitors.
+module A
+{
+ struct MyStructA;
+ typedef sequence<MyStructA> MySeqA;
+
+ struct MyStructA
+ {
+ string str;
+ MySeqA recursive_member;
+ };
+};
+
#endif /* IDL_TEST_INCLUDED_IDL */
diff --git a/TAO/tests/IDL_Test/including.idl b/TAO/tests/IDL_Test/including.idl
index 431f8903c9c..5b0d601d69f 100644
--- a/TAO/tests/IDL_Test/including.idl
+++ b/TAO/tests/IDL_Test/including.idl
@@ -68,5 +68,36 @@ module VT_Test
typedef sequence<VT_Def::VT> VTSeq;
};
+// References to A::MyStructA from included.idl get the
+// forward declaration from lookup, and we were
+// getting empty typename generation in various places,
+// before overriding the visit methods for forward
+// declared structs and unions in the relevant visitors.
+module A
+{
+ const long smth = 6;
+};
+
+exception MyException
+{
+ A::MyStructA exField;
+};
+
+struct TestStr
+{
+ A::MyStructA field;
+};
+
+union TestUnion switch (long)
+{
+ case 0: A::MyStructA value1;
+ case 1: string value2;
+};
+
+interface MyInt
+{
+ A::MyStructA op (in A::MyStructA a);
+};
+
#endif /* IDL_TEST_INCLUDING_IDL */