summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLog13
-rw-r--r--TAO/TAO_IDL/ast/ast_visitor_reifying.cpp47
-rw-r--r--TAO/TAO_IDL/be/be_union.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp572
-rw-r--r--TAO/TAO_IDL/be_include/be_union.h3
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_xplicit_pre_proc.h8
-rw-r--r--TAO/TAO_IDL/include/ast_union.h5
7 files changed, 628 insertions, 26 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index e84f26c8ebf..00fdaa79d58 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,16 @@
+Mon Feb 8 23:23:48 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/include/ast_union.h:
+ * TAO_IDL/be/be_union.cpp:
+ * TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp:
+ * TAO_IDL/ast/ast_visitor_reifying.cpp:
+ * TAO_IDL/be_include/be_union.h:
+ * TAO_IDL/be_include/be_visitor_xplicit_pre_proc.h:
+
+ Added support for all legal home-scope declarations
+ in the generation of implied IDL for the explicit
+ home interface.
+
Mon Feb 8 17:16:31 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp:
diff --git a/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp b/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp
index a1fd0ababaa..ae2c7aaf16e 100644
--- a/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp
+++ b/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp
@@ -397,8 +397,7 @@ ast_visitor_reifying::visit_array (AST_Array *node)
}
}
- UTL_ScopedName sn (node->name ()->last_component ()->copy (),
- 0);
+ UTL_ScopedName sn (node->local_name (), 0);
AST_Array *arr =
idl_global->gen ()->create_array (&sn,
@@ -410,7 +409,6 @@ ast_visitor_reifying::visit_array (AST_Array *node)
// No need to add this new node to any scope - it's anonymous
// and owned by the node that references it.
- sn.destroy ();
v_list->destroy ();
delete v_list;
v_list = 0;
@@ -487,7 +485,48 @@ ast_visitor_reifying::visit_predefined_type (AST_PredefinedType *node)
int
ast_visitor_reifying::visit_string (AST_String *node)
{
- this->reified_node_ = node;
+ AST_Expression *b = node->max_size ();
+ AST_Param_Holder *ph = b->param_holder ();
+
+ if (ph != 0)
+ {
+ if (this->visit_param_holder (ph) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("ast_visitor_reifying::")
+ ACE_TEXT ("visit_string - ")
+ ACE_TEXT ("visit_param_holder() ")
+ ACE_TEXT ("failed\n")),
+ -1);
+ }
+
+ AST_Constant *c =
+ AST_Constant::narrow_from_decl (this->reified_node_);
+
+ b = c->constant_value ();
+ }
+ else if (b->ev ()->u.ulval == 0)
+ {
+ this->reified_node_ = node;
+ return 0;
+ }
+
+ AST_Expression *bound = 0;
+ ACE_NEW_RETURN (bound,
+ AST_Expression (b,
+ AST_Expression::EV_ulong),
+ -1);
+
+ Identifier id ("string");
+ UTL_ScopedName sn (&id, 0);
+
+ ACE_NEW_RETURN (this->reified_node_,
+ AST_String (AST_Decl::NT_string,
+ &sn,
+ bound,
+ node->width ()),
+ -1);
+
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp
index bf8d1b0a1fd..d2d69650042 100644
--- a/TAO/TAO_IDL/be/be_union.cpp
+++ b/TAO/TAO_IDL/be/be_union.cpp
@@ -274,6 +274,12 @@ be_union::gen_empty_default_label (void)
return true;
}
+AST_UnionBranch *
+be_union::be_add_union_branch (AST_UnionBranch *b)
+{
+ return this->fe_add_union_branch (b);
+}
+
ACE_UINT64
be_union::nlabels (void)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp
index 4e4892e2ea7..4c44788c03c 100644
--- a/TAO/TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp
@@ -20,10 +20,23 @@
#include "be_valuetype.h"
#include "be_typedef.h"
#include "be_predefined_type.h"
+#include "be_enum.h"
+#include "be_enum_val.h"
+#include "be_union.h"
+#include "be_union_fwd.h"
+#include "be_union_branch.h"
+#include "be_attribute.h"
+#include "be_constant.h"
+#include "be_array.h"
+#include "be_sequence.h"
+#include "be_string.h"
+#include "be_native.h"
#include "ast_module.h"
#include "utl_namelist.h"
+#include "utl_labellist.h"
+#include "utl_exprlist.h"
#include "fe_obv_header.h"
#include "nr_extern.h"
@@ -33,7 +46,8 @@ be_visitor_xplicit_pre_proc::be_visitor_xplicit_pre_proc (
be_visitor_context *ctx)
: be_visitor_ccm_pre_proc (ctx),
xplicit_ (0),
- type_holder_ (0)
+ type_holder_ (0),
+ ref_type_ (false)
{
}
@@ -150,11 +164,30 @@ int
be_visitor_xplicit_pre_proc::visit_argument (be_argument *node)
{
UTL_ScopedName sn (node->local_name (), 0);
+
+ this->ref_type_ = true;
+
+ be_type *ft =
+ be_type::narrow_from_decl (node->field_type ());
+
+ if (ft->accept (this) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_argument - code generation ")
+ ACE_TEXT ("for arg type failed\n")),
+ -1);
+ }
+
+ this->ref_type_ = false;
+
+ AST_Type *arg_type =
+ AST_Type::narrow_from_decl (this->type_holder_);
be_argument *added_arg = 0;
ACE_NEW_RETURN (added_arg,
be_argument (node->direction (),
- node->field_type (),
+ arg_type,
&sn),
-1);
@@ -232,26 +265,91 @@ be_visitor_xplicit_pre_proc::visit_finder (be_finder *node)
}
int
-be_visitor_xplicit_pre_proc::visit_valuebox (be_valuebox *)
+be_visitor_xplicit_pre_proc::visit_interface (be_interface *node)
+{
+ // Interface can't be declared inside a home, no need to call
+ // check_and_store().
+ this->type_holder_ = node;
+
+ return 0;
+}
+
+int
+be_visitor_xplicit_pre_proc::visit_valuebox (be_valuebox *node)
{
+ // Valuebox can't be declared inside a home, no need to call
+ // check_and_store().
+ this->type_holder_ = node;
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_valuetype (be_valuetype *)
+be_visitor_xplicit_pre_proc::visit_valuetype (be_valuetype *node)
{
+ // Valuetype can't be declared inside a home, no need to call
+ // check_and_store().
+ this->type_holder_ = node;
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_structure (be_structure *)
+be_visitor_xplicit_pre_proc::visit_structure (be_structure *node)
{
+ if (this->ref_type_)
+ {
+ this->check_and_store (node);
+ return 0;
+ }
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_structure *added_struct = 0;
+ ACE_NEW_RETURN (added_struct,
+ be_structure (&sn,
+ false,
+ false),
+ -1);
+
+ idl_global->scopes ().top ()->add_to_scope (added_struct);
+ idl_global->scopes ().push (added_struct);
+
+ if (this->visit_scope (node) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_structure - code generation ")
+ ACE_TEXT ("for scope failed\n")),
+ -1);
+ }
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_structure_fwd (be_structure_fwd *)
+be_visitor_xplicit_pre_proc::visit_structure_fwd (
+ be_structure_fwd *node)
{
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_structure *dummy = 0;
+ ACE_NEW_RETURN (dummy,
+ be_structure (&sn,
+ false,
+ false),
+ -1);
+
+ be_structure_fwd *added_struct_fwd = 0;
+ ACE_NEW_RETURN (added_struct_fwd,
+ be_structure_fwd (dummy,
+ &sn),
+ -1);
+
+ dummy->fwd_decl (added_struct_fwd);
+
+ idl_global->scopes ().top ()->add_to_scope (added_struct_fwd);
+
return 0;
}
@@ -285,19 +383,64 @@ be_visitor_xplicit_pre_proc::visit_exception (be_exception *node)
}
int
-be_visitor_xplicit_pre_proc::visit_enum (be_enum *)
+be_visitor_xplicit_pre_proc::visit_enum (be_enum *node)
{
+ if (this->ref_type_)
+ {
+ this->check_and_store (node);
+ return 0;
+ }
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_enum *added_enum = 0;
+ ACE_NEW_RETURN (added_enum,
+ be_enum (&sn,
+ false,
+ false),
+ -1);
+
+ idl_global->scopes ().top ()->add_to_scope (added_enum);
+ idl_global->scopes ().push (added_enum);
+
+ if (this->visit_scope (node) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_enum - code generation ")
+ ACE_TEXT ("for scope failed\n")),
+ -1);
+ }
+
return 0;
}
int
be_visitor_xplicit_pre_proc::visit_field (be_field *node)
{
+ this->ref_type_ = true;
+
+ be_type *ft =
+ be_type::narrow_from_decl (node->field_type ());
+
+ if (ft->accept (this) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_field - code generation ")
+ ACE_TEXT ("for field type failed\n")),
+ -1);
+ }
+
+ this->ref_type_ = false;
+
UTL_ScopedName sn (node->local_name (), 0);
+ AST_Type *field_type =
+ AST_Type::narrow_from_decl (this->type_holder_);
be_field *added_field = 0;
ACE_NEW_RETURN (added_field,
- be_field (node->field_type (),
+ be_field (field_type,
&sn,
node->visibility ()),
-1);
@@ -308,26 +451,163 @@ be_visitor_xplicit_pre_proc::visit_field (be_field *node)
}
int
-be_visitor_xplicit_pre_proc::visit_attribute (be_attribute *)
+be_visitor_xplicit_pre_proc::visit_attribute (be_attribute *node)
{
+ be_type *ft =
+ be_type::narrow_from_decl (node->field_type ());
+
+ this->ref_type_ = true;
+
+ if (ft->accept (this) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_attribute - code generation ")
+ ACE_TEXT ("for attribute type failed\n")),
+ -1);
+ }
+
+ this->ref_type_ = false;
+
+ AST_Type *attr_type =
+ AST_Type::narrow_from_decl (this->type_holder_);
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_attribute *added_attr = 0;
+ ACE_NEW_RETURN (added_attr,
+ be_attribute (node->readonly (),
+ attr_type,
+ &sn,
+ false,
+ false),
+ -1);
+
+ idl_global->scopes ().top ()->add_to_scope (added_attr);
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_union (be_union *)
+be_visitor_xplicit_pre_proc::visit_union (be_union *node)
{
+ if (this->ref_type_)
+ {
+ this->check_and_store (node);
+ return 0;
+ }
+
+ be_type *ud =
+ be_type::narrow_from_decl (node->disc_type ());
+
+ this->ref_type_ = true;
+
+ if (ud->accept (this) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_union - code generation ")
+ ACE_TEXT ("for discriminator type failed\n")),
+ -1);
+ }
+
+ this->ref_type_ = false;
+
+ AST_ConcreteType *disc =
+ AST_ConcreteType::narrow_from_decl (this->type_holder_);
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_union *added_union = 0;
+ ACE_NEW_RETURN (added_union,
+ be_union (disc,
+ &sn,
+ false,
+ false),
+ -1);
+
+ idl_global->scopes ().top ()->add_to_scope (added_union);
+ idl_global->scopes ().push (added_union);
+
+ if (this->visit_scope (node) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_union - code generation ")
+ ACE_TEXT ("for scope failed\n")),
+ -1);
+ }
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_union_fwd (be_union_fwd *)
+be_visitor_xplicit_pre_proc::visit_union_fwd (be_union_fwd *node)
{
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_union *dummy = 0;
+ ACE_NEW_RETURN (dummy,
+ be_union (0,
+ &sn,
+ false,
+ false),
+ -1);
+
+ be_union_fwd *added_union_fwd = 0;
+ ACE_NEW_RETURN (added_union_fwd,
+ be_union_fwd (dummy,
+ &sn),
+ -1);
+
+ dummy->fwd_decl (added_union_fwd);
+
+ idl_global->scopes ().top ()->add_to_scope (added_union_fwd);
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_union_branch (be_union_branch *)
+be_visitor_xplicit_pre_proc::visit_union_branch (
+ be_union_branch *node)
{
+ be_type *ft =
+ be_type::narrow_from_decl (node->field_type ());
+
+ this->ref_type_ = true;
+
+ if (ft->accept (this) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_union_branch - code generation ")
+ ACE_TEXT ("for branch type failed\n")),
+ -1);
+ }
+
+ this->ref_type_ = false;
+
+ AST_Type *bt =
+ AST_Type::narrow_from_decl (this->type_holder_);
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ // The union branch owns its label list so we have to copy it.
+ UTL_LabelList *ll = node->labels ()->copy ();
+
+ be_union_branch *added_branch = 0;
+ ACE_NEW_RETURN (added_branch,
+ be_union_branch (ll, bt, &sn),
+ -1);
+
+ // fe_add_union_branch() does necessary things besides calling
+ // add_to_scope() so we need to reuse it.
+
+ be_union *u =
+ be_union::narrow_from_scope (idl_global->scopes ().top ());
+
+ u->be_add_union_branch (added_branch);
+
return 0;
}
@@ -338,41 +618,227 @@ be_visitor_xplicit_pre_proc::visit_union_label (be_union_label *)
}
int
-be_visitor_xplicit_pre_proc::visit_constant (be_constant *)
+be_visitor_xplicit_pre_proc::visit_constant (be_constant *node)
{
+ if (this->ref_type_)
+ {
+ this->check_and_store (node);
+ return 0;
+ }
+
+ AST_Expression *new_v = 0;
+ ACE_NEW_RETURN (new_v,
+ AST_Expression (node->constant_value (),
+ node->et ()),
+ -1);
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_constant *added_const = 0;
+ ACE_NEW_RETURN (added_const,
+ be_constant (node->et (),
+ new_v,
+ &sn),
+ -1);
+
+ idl_global->scopes ().top ()->add_to_scope (added_const);
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_enum_val (be_enum_val *)
+be_visitor_xplicit_pre_proc::visit_enum_val (be_enum_val *node)
{
+ if (this->ref_type_)
+ {
+ this->type_holder_ = node;
+ return 0;
+ }
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_enum_val *added_enum_val = 0;
+ ACE_NEW_RETURN (added_enum_val,
+ be_enum_val (node->constant_value ()->ev ()->u.ulval,
+ &sn),
+ -1);
+
+ idl_global->scopes ().top ()->add_to_scope (added_enum_val);
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_array (be_array *)
+be_visitor_xplicit_pre_proc::visit_array (be_array *node)
{
+ be_type *bt =
+ be_type::narrow_from_decl (node->base_type ());
+
+ bool tmp = this->ref_type_;
+ this->ref_type_ = true;
+
+ if (bt->accept (this) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_array - code generation ")
+ ACE_TEXT ("for base type failed\n")),
+ -1);
+ }
+
+ this->ref_type_ = tmp;
+
+ AST_Expression *v = 0;
+ UTL_ExprList *v_list = 0;
+
+ for (ACE_CDR::ULong i = 0; i < node->n_dims (); ++i)
+ {
+ ACE_NEW_RETURN (v,
+ AST_Expression (node->dims ()[i],
+ AST_Expression::EV_ulong),
+ -1);
+
+ UTL_ExprList *el = 0;
+ ACE_NEW_RETURN (el,
+ UTL_ExprList (v, 0),
+ -1);
+
+ if (v_list == 0)
+ {
+ v_list = el;
+ }
+ else
+ {
+ v_list->nconc (el);
+ }
+ }
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_array *added_array = 0;
+ ACE_NEW_RETURN (added_array,
+ be_array (&sn,
+ node->n_dims (),
+ v_list,
+ false,
+ false),
+ -1);
+
+ // No need to add this new node to any scope - it's anonymous
+ // and owned by the node that references it.
+
+ v_list->destroy ();
+ delete v_list;
+ v_list = 0;
+
+ AST_Type *base_type =
+ AST_Type::narrow_from_decl (this->type_holder_);
+
+ added_array->set_base_type (base_type);
+
+ this->type_holder_ = added_array;
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_sequence (be_sequence *)
+be_visitor_xplicit_pre_proc::visit_sequence (be_sequence *node)
{
+ be_type *bt =
+ be_type::narrow_from_decl (node->base_type ());
+
+ bool tmp = this->ref_type_;
+ this->ref_type_ = true;
+
+ if (bt->accept (this) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("be_visitor_xplicit_pre_proc::")
+ ACE_TEXT ("visit_sequence - code generation ")
+ ACE_TEXT ("for element type failed\n")),
+ -1);
+ }
+
+ this->ref_type_ = tmp;
+
+ AST_Expression *v = node->max_size ();
+
+ AST_Expression *bound = 0;
+ ACE_NEW_RETURN (bound,
+ AST_Expression (v,
+ AST_Expression::EV_ulong),
+ -1);
+
+ Identifier id ("sequence");
+ UTL_ScopedName sn (&id, 0);
+
+ AST_Type *ft =
+ AST_Type::narrow_from_decl (this->type_holder_);
+
+ ACE_NEW_RETURN (this->type_holder_,
+ be_sequence (bound,
+ ft,
+ &sn,
+ false,
+ false),
+ -1);
+
+ // No need to add this new node to any scope - it's anonymous
+ // and owned by the node that references it.
+
return 0;
}
int
-be_visitor_xplicit_pre_proc::visit_string (be_string *)
+be_visitor_xplicit_pre_proc::visit_string (be_string *node)
{
+ if (this->ref_type_)
+ {
+ this->check_and_store (node);
+ return 0;
+ }
+
+ AST_Expression *b = node->max_size ();
+
+ if (b->ev ()->u.ulval == 0)
+ {
+ this->type_holder_ = node;
+ return 0;
+ }
+
+ AST_Expression *bound = 0;
+ ACE_NEW_RETURN (bound,
+ AST_Expression (b,
+ AST_Expression::EV_ulong),
+ -1);
+
+ Identifier id ("string");
+ UTL_ScopedName sn (&id, 0);
+
+ ACE_NEW_RETURN (this->type_holder_,
+ be_string (AST_Decl::NT_string,
+ &sn,
+ bound,
+ node->width ()),
+ -1);
+
return 0;
}
int
be_visitor_xplicit_pre_proc::visit_typedef (be_typedef *node)
{
+ if (this->ref_type_)
+ {
+ this->check_and_store (node);
+ return 0;
+ }
+
be_type *t =
be_type::narrow_from_decl (node->field_type ());
+ this->ref_type_ = true;
+
if (t->accept (this) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -382,11 +848,15 @@ be_visitor_xplicit_pre_proc::visit_typedef (be_typedef *node)
-1);
}
+ this->ref_type_ = false;
+
UTL_ScopedName sn (node->local_name (), 0);
+ AST_Type *bt =
+ AST_Type::narrow_from_decl (this->type_holder_);
be_typedef *added_typedef = 0;
ACE_NEW_RETURN (added_typedef,
- be_typedef (this->type_holder_,
+ be_typedef (bt,
&sn,
false,
false),
@@ -398,8 +868,23 @@ be_visitor_xplicit_pre_proc::visit_typedef (be_typedef *node)
}
int
-be_visitor_xplicit_pre_proc::visit_native (be_native *)
+be_visitor_xplicit_pre_proc::visit_native (be_native *node)
{
+ if (this->ref_type_)
+ {
+ this->check_and_store (node);
+ return 0;
+ }
+
+ UTL_ScopedName sn (node->local_name (), 0);
+
+ be_native *added_native = 0;
+ ACE_NEW_RETURN (added_native,
+ be_native (&sn),
+ -1);
+
+ idl_global->scopes ().top ()->add_to_scope (added_native);
+
return 0;
}
@@ -418,3 +903,52 @@ be_visitor_xplicit_pre_proc::xplicit (void) const
return this->xplicit_;
}
+void
+be_visitor_xplicit_pre_proc::check_and_store (AST_Decl *node)
+{
+ UTL_ScopedName *tmpl_tail =
+ this->xplicit_iface_rel_name (node);
+
+ if (tmpl_tail != 0)
+ {
+ AST_Decl *d =
+ idl_global->scopes ().top ()->lookup_by_name (
+ tmpl_tail,
+ true);
+
+ this->type_holder_ = d;
+
+ tmpl_tail->destroy ();
+ delete tmpl_tail;
+ tmpl_tail = 0;
+ }
+ else
+ {
+ this->type_holder_ = node;
+ }
+}
+
+UTL_ScopedName *
+be_visitor_xplicit_pre_proc::xplicit_iface_rel_name (AST_Decl *d)
+{
+ AST_Decl *tmp = d;
+ ACE_CString name (d->full_name ());
+
+ while (tmp != 0)
+ {
+ if (be_home::narrow_from_decl (tmp) != 0)
+ {
+ ACE_CString head (tmp->local_name ()->get_string ());
+
+ ACE_CString::size_type start = name.find (head) + 2;
+
+ ACE_CString tail (name.substr (start + head.length ()));
+
+ return idl_global->string_to_scoped_name (tail.c_str ());
+ }
+
+ tmp = ScopeAsDecl (tmp->defined_in ());
+ }
+
+ return 0;
+} \ No newline at end of file
diff --git a/TAO/TAO_IDL/be_include/be_union.h b/TAO/TAO_IDL/be_include/be_union.h
index d9154f75fa4..dba4076268d 100644
--- a/TAO/TAO_IDL/be_include/be_union.h
+++ b/TAO/TAO_IDL/be_include/be_union.h
@@ -57,6 +57,9 @@ public:
/// constructor, assignment operator, etc. is needed.
bool gen_empty_default_label (void);
+ /// Just a way to get at fe_add_union_branch() from the backend.
+ AST_UnionBranch *be_add_union_branch (AST_UnionBranch *b);
+
/// Returns total number of labels, useful when the union has
/// multiple case labels.
ACE_UINT64 nlabels (void);
diff --git a/TAO/TAO_IDL/be_include/be_visitor_xplicit_pre_proc.h b/TAO/TAO_IDL/be_include/be_visitor_xplicit_pre_proc.h
index fc67af2d42b..1d18a7e0741 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_xplicit_pre_proc.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_xplicit_pre_proc.h
@@ -40,6 +40,7 @@ public:
virtual int visit_factory (be_factory *node);
virtual int visit_finder (be_finder *node);
+ virtual int visit_interface (be_interface *node);
virtual int visit_valuebox (be_valuebox *node);
virtual int visit_valuetype (be_valuetype *node);
virtual int visit_structure (be_structure *node);
@@ -65,8 +66,13 @@ public:
be_interface *xplicit (void) const;
private:
+ void check_and_store (AST_Decl *node);
+ UTL_ScopedName *xplicit_iface_rel_name (AST_Decl *d);
+
+private:
be_interface *xplicit_;
- be_type *type_holder_;
+ AST_Decl *type_holder_;
+ bool ref_type_;
};
#endif // TAO_BE_VISITOR_XPLICIT_PRE_PROC_H
diff --git a/TAO/TAO_IDL/include/ast_union.h b/TAO/TAO_IDL/include/ast_union.h
index ca030315a1f..c38a01df8ff 100644
--- a/TAO/TAO_IDL/include/ast_union.h
+++ b/TAO/TAO_IDL/include/ast_union.h
@@ -148,6 +148,9 @@ protected:
virtual int compute_size_type (void);
// Compute the size type if it is unknown.
+ virtual AST_UnionBranch *fe_add_union_branch (AST_UnionBranch *b);
+ // Moved out of private section so it can be called from subclass.
+
private:
// Data.
@@ -181,8 +184,6 @@ private:
virtual AST_Union *fe_add_union (AST_Union *u);
- virtual AST_UnionBranch *fe_add_union_branch (AST_UnionBranch *b);
-
virtual AST_Structure *fe_add_structure (AST_Structure *s);
virtual AST_Enum *fe_add_enum (AST_Enum *e);