summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-16 20:21:05 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-16 20:21:05 +0000
commit81f485dded8fb51eb9e7a153b1950feca96951a1 (patch)
tree3840c5233a9144d0d284dc355787c0cdd841a2a6
parent0a058b16d4c82e429f2ab43c1597574771687e7e (diff)
downloadATCD-81f485dded8fb51eb9e7a153b1950feca96951a1.tar.gz
ChangeLogTag: Wed Dec 16 20:20:13 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--modules/TAO/ChangeLog58
-rw-r--r--modules/TAO/TAO_IDL/ast/ast_component.cpp25
-rw-r--r--modules/TAO/TAO_IDL/ast/ast_eventtype.cpp12
-rw-r--r--modules/TAO/TAO_IDL/ast/ast_generator.cpp24
-rw-r--r--modules/TAO/TAO_IDL/ast/ast_home.cpp54
-rw-r--r--modules/TAO/TAO_IDL/ast/ast_interface.cpp306
-rw-r--r--modules/TAO/TAO_IDL/ast/ast_valuetype.cpp61
-rw-r--r--modules/TAO/TAO_IDL/be/be_component.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_eventtype.cpp8
-rw-r--r--modules/TAO/TAO_IDL/be/be_generator.cpp24
-rw-r--r--modules/TAO/TAO_IDL/be/be_home.cpp4
-rw-r--r--modules/TAO/TAO_IDL/be/be_interface.cpp15
-rw-r--r--modules/TAO/TAO_IDL/be/be_valuetype.cpp40
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp15
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp8
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp4
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp10
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp4
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_component.h2
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_eventtype.h8
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_generator.h24
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_home.h4
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_interface.h2
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_valuetype.h8
-rw-r--r--modules/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h6
-rw-r--r--modules/TAO/TAO_IDL/fe/fe_component_header.cpp36
-rw-r--r--modules/TAO/TAO_IDL/fe/fe_home_header.cpp2
-rw-r--r--modules/TAO/TAO_IDL/fe/fe_interface_header.cpp2
-rw-r--r--modules/TAO/TAO_IDL/fe/fe_obv_header.cpp2
-rw-r--r--modules/TAO/TAO_IDL/include/ast_component.h4
-rw-r--r--modules/TAO/TAO_IDL/include/ast_eventtype.h8
-rw-r--r--modules/TAO/TAO_IDL/include/ast_generator.h24
-rw-r--r--modules/TAO/TAO_IDL/include/ast_home.h11
-rw-r--r--modules/TAO/TAO_IDL/include/ast_interface.h19
-rw-r--r--modules/TAO/TAO_IDL/include/ast_valuetype.h20
-rw-r--r--modules/TAO/TAO_IDL/narrow/narrow.cpp3
-rw-r--r--modules/TAO/TAO_IDL/util/utl_scope.cpp3
47 files changed, 547 insertions, 335 deletions
diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog
index 89bd022c31c..d466cad0cef 100644
--- a/modules/TAO/ChangeLog
+++ b/modules/TAO/ChangeLog
@@ -1,3 +1,61 @@
+Wed Dec 16 20:20:13 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/include/ast_generator.h:
+ * TAO_IDL/include/ast_valuetype.h:
+ * TAO_IDL/include/ast_eventtype.h:
+ * TAO_IDL/include/ast_home.h:
+ * TAO_IDL/include/ast_interface.h:
+ * TAO_IDL/include/ast_component.h:
+ * TAO_IDL/be/be_visitor_typecode/value_typecode.cpp:
+ * TAO_IDL/be/be_valuetype.cpp:
+ * TAO_IDL/be/be_visitor_home/home_ex_idl.cpp:
+ * TAO_IDL/be/be_visitor_interface/interface_sh.cpp:
+ * TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp:
+ * TAO_IDL/be/be_visitor_ami_pre_proc.cpp:
+ * TAO_IDL/be/be_home.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/valuetype.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp:
+ * TAO_IDL/be/be_component.cpp:
+ * TAO_IDL/be/be_visitor_amh_pre_proc.cpp:
+ * TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp:
+ * TAO_IDL/be/be_visitor_component/component_sh.cpp:
+ * TAO_IDL/be/be_eventtype.cpp:
+ * TAO_IDL/be/be_interface.cpp:
+ * TAO_IDL/be/be_visitor_ccm_pre_proc.cpp:
+ * TAO_IDL/be/be_generator.cpp:
+ * TAO_IDL/ast/ast_home.cpp:
+ * TAO_IDL/ast/ast_interface.cpp:
+ * TAO_IDL/ast/ast_component.cpp:
+ * TAO_IDL/ast/ast_generator.cpp:
+ * TAO_IDL/ast/ast_valuetype.cpp:
+ * TAO_IDL/ast/ast_eventtype.cpp:
+ * TAO_IDL/be_include/be_interface.h:
+ * TAO_IDL/be_include/be_component.h:
+ * TAO_IDL/be_include/be_eventtype.h:
+ * TAO_IDL/be_include/be_home.h:
+ * TAO_IDL/be_include/be_generator.h:
+ * TAO_IDL/be_include/be_valuetype.h:
+ * TAO_IDL/be_include/be_visitor_ami_pre_proc.h:
+ * TAO_IDL/fe/fe_obv_header.cpp:
+ * TAO_IDL/fe/fe_home_header.cpp:
+ * TAO_IDL/fe/fe_interface_header.cpp:
+ * TAO_IDL/fe/fe_component_header.cpp:
+ * TAO_IDL/narrow/narrow.cpp:
+ * TAO_IDL/util/utl_scope.cpp:
+
+ Changes to support template parameters as base
+ interfaces/valuetypes, supported interfaces,
+ primary keys, and members of a throw spec list.
+ Several internal container types were widened to AST_Type
+ from whatever they were originally, to enable
+ them to also contain AST_Param_Holder. This
+ change precipitated many small mods, to the
+ backend as well as the frontend.
+
Tue Dec 15 20:34:51 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/include/utl_exceptlist.h:
diff --git a/modules/TAO/TAO_IDL/ast/ast_component.cpp b/modules/TAO/TAO_IDL/ast/ast_component.cpp
index 13a33c96582..d28cec2e76b 100644
--- a/modules/TAO/TAO_IDL/ast/ast_component.cpp
+++ b/modules/TAO/TAO_IDL/ast/ast_component.cpp
@@ -14,10 +14,6 @@
#include "utl_err.h"
#include "global_extern.h"
-ACE_RCSID (ast,
- ast_component,
- "$Id$")
-
AST_Component::AST_Component (void)
: COMMON_Base (),
AST_Decl (),
@@ -30,7 +26,7 @@ AST_Component::AST_Component (void)
AST_Component::AST_Component (UTL_ScopedName *n,
AST_Component *base_component,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat)
@@ -98,7 +94,7 @@ AST_Component::look_in_supported (UTL_ScopedName *e,
bool treat_as_ref)
{
AST_Decl *d = 0;
- AST_Interface **is = 0;
+ AST_Type **is = 0;
long nis = -1;
// Can't look in an interface which was not yet defined.
@@ -118,9 +114,18 @@ AST_Component::look_in_supported (UTL_ScopedName *e,
nis > 0;
nis--, is++)
{
- d = (*is)->lookup_by_name (e,
- treat_as_ref,
- 0 /* not in parent */);
+ if ((*is)->node_type () == AST_Decl::NT_param_holder)
+ {
+ continue;
+ }
+
+ AST_Interface *i =
+ AST_Interface::narrow_from_decl (*is);
+
+ d = (i)->lookup_by_name (e,
+ treat_as_ref,
+ 0 /* not in parent */);
+
if (d != 0)
{
break;
@@ -136,7 +141,7 @@ AST_Component::base_component (void) const
return this->pd_base_component;
}
-AST_Interface **
+AST_Type **
AST_Component::supports (void) const
{
return this->inherits ();
diff --git a/modules/TAO/TAO_IDL/ast/ast_eventtype.cpp b/modules/TAO/TAO_IDL/ast/ast_eventtype.cpp
index 642570fde5c..5a3fce42284 100644
--- a/modules/TAO/TAO_IDL/ast/ast_eventtype.cpp
+++ b/modules/TAO/TAO_IDL/ast/ast_eventtype.cpp
@@ -7,10 +7,6 @@
#include "utl_indenter.h"
#include "global_extern.h"
-ACE_RCSID (ast,
- ast_eventtype,
- "$Id$")
-
AST_EventType::AST_EventType (void)
: COMMON_Base (),
AST_Decl (),
@@ -22,14 +18,14 @@ AST_EventType::AST_EventType (void)
}
AST_EventType::AST_EventType (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool abstract,
bool truncatable,
bool custom)
diff --git a/modules/TAO/TAO_IDL/ast/ast_generator.cpp b/modules/TAO/TAO_IDL/ast/ast_generator.cpp
index 6aef739eea0..87083dc4c08 100644
--- a/modules/TAO/TAO_IDL/ast/ast_generator.cpp
+++ b/modules/TAO/TAO_IDL/ast/ast_generator.cpp
@@ -208,7 +208,7 @@ AST_Generator::create_root (UTL_ScopedName *n)
AST_Interface *
AST_Generator::create_interface (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
AST_Interface **inherits_flat,
long n_inherits_flat,
@@ -254,14 +254,14 @@ AST_Generator::create_interface_fwd (UTL_ScopedName *n,
AST_ValueType *
AST_Generator::create_valuetype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool is_abstract,
bool is_truncatable,
bool is_custom)
@@ -322,14 +322,14 @@ AST_Generator::create_valuetype_fwd (UTL_ScopedName *n,
AST_EventType *
AST_Generator::create_eventtype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool is_abstract,
bool is_truncatable,
bool is_custom)
@@ -391,7 +391,7 @@ AST_Generator::create_eventtype_fwd (UTL_ScopedName *n,
AST_Component *
AST_Generator::create_component (UTL_ScopedName *n,
AST_Component *base_component,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat)
@@ -433,8 +433,8 @@ AST_Home *
AST_Generator::create_home (UTL_ScopedName *n,
AST_Home *base_home,
AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports_list,
+ AST_Type *primary_key,
+ AST_Type **supports_list,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat)
diff --git a/modules/TAO/TAO_IDL/ast/ast_home.cpp b/modules/TAO/TAO_IDL/ast/ast_home.cpp
index 55fa4e47320..95d39563949 100644
--- a/modules/TAO/TAO_IDL/ast/ast_home.cpp
+++ b/modules/TAO/TAO_IDL/ast/ast_home.cpp
@@ -3,17 +3,15 @@
#include "ast_home.h"
#include "ast_component.h"
#include "ast_valuetype.h"
+#include "ast_param_holder.h"
#include "ast_operation.h"
#include "ast_visitor.h"
+
#include "utl_identifier.h"
#include "utl_indenter.h"
#include "utl_err.h"
#include "global_extern.h"
-ACE_RCSID (ast,
- ast_home,
- "$Id$")
-
AST_Home::AST_Home (void)
: COMMON_Base (),
AST_Decl (),
@@ -29,8 +27,8 @@ AST_Home::AST_Home (void)
AST_Home::AST_Home (UTL_ScopedName *n,
AST_Home *base_home,
AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports,
+ AST_Type *primary_key,
+ AST_Type **supports,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat)
@@ -50,11 +48,20 @@ AST_Home::AST_Home (UTL_ScopedName *n,
false),
pd_base_home (base_home),
pd_managed_component (managed_component),
- pd_primary_key (primary_key)
+ pd_primary_key (primary_key),
+ owns_primary_key_ (false)
{
- if (primary_key != 0)
+ AST_ValueType *pk =
+ AST_ValueType::narrow_from_decl (primary_key);
+
+ if (pk != 0)
{
- idl_global->primary_keys ().enqueue_tail (primary_key);
+ idl_global->primary_keys ().enqueue_tail (pk);
+ }
+ else if (primary_key != 0)
+ {
+ // If we are here, it's a param holder and we must destroy it.
+ this->owns_primary_key_ = true;
}
}
@@ -82,7 +89,7 @@ AST_Home::look_in_supported (UTL_ScopedName *e,
bool treat_as_ref)
{
AST_Decl *d = 0;
- AST_Interface **is = 0;
+ AST_Type **is = 0;
long nis = -1;
// Can't look in an interface which was not yet defined.
@@ -102,9 +109,18 @@ AST_Home::look_in_supported (UTL_ScopedName *e,
nis > 0;
nis--, is++)
{
- d = (*is)->lookup_by_name (e,
- treat_as_ref,
- 0 /* not in parent */);
+ if ((*is)->node_type () == AST_Decl::NT_param_holder)
+ {
+ continue;
+ }
+
+ AST_Interface *i =
+ AST_Interface::narrow_from_decl (*is);
+
+ d = (i)->lookup_by_name (e,
+ treat_as_ref,
+ 0 /* not in parent */);
+
if (d != 0)
{
break;
@@ -123,7 +139,7 @@ AST_Home::base_home (void) const
// These next two look ugly, but it is to keep from having to
// create separate visitors for homes in the back end.
-AST_Interface **
+AST_Type **
AST_Home::supports (void) const
{
return
@@ -144,7 +160,7 @@ AST_Home::managed_component (void) const
return this->pd_managed_component;
}
-AST_ValueType *
+AST_Type *
AST_Home::primary_key (void) const
{
return this->pd_primary_key;
@@ -165,6 +181,14 @@ AST_Home::finders (void)
void
AST_Home::destroy (void)
{
+ // If it's a param holder, it was created on the fly.
+ if (owns_primary_key_)
+ {
+ this->pd_primary_key->destroy ();
+ delete this->pd_primary_key;
+ this->pd_primary_key = 0;
+ }
+
// We have to go through these conniptions to destroy
// a home because its decls (for which there are no
// copy constructors) are assigned to the scope
diff --git a/modules/TAO/TAO_IDL/ast/ast_interface.cpp b/modules/TAO/TAO_IDL/ast/ast_interface.cpp
index f3c9cfd7ff3..dc9392558c9 100644
--- a/modules/TAO/TAO_IDL/ast/ast_interface.cpp
+++ b/modules/TAO/TAO_IDL/ast/ast_interface.cpp
@@ -117,7 +117,7 @@ AST_Interface::AST_Interface (void)
}
AST_Interface::AST_Interface (UTL_ScopedName *n,
- AST_Interface **ih,
+ AST_Type **ih,
long nih,
AST_Interface **ih_flat,
long nih_flat,
@@ -139,6 +139,17 @@ AST_Interface::AST_Interface (UTL_ScopedName *n,
{
this->size_type (AST_Type::VARIABLE); // always the case
this->has_constructor (true); // always the case
+
+ // Enqueue the param holders (if any) for later destruction.
+ // By the time our destroy() is called, it will be too late
+ // to iterate over pd_inherits.
+ for (long i = 0; i < nih; ++i)
+ {
+ if (ih[i]->node_type () == AST_Decl::NT_param_holder)
+ {
+ this->param_holders_.enqueue_tail (ih[i]);
+ }
+ }
}
AST_Interface::~AST_Interface (void)
@@ -1182,44 +1193,50 @@ AST_Interface::fwd_redefinition_helper (AST_Interface *&i,
}
void
-AST_Interface::redef_clash_populate_r (AST_Interface *t)
+AST_Interface::redef_clash_populate_r (AST_Type *t)
{
if (this->insert_non_dup (t, 0) == 0)
{
return;
}
- AST_Interface **parents = t->inherits ();
- long n_parents = t->n_inherits ();
- long i;
-
- for (i = 0; i < n_parents; ++i)
+ AST_Decl::NodeType nt = t->node_type ();
+ long n = 0;
+
+ if (nt != AST_Decl::NT_param_holder)
{
- this->redef_clash_populate_r (parents[i]);
- }
+ AST_Interface *i =
+ AST_Interface::narrow_from_decl (t);
+
+ AST_Type **parents = i->inherits ();
+ long n_parents = i->n_inherits ();
- AST_Decl::NodeType nt = t->node_type ();
+ for (n = 0; n < n_parents; ++n)
+ {
+ this->redef_clash_populate_r (parents[n]);
+ }
+ }
if (nt == AST_Decl::NT_valuetype || nt == AST_Decl::NT_eventtype)
{
AST_ValueType *v = AST_ValueType::narrow_from_decl (t);
- AST_Interface **supports = v->supports ();
+ AST_Type **supports = v->supports ();
long n_supports = v->n_supports ();
- for (i = 0; i < n_supports; ++i)
+ for (n = 0; n < n_supports; ++n)
{
- this->redef_clash_populate_r (supports[i]);
+ this->redef_clash_populate_r (supports[n]);
}
}
else if (nt == AST_Decl::NT_component)
{
AST_Component *c = AST_Component::narrow_from_decl (t);
- AST_Interface **supports = c->supports ();
+ AST_Type **supports = c->supports ();
long n_supports = c->n_supports ();
- for (i = 0; i < n_supports; ++i)
+ for (n = 0; n < n_supports; ++n)
{
- this->redef_clash_populate_r (supports[i]);
+ this->redef_clash_populate_r (supports[n]);
}
}
}
@@ -1249,37 +1266,45 @@ AST_Interface::fwd_decl (AST_InterfaceFwd *node)
}
int
-AST_Interface::insert_non_dup (AST_Interface *t,
+AST_Interface::insert_non_dup (AST_Type *t,
bool abstract_paths_only)
{
+ AST_Interface *f =
+ AST_Interface::narrow_from_decl (t);
+
// Now check if the dequeued element has any ancestors. If yes, insert
// them inside the queue making sure that there are no duplicates.
// If we are doing a component, the inheritance list is actually a
// supports list.
- for (long i = 0; i < t->n_inherits (); ++i)
+ if (f != 0)
{
- // Retrieve the next parent from which the dequeued element inherits.
- AST_Interface *parent = t->inherits ()[i];
-
- if (abstract_paths_only && ! parent->is_abstract ())
+ for (long i = 0; i < f->n_inherits (); ++i)
{
- continue;
- }
+ // Retrieve the next parent from which
+ // the dequeued element inherits.
+ AST_Type *parent = f->inherits ()[i];
- (void) this->insert_non_dup (parent, abstract_paths_only);
- } // end of for loop
+ if (abstract_paths_only && ! parent->is_abstract ())
+ {
+ continue;
+ }
+
+ (void) this->insert_non_dup (parent,
+ abstract_paths_only);
+ }
+ }
const char *full_name = t->full_name ();
// Initialize an iterator to search the queue for duplicates.
- for (ACE_Unbounded_Queue_Iterator<AST_Interface *> q_iter (
+ for (ACE_Unbounded_Queue_Iterator<AST_Type *> q_iter (
this->insert_queue
);
!q_iter.done ();
(void) q_iter.advance ())
{
// Queue element.
- AST_Interface **temp = 0;
+ AST_Type **temp = 0;
(void) q_iter.next (temp);
@@ -1292,14 +1317,14 @@ AST_Interface::insert_non_dup (AST_Interface *t,
}
// Initialize an iterator to search the del_queue for duplicates.
- for (ACE_Unbounded_Queue_Iterator<AST_Interface *> del_q_iter (
+ for (ACE_Unbounded_Queue_Iterator<AST_Type *> del_q_iter (
this->del_queue
);
!del_q_iter.done ();
(void) del_q_iter.advance ())
{
// Queue element.
- AST_Interface **temp = 0;
+ AST_Type **temp = 0;
(void) del_q_iter.next (temp);
@@ -1339,7 +1364,7 @@ AST_Interface::redefine (AST_Interface *from)
unsigned long array_size =
static_cast<unsigned long> (from->pd_n_inherits);
ACE_NEW (this->pd_inherits,
- AST_Interface *[array_size]);
+ AST_Type *[array_size]);
for (i = 0; i < array_size; ++i)
{
@@ -1372,7 +1397,7 @@ AST_Interface::redefine (AST_Interface *from)
// Data accessors.
-AST_Interface **
+AST_Type **
AST_Interface::inherits (void) const
{
return this->pd_inherits;
@@ -1396,13 +1421,13 @@ AST_Interface::n_inherits_flat (void) const
return pd_n_inherits_flat;
}
-ACE_Unbounded_Queue<AST_Interface *> &
+ACE_Unbounded_Queue<AST_Type *> &
AST_Interface::get_insert_queue (void)
{
return this->insert_queue;
}
-ACE_Unbounded_Queue<AST_Interface *> &
+ACE_Unbounded_Queue<AST_Type *> &
AST_Interface::get_del_queue (void)
{
return this->del_queue;
@@ -1414,15 +1439,15 @@ AST_Interface::redef_clash (void)
this->insert_queue.reset ();
this->redef_clash_populate_r (this);
- AST_Interface **group1_member = 0;
- AST_Interface **group2_member = 0;
+ AST_Type **group1_member = 0;
+ AST_Type **group2_member = 0;
AST_Decl *group1_member_item = 0;
AST_Decl *group2_member_item = 0;
int i = 1;
// Now compare all pairs.
- for (ACE_Unbounded_Queue_Iterator<AST_Interface *> group1_iter (
+ for (ACE_Unbounded_Queue_Iterator<AST_Type *> group1_iter (
this->insert_queue
);
!group1_iter.done ();
@@ -1430,102 +1455,113 @@ AST_Interface::redef_clash (void)
{
// Queue element.
(void) group1_iter.next (group1_member);
+ UTL_Scope *s = DeclAsScope (*group1_member);
- for (UTL_ScopeActiveIterator group1_member_items (
- DeclAsScope (*group1_member),
- UTL_Scope::IK_decls
- );
- !group1_member_items.is_done ();
- group1_member_items.next ())
+ if (s != 0)
{
- group1_member_item = group1_member_items.item ();
- AST_Decl::NodeType nt1 = group1_member_item->node_type ();
-
- // Only these member types may cause a clash because
- // they can't be redefined.
- if (nt1 != AST_Decl::NT_op && nt1 != AST_Decl::NT_attr)
- {
- continue;
- }
-
- Identifier *pid1 = group1_member_item->local_name ();
- int j = 0;
-
- for (ACE_Unbounded_Queue_Iterator<AST_Interface *> group2_iter (
- this->insert_queue
- );
- !group2_iter.done ();
- (void) group2_iter.advance ())
+ for (UTL_ScopeActiveIterator group1_member_items (
+ s,
+ UTL_Scope::IK_decls);
+ !group1_member_items.is_done ();
+ group1_member_items.next ())
{
- // Since group1 and group2 are the same list, we can start this
- // iterator from where the outer one is.
- while (j++ < i)
+ group1_member_item = group1_member_items.item ();
+ AST_Decl::NodeType nt1 =
+ group1_member_item->node_type ();
+
+ // Only these member types may cause a clash because
+ // they can't be redefined.
+ if (nt1 != AST_Decl::NT_op
+ && nt1 != AST_Decl::NT_attr)
{
- group2_iter.advance ();
+ continue;
}
- if (group2_iter.done ())
- {
- break;
- }
-
- // Queue element.
- (void) group2_iter.next (group2_member);
+ Identifier *pid1 = group1_member_item->local_name ();
+ int j = 0;
- for (UTL_ScopeActiveIterator group2_member_items (
- DeclAsScope (*group2_member),
- UTL_Scope::IK_decls
- );
- !group2_member_items.is_done ();
- group2_member_items.next ())
+ for (ACE_Unbounded_Queue_Iterator<AST_Type *> group2_iter (
+ this->insert_queue);
+ !group2_iter.done ();
+ (void) group2_iter.advance ())
{
- group2_member_item = group2_member_items.item ();
- AST_Decl::NodeType nt2 = group2_member_item->node_type ();
-
- // Only these member types may cause a clash
- // with other parents' member of the same type.
- if (nt2 != AST_Decl::NT_op && nt2 != AST_Decl::NT_attr)
+ // Since group1 and group2 are the same list, we can start this
+ // iterator from where the outer one is.
+ while (j++ < i)
{
- continue;
+ group2_iter.advance ();
}
- Identifier *pid2 = group2_member_item->local_name ();
-
- if (pid1->compare (pid2) == true)
+ if (group2_iter.done ())
{
- idl_global->err ()->error3 (
- UTL_Error::EIDL_REDEF,
- *group1_member,
- *group2_member,
- group2_member_item
- );
- return true;
+ break;
}
- else if (pid1->case_compare_quiet (pid2) == true)
+
+ // Queue element.
+ (void) group2_iter.next (group2_member);
+ UTL_Scope *ss = DeclAsScope (*group2_member);
+
+ if (ss != 0)
{
- if (idl_global->case_diff_error ())
- {
- idl_global->err ()->error3 (
- UTL_Error::EIDL_NAME_CASE_ERROR,
- *group1_member,
- group1_member_item,
- group2_member_item
- );
- return true;
- }
- else
+ for (UTL_ScopeActiveIterator group2_member_items (
+ ss,
+ UTL_Scope::IK_decls);
+ !group2_member_items.is_done ();
+ group2_member_items.next ())
{
- idl_global->err ()->warning3 (
- UTL_Error::EIDL_NAME_CASE_WARNING,
- *group1_member,
- group1_member_item,
- group2_member_item
- );
- }
- }
- } // end of FOR (group2_member_items)
- } // end of FOR (group2_iter)
- } // end of FOR (group1_member_items)
+ group2_member_item =
+ group2_member_items.item ();
+
+ AST_Decl::NodeType nt2 =
+ group2_member_item->node_type ();
+
+ // Only these member types may cause a clash
+ // with other parents' member of the same type.
+ if (nt2 != AST_Decl::NT_op
+ && nt2 != AST_Decl::NT_attr)
+ {
+ continue;
+ }
+
+ Identifier *pid2 =
+ group2_member_item->local_name ();
+
+ if (pid1->compare (pid2) == true)
+ {
+ idl_global->err ()->error3 (
+ UTL_Error::EIDL_REDEF,
+ *group1_member,
+ *group2_member,
+ group2_member_item);
+
+ return true;
+ }
+ else if (pid1->case_compare_quiet (pid2))
+ {
+ if (idl_global->case_diff_error ())
+ {
+ idl_global->err ()->error3 (
+ UTL_Error::EIDL_NAME_CASE_ERROR,
+ *group1_member,
+ group1_member_item,
+ group2_member_item);
+
+ return true;
+ }
+ else
+ {
+ idl_global->err ()->warning3 (
+ UTL_Error::EIDL_NAME_CASE_WARNING,
+ *group1_member,
+ group1_member_item,
+ group2_member_item);
+ }
+ }
+ } // end of FOR (group2_member_items)
+ } // end of IF ss != 0
+ } // end of FOR (group2_iter)
+ } // end of FOR (group1_member_items)
+ } // end of IF s != 0
} // end of FOR (group1_iter)
return false;
@@ -1538,7 +1574,7 @@ AST_Interface::look_in_inherited (UTL_ScopedName *e,
{
AST_Decl *d = 0;
AST_Decl *d_before = 0;
- AST_Interface **is = 0;
+ AST_Type **is = 0;
long nis = -1;
// Can't look in an interface which was not yet defined.
@@ -1556,9 +1592,17 @@ AST_Interface::look_in_inherited (UTL_ScopedName *e,
nis > 0;
nis--, is++)
{
- d = (*is)->lookup_by_name (e,
- treat_as_ref,
- 0 /* not in parent */);
+ AST_Interface *i =
+ AST_Interface::narrow_from_decl (*is);
+
+ if (i == 0)
+ {
+ continue;
+ }
+
+ d = (i)->lookup_by_name (e,
+ treat_as_ref,
+ 0 /* not in parent */);
if (d != 0)
{
if (d_before == 0)
@@ -1662,6 +1706,24 @@ AST_Interface::legal_for_primary_key (void) const
void
AST_Interface::destroy (void)
{
+ for (ACE_Unbounded_Queue_Iterator<AST_Type *> i (
+ this->param_holders_);
+ !i.done ();
+ (void) i.advance ())
+ {
+ AST_Type **tt = 0;
+ i.next (tt);
+ AST_Type *t = *tt;
+ t->destroy ();
+ delete t;
+ t = 0;
+ }
+
+ // The destroy() we are in gets called twice if we start from
+ // be_valuetype or be_eventtype. This line keeps us from
+ // iterating over null pointers the 2nd time.
+ this->param_holders_.reset ();
+
delete [] this->pd_inherits;
this->pd_inherits = 0;
this->pd_n_inherits = 0;
diff --git a/modules/TAO/TAO_IDL/ast/ast_valuetype.cpp b/modules/TAO/TAO_IDL/ast/ast_valuetype.cpp
index 76d98c17922..3aad0bc9935 100644
--- a/modules/TAO/TAO_IDL/ast/ast_valuetype.cpp
+++ b/modules/TAO/TAO_IDL/ast/ast_valuetype.cpp
@@ -7,10 +7,13 @@
#include "ast_visitor.h"
#include "ast_extern.h"
#include "ast_field.h"
+#include "ast_param_holder.h"
+
#include "utl_err.h"
#include "utl_identifier.h"
#include "utl_indenter.h"
#include "utl_string.h"
+
#include "global_extern.h"
#include "nr_extern.h"
@@ -32,14 +35,14 @@ AST_ValueType::AST_ValueType (void)
}
AST_ValueType::AST_ValueType (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool abstract,
bool truncatable,
bool custom)
@@ -64,6 +67,24 @@ AST_ValueType::AST_ValueType (UTL_ScopedName *n,
pd_truncatable (truncatable),
pd_custom (custom)
{
+ // Enqueue the param holders (if any) for later destruction.
+ // By the time our destroy() is called, it will be too late
+ // to iterate over pd_inherits.
+ for (long i = 0; i < n_supports; ++i)
+ {
+ if (supports[i]->node_type () == AST_Decl::NT_param_holder)
+ {
+ this->param_holders_.enqueue_tail (supports[i]);
+ }
+ }
+
+ if (inherits_concrete != 0)
+ {
+ if (inherits_concrete->node_type () == AST_Decl::NT_param_holder)
+ {
+ this->param_holders_.enqueue_tail (inherits_concrete);
+ }
+ }
}
AST_ValueType::~AST_ValueType (void)
@@ -175,7 +196,7 @@ AST_ValueType::redefine (AST_Interface *from)
this->pd_truncatable = vt->pd_truncatable;
}
-AST_Interface **
+AST_Type **
AST_ValueType::supports (void) const
{
return this->pd_supports;
@@ -187,13 +208,13 @@ AST_ValueType::n_supports (void) const
return this->pd_n_supports;
}
-AST_ValueType *
+AST_Type *
AST_ValueType::inherits_concrete (void) const
{
return this->pd_inherits_concrete;
}
-AST_Interface *
+AST_Type *
AST_ValueType::supports_concrete (void) const
{
return this->pd_supports_concrete;
@@ -224,7 +245,7 @@ AST_ValueType::look_in_supported (UTL_ScopedName *e,
{
AST_Decl *d = 0;
AST_Decl *d_before = 0;
- AST_Interface **is = 0;
+ AST_Type **is = 0;
long nis = -1;
// Can't look in an interface which was not yet defined.
@@ -244,9 +265,18 @@ AST_ValueType::look_in_supported (UTL_ScopedName *e,
nis > 0;
nis--, is++)
{
- d = (*is)->lookup_by_name (e,
- treat_as_ref,
- 0 /* not in parent */);
+ if ((*is)->node_type () == AST_Decl::NT_param_holder)
+ {
+ continue;
+ }
+
+ AST_Interface *i =
+ AST_Interface::narrow_from_decl (*is);
+
+ d = (i)->lookup_by_name (e,
+ treat_as_ref,
+ 0 /* not in parent */);
+
if (d != 0)
{
if (d_before == 0)
@@ -350,11 +380,11 @@ AST_ValueType::legal_for_primary_key (void) const
void
AST_ValueType::destroy (void)
{
+ this->AST_Interface::destroy ();
+
delete [] this->pd_supports;
this->pd_supports = 0;
this->pd_n_supports = 0;
-
- this->AST_Interface::destroy ();
}
void
@@ -488,14 +518,15 @@ AST_ValueType::derived_from_primary_key_base (const AST_ValueType *node,
return true;
}
- AST_ValueType *concrete_parent = node->inherits_concrete ();
+ AST_ValueType *concrete_parent =
+ AST_ValueType::narrow_from_decl (node->inherits_concrete ());
if (this->derived_from_primary_key_base (concrete_parent, pk_base))
{
return true;
}
- AST_Interface **v = node->pd_inherits;
+ AST_Type **v = node->pd_inherits;
for (long i = 0; i < node->pd_n_inherits; ++i)
{
diff --git a/modules/TAO/TAO_IDL/be/be_component.cpp b/modules/TAO/TAO_IDL/be/be_component.cpp
index 200e87c7dea..ac4afefeb03 100644
--- a/modules/TAO/TAO_IDL/be/be_component.cpp
+++ b/modules/TAO/TAO_IDL/be/be_component.cpp
@@ -45,7 +45,7 @@ be_component::be_component (void)
be_component::be_component (UTL_ScopedName *n,
AST_Component *base_component,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat)
diff --git a/modules/TAO/TAO_IDL/be/be_eventtype.cpp b/modules/TAO/TAO_IDL/be/be_eventtype.cpp
index e1aef0dcc1a..8fd28c68344 100644
--- a/modules/TAO/TAO_IDL/be/be_eventtype.cpp
+++ b/modules/TAO/TAO_IDL/be/be_eventtype.cpp
@@ -41,14 +41,14 @@ be_eventtype::be_eventtype (void)
// Constructor used to build the AST.
be_eventtype::be_eventtype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool abstract,
bool truncatable,
bool custom)
diff --git a/modules/TAO/TAO_IDL/be/be_generator.cpp b/modules/TAO/TAO_IDL/be/be_generator.cpp
index 0438c321252..66417ad65c2 100644
--- a/modules/TAO/TAO_IDL/be/be_generator.cpp
+++ b/modules/TAO/TAO_IDL/be/be_generator.cpp
@@ -214,7 +214,7 @@ be_generator::create_module (UTL_Scope *s,
AST_Interface *
be_generator::create_interface (UTL_ScopedName *n,
- AST_Interface **ih,
+ AST_Type **ih,
long nih,
AST_Interface **ih_flat,
long nih_flat,
@@ -273,14 +273,14 @@ be_generator::create_valuebox (UTL_ScopedName *n,
AST_ValueType *
be_generator::create_valuetype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool is_abstract,
bool is_truncatable,
bool is_custom)
@@ -333,14 +333,14 @@ be_generator::create_valuetype_fwd (UTL_ScopedName *n,
AST_EventType *
be_generator::create_eventtype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool is_abstract,
bool is_truncatable,
bool is_custom)
@@ -394,7 +394,7 @@ be_generator::create_eventtype_fwd (UTL_ScopedName *n,
AST_Component *
be_generator::create_component (UTL_ScopedName *n,
AST_Component *base_component,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat)
@@ -436,8 +436,8 @@ AST_Home *
be_generator::create_home (UTL_ScopedName *n,
AST_Home *base_home,
AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports_list,
+ AST_Type *primary_key,
+ AST_Type **supports_list,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat)
diff --git a/modules/TAO/TAO_IDL/be/be_home.cpp b/modules/TAO/TAO_IDL/be/be_home.cpp
index 8d20f292582..beb83897077 100644
--- a/modules/TAO/TAO_IDL/be/be_home.cpp
+++ b/modules/TAO/TAO_IDL/be/be_home.cpp
@@ -45,8 +45,8 @@ be_home::be_home (void)
be_home::be_home (UTL_ScopedName *n,
AST_Home *base_home,
AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports,
+ AST_Type *primary_key,
+ AST_Type **supports,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat)
diff --git a/modules/TAO/TAO_IDL/be/be_interface.cpp b/modules/TAO/TAO_IDL/be/be_interface.cpp
index a1e2d56cfd9..9b9aab039d2 100644
--- a/modules/TAO/TAO_IDL/be/be_interface.cpp
+++ b/modules/TAO/TAO_IDL/be/be_interface.cpp
@@ -73,7 +73,7 @@ be_interface::be_interface (void)
// Constructor used to build the AST.
be_interface::be_interface (UTL_ScopedName *n,
- AST_Interface **ih,
+ AST_Type **ih,
long nih,
AST_Interface **ih_flat,
long nih_flat,
@@ -1384,8 +1384,15 @@ be_interface::analyze_parentage (void)
{
be_interface *parent =
be_interface::narrow_from_decl (this->pd_inherits[i]);
+
+ if (parent == 0)
+ {
+ // The item is a template param holder.
+ continue;
+ }
- if (parent->is_abstract () || parent->has_mixed_parentage ())
+ if (parent->is_abstract ()
+ || parent->has_mixed_parentage ())
{
this->has_mixed_parentage_ = 1;
break;
@@ -1466,7 +1473,7 @@ be_interface::traverse_inheritance_graph (
bool abstract_paths_only,
bool add_ccm_object)
{
- AST_Interface *intf = 0; // element inside the queue
+ AST_Type *intf = 0; // element inside the queue
if (!this->insert_queue.is_empty ())
{
@@ -1507,7 +1514,7 @@ be_interface::traverse_inheritance_graph (
(void) this->insert_non_dup (base);
long const n_supports = base->n_supports ();
- AST_Interface **supports = base->supports ();
+ AST_Type **supports = base->supports ();
for (long j = 0; j < n_supports; ++j)
{
diff --git a/modules/TAO/TAO_IDL/be/be_valuetype.cpp b/modules/TAO/TAO_IDL/be/be_valuetype.cpp
index 0124521caa4..ae7070b9a3c 100644
--- a/modules/TAO/TAO_IDL/be/be_valuetype.cpp
+++ b/modules/TAO/TAO_IDL/be/be_valuetype.cpp
@@ -63,14 +63,14 @@ be_valuetype::be_valuetype (void)
// Constructor used to build the AST.
be_valuetype::be_valuetype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool abstract,
bool truncatable,
bool custom)
@@ -135,6 +135,12 @@ be_valuetype::be_valuetype (UTL_ScopedName *n,
{
be_interface *intf =
be_interface::narrow_from_decl (this->pd_supports[i]);
+
+ if (intf == 0)
+ {
+ // The item is a temploate param holder.
+ continue;
+ }
if (intf->is_abstract () || intf->has_mixed_parentage ())
{
@@ -318,7 +324,7 @@ be_valuetype::have_operation (void)
// Now traverse inheritance tree.
long i; // loop index
long n_inherits = this->n_inherits ();
- AST_Interface **inherits = this->inherits ();
+ AST_Type **inherits = this->inherits ();
for (i = 0; i < n_inherits; ++i)
{
@@ -335,15 +341,17 @@ be_valuetype::have_operation (void)
if (! have_operation)
{
// Check for operations on supported interfaces
- AST_Interface * supported = this->supports_concrete ();
+ AST_Type * supported = this->supports_concrete ();
if (supported != 0)
{
- be_interface *intf = be_interface::narrow_from_decl (supported);
+ be_interface *intf =
+ be_interface::narrow_from_decl (supported);
if (intf != 0)
{
- have_operation = be_valuetype::have_supported_op (intf);
+ have_operation =
+ be_valuetype::have_supported_op (intf);
}
}
}
@@ -393,14 +401,17 @@ be_valuetype::have_supported_op (be_interface * node)
// Now traverse inheritance tree.
long i; // loop index
long n_inherits = node->n_inherits ();
- AST_Interface **inherits = node->inherits ();
+ AST_Type **inherits = node->inherits ();
+
for (i = 0; i < n_inherits; ++i)
{
- be_interface * intf = be_interface::narrow_from_decl (inherits[i]);
+ be_interface * intf =
+ be_interface::narrow_from_decl (inherits[i]);
if (intf != 0)
{
- have_supported_op = be_valuetype::have_supported_op (intf);
+ have_supported_op =
+ be_valuetype::have_supported_op (intf);
if (have_supported_op)
{
@@ -424,7 +435,7 @@ be_valuetype::will_have_factory (void)
bool
be_valuetype::has_member (void)
{
- AST_ValueType *parent = this->pd_inherits_concrete;
+ AST_Type *parent = this->pd_inherits_concrete;
// We're looking for inherited members too.
if (parent != 0)
@@ -742,14 +753,15 @@ int
be_valuetype::traverse_concrete_inheritance_graph (tao_code_emitter gen,
TAO_OutStream *os)
{
- AST_Interface *supported = this->supports_concrete ();
+ AST_Type *supported = this->supports_concrete ();
if (supported == 0)
{
return 0;
}
- be_interface *concrete = be_interface::narrow_from_decl (supported);
+ be_interface *concrete =
+ be_interface::narrow_from_decl (supported);
// Make sure the queues are empty.
this->insert_queue.reset ();
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/modules/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp
index a51955b96ee..8bd02c761aa 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp
@@ -602,7 +602,7 @@ be_visitor_amh_pre_proc::create_exception_holder (be_interface *node)
idl_global->valuefactory_seen_ = true;
const int inherit_count = 0;
- AST_Interface **p_intf = 0;
+ AST_Type **p_intf = 0;
UTL_ScopedName *excep_holder_name =
node->compute_name ("AMH_",
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp b/modules/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
index c2ca7d8320f..8ee418b5c0b 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
@@ -359,7 +359,8 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node,
);
long n_parents = 0;
- AST_Interface **p_intf = this->create_inheritance_list (node, n_parents);
+ AST_Type **p_intf =
+ this->create_inheritance_list (node, n_parents);
be_interface *reply_handler = 0;
ACE_NEW_RETURN (reply_handler,
@@ -1182,15 +1183,15 @@ be_visitor_ami_pre_proc::generate_set_operation (be_attribute *node)
return operation;
}
-AST_Interface **
+AST_Type **
be_visitor_ami_pre_proc::create_inheritance_list (be_interface *node,
long &n_rh_parents)
{
- AST_Interface **retval = 0;
+ AST_Type **retval = 0;
long n_parents = node->n_inherits ();
- AST_Interface **parents = node->inherits ();
- AST_Interface *parent = 0;
+ AST_Type **parents = node->inherits ();
+ AST_Type *parent = 0;
for (long i = 0; i < n_parents; ++i)
{
@@ -1209,7 +1210,7 @@ be_visitor_ami_pre_proc::create_inheritance_list (be_interface *node,
be_interface *inherit_intf = be_global->messaging_replyhandler ();
ACE_NEW_RETURN (retval,
- AST_Interface *[1],
+ AST_Type *[1],
0);
retval[0] = inherit_intf;
@@ -1218,7 +1219,7 @@ be_visitor_ami_pre_proc::create_inheritance_list (be_interface *node,
else
{
ACE_NEW_RETURN (retval,
- AST_Interface *[n_rh_parents],
+ AST_Type *[n_rh_parents],
0);
ACE_CString prefix ("AMI_");
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp b/modules/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp
index 689561fc552..b73d831613a 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp
@@ -514,7 +514,7 @@ be_visitor_ccm_pre_proc::gen_implicit_ops (be_home *node,
-1);
}
- AST_ValueType *pk = node->primary_key ();
+ AST_Type *pk = node->primary_key ();
if (pk == 0)
{
@@ -1147,7 +1147,7 @@ be_visitor_ccm_pre_proc::gen_create (be_home *node,
0),
-1);
op->set_name (op_name);
- AST_ValueType *pk = node->primary_key ();
+ AST_Type *pk = node->primary_key ();
UTL_ExceptList *exceps = 0;
ACE_NEW_RETURN (exceps,
UTL_ExceptList (this->create_failure_,
@@ -1209,7 +1209,7 @@ be_visitor_ccm_pre_proc::gen_find_by_primary_key (be_home *node,
0),
-1);
op->set_name (op_name);
- AST_ValueType *pk = node->primary_key ();
+ AST_Type *pk = node->primary_key ();
Identifier arg_id ("key");
UTL_ScopedName arg_name (&arg_id,
0);
@@ -1265,7 +1265,7 @@ be_visitor_ccm_pre_proc::gen_remove (be_home *node,
0),
-1);
op->set_name (op_name);
- AST_ValueType *pk = node->primary_key ();
+ AST_Type *pk = node->primary_key ();
Identifier arg_id ("key");
UTL_ScopedName arg_name (&arg_id,
0);
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp b/modules/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp
index 248f506f131..2d5bb5d1e33 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp
@@ -124,8 +124,8 @@ be_visitor_component_sh::visit_component (be_component *node)
}
long nsupports = node->n_inherits ();
- AST_Interface **supports = node->supports ();
- AST_Interface *supported = 0;
+ AST_Type **supports = node->supports ();
+ AST_Type *supported = 0;
for (long i = 0; i < nsupports; ++i)
{
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp b/modules/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp
index 35e41db6c9f..33890f7ffbb 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp
@@ -198,7 +198,7 @@ be_visitor_executor_ex_idl::gen_supported (void)
{
os_ << be_idt;
- AST_Interface **supported = node_->supports ();
+ AST_Type **supported = node_->supports ();
for (long i = 0; i < node_->n_supports (); ++i)
{
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp b/modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp
index be4a564bc69..18946b72863 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp
@@ -345,7 +345,7 @@ be_visitor_home_ex_idl::gen_supported (void)
{
os_ << be_idt;
- AST_Interface **supported = node_->supports ();
+ AST_Type **supported = node_->supports ();
for (long i = 0; i < node_->n_supports (); ++i)
{
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp b/modules/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp
index fed649a0650..7bd98a387bd 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp
@@ -44,7 +44,7 @@ be_visitor_interface_direct_proxy_impl_sh::visit_interface (
if (node->n_inherits () > 0)
{
- AST_Interface *parent = 0;
+ AST_Type *parent = 0;
for (int i = 0; i < node->n_inherits (); ++i)
{
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/modules/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
index 64786df07eb..510e0eb8038 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
@@ -108,8 +108,8 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
<< " " << class_name.c_str () << be_idt_nl << ": " << be_idt;
long n_parents = node->n_inherits ();
- AST_Interface *parent = 0;
- int has_concrete_parent = 0;
+ AST_Type *parent = 0;
+ bool has_concrete_parent = false;
for (int i = 0; i < n_parents; ++i)
{
@@ -120,7 +120,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
continue;
}
- if (has_concrete_parent == 1)
+ if (has_concrete_parent)
{
*os << "," << be_nl;
}
@@ -128,10 +128,10 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
*os << "public virtual " << "POA_"
<< parent->name ();
- has_concrete_parent = 1;
+ has_concrete_parent = true;
}
- if (has_concrete_parent == 0)
+ if (! has_concrete_parent)
{
// We don't inherit from another user defined object, hence our
// base class is the ServantBase class.
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp b/modules/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp
index 97bcf6af074..a8e6cebdbe2 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp
@@ -145,7 +145,7 @@ TAO::be_visitor_value_typecode::visit_valuetype (be_valuetype * node)
<< (node->is_abstract () ? "VM_ABSTRACT" : "VM_NONE") << "," << be_nl;
// Concrete base type.
- AST_ValueType * const concrete_base =
+ AST_Type * const concrete_base =
node->inherits_concrete ();
if (concrete_base)
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
index ebbbd55dca8..d93d0366ab8 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
@@ -778,7 +778,7 @@ be_visitor_valuetype::gen_obv_init_constructor_args (be_valuetype *node,
unsigned long &index)
{
TAO_OutStream *os = this->ctx_->stream ();
- AST_ValueType *parent = node->inherits_concrete ();
+ AST_Type *parent = node->inherits_concrete ();
// Generate for inherited members first.
if (parent != 0)
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
index 45239e5dffa..ee0a1f4a696 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
@@ -478,7 +478,7 @@ be_visitor_valuetype_cs::gen_ostream_operator_r (be_valuetype *node,
unsigned long &index)
{
TAO_OutStream *os = this->ctx_->stream ();
- AST_ValueType *parent = node->inherits_concrete ();
+ AST_Type *parent = node->inherits_concrete ();
// Recurse up the parent chain.
if (parent != 0)
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
index 094b0c96967..0e5874a0399 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
@@ -106,7 +106,7 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node)
//
int i = 0;
- AST_Interface *inherited = 0;
+ AST_Type *inherited = 0;
for (; i < node->n_inherits (); ++i)
{
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
index b5123ed6be4..30dae918bea 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
@@ -194,7 +194,7 @@ be_visitor_valuetype_obv_cs::gen_obv_init_base_constructor_args (
)
{
TAO_OutStream *os = this->ctx_->stream ();
- AST_ValueType *parent = node->inherits_concrete ();
+ AST_Type *parent = node->inherits_concrete ();
// Generate for inherited members first.
if (parent != 0)
@@ -228,7 +228,7 @@ be_visitor_valuetype_obv_cs::gen_obv_init_constructor_inits (
)
{
TAO_OutStream *os = this->ctx_->stream ();
- AST_ValueType *parent = node->inherits_concrete ();
+ AST_Type *parent = node->inherits_concrete ();
// Generate for inherited members first.
if (parent != 0)
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp
index c17523bf982..23c10dc317b 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp
@@ -44,7 +44,7 @@ be_visitor_valuetype_sh::visit_valuetype (be_valuetype *node)
return 0;
}
- AST_Interface *concrete = node->supports_concrete ();
+ AST_Type *concrete = node->supports_concrete ();
// We generate a skeleton class only if the valuetype supports a
// non-abstract interface.
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp
index 65c98639643..f7b12702aad 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp
@@ -46,7 +46,7 @@ be_visitor_valuetype_ss::visit_valuetype (be_valuetype *node)
return 0;
}
- AST_Interface *concrete = node->supports_concrete ();
+ AST_Type *concrete = node->supports_concrete ();
// We generate a skeleton class only if the valuetype supports a
// non-abstract interface.
diff --git a/modules/TAO/TAO_IDL/be_include/be_component.h b/modules/TAO/TAO_IDL/be_include/be_component.h
index ff27ae29b08..06c4a5d766d 100644
--- a/modules/TAO/TAO_IDL/be_include/be_component.h
+++ b/modules/TAO/TAO_IDL/be_include/be_component.h
@@ -37,7 +37,7 @@ public:
be_component (UTL_ScopedName *n,
AST_Component *base_component,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat);
diff --git a/modules/TAO/TAO_IDL/be_include/be_eventtype.h b/modules/TAO/TAO_IDL/be_include/be_eventtype.h
index 4992f3f4dbf..254d4cf90b5 100644
--- a/modules/TAO/TAO_IDL/be_include/be_eventtype.h
+++ b/modules/TAO/TAO_IDL/be_include/be_eventtype.h
@@ -35,14 +35,14 @@ public:
// Default constructor.
be_eventtype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool abstract,
bool truncatable,
bool custom);
diff --git a/modules/TAO/TAO_IDL/be_include/be_generator.h b/modules/TAO/TAO_IDL/be_include/be_generator.h
index d1a8ed4d67a..4bd349c2673 100644
--- a/modules/TAO/TAO_IDL/be_include/be_generator.h
+++ b/modules/TAO/TAO_IDL/be_include/be_generator.h
@@ -91,7 +91,7 @@ public:
UTL_ScopedName *n);
virtual AST_Interface *create_interface (UTL_ScopedName *n,
- AST_Interface **ih,
+ AST_Type **ih,
long nih,
AST_Interface **ih_flat,
long nih_flat,
@@ -107,14 +107,14 @@ public:
AST_Type *boxed_type);
virtual AST_ValueType *create_valuetype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool is_abstract,
bool is_truncatable,
bool is_custom);
@@ -123,14 +123,14 @@ public:
bool abstract);
virtual AST_EventType *create_eventtype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool is_abstract,
bool is_truncatable,
bool is_custom);
@@ -140,7 +140,7 @@ public:
virtual AST_Component *create_component (UTL_ScopedName *n,
AST_Component *base_component,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat);
@@ -150,8 +150,8 @@ public:
virtual AST_Home *create_home (UTL_ScopedName *n,
AST_Home *base_home,
AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports_list,
+ AST_Type *primary_key,
+ AST_Type **supports_list,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat);
diff --git a/modules/TAO/TAO_IDL/be_include/be_home.h b/modules/TAO/TAO_IDL/be_include/be_home.h
index 9d7ed41f582..c64d42d8a8b 100644
--- a/modules/TAO/TAO_IDL/be_include/be_home.h
+++ b/modules/TAO/TAO_IDL/be_include/be_home.h
@@ -38,8 +38,8 @@ public:
be_home (UTL_ScopedName *n,
AST_Home *base_home,
AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports,
+ AST_Type *primary_key,
+ AST_Type **supports,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat);
diff --git a/modules/TAO/TAO_IDL/be_include/be_interface.h b/modules/TAO/TAO_IDL/be_include/be_interface.h
index 698601849c0..ffab87a51d8 100644
--- a/modules/TAO/TAO_IDL/be_include/be_interface.h
+++ b/modules/TAO/TAO_IDL/be_include/be_interface.h
@@ -62,7 +62,7 @@ public:
// Default constructor.
be_interface (UTL_ScopedName *n,
- AST_Interface **ih,
+ AST_Type **ih,
long nih,
AST_Interface **ih_flat,
long nih_flat,
diff --git a/modules/TAO/TAO_IDL/be_include/be_valuetype.h b/modules/TAO/TAO_IDL/be_include/be_valuetype.h
index c656a61f869..e1452c1dbe8 100644
--- a/modules/TAO/TAO_IDL/be_include/be_valuetype.h
+++ b/modules/TAO/TAO_IDL/be_include/be_valuetype.h
@@ -39,14 +39,14 @@ public:
// Default constructor.
be_valuetype (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool abstract,
bool truncatable,
bool custom);
diff --git a/modules/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h b/modules/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h
index bcf8907e25e..2634544b480 100644
--- a/modules/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h
+++ b/modules/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h
@@ -28,7 +28,7 @@
#include "be_visitor_scope.h"
#include "ace/SString.h"
-class AST_Interface;
+class AST_Type;
class be_visitor_ami_pre_proc : public be_visitor_scope
{
@@ -114,8 +114,8 @@ private:
be_operation *generate_set_operation (be_attribute *node);
// generate a set operation out of the attribute.
- AST_Interface **create_inheritance_list (be_interface *node,
- long &n_parents);
+ AST_Type **create_inheritance_list (be_interface *node,
+ long &n_parents);
// Create an inheritance list for the reply handler.
};
diff --git a/modules/TAO/TAO_IDL/fe/fe_component_header.cpp b/modules/TAO/TAO_IDL/fe/fe_component_header.cpp
index d05f0a6247b..a7046dcf8f9 100644
--- a/modules/TAO/TAO_IDL/fe/fe_component_header.cpp
+++ b/modules/TAO/TAO_IDL/fe/fe_component_header.cpp
@@ -178,6 +178,26 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports)
if (nt == AST_Decl::NT_interface)
{
iface = AST_Interface::narrow_from_decl (d);
+
+ // Undefined interface?
+ if (!iface->is_defined ())
+ {
+ idl_global->err ()->inheritance_fwd_error (
+ this->interface_name_,
+ iface);
+
+ continue;
+ }
+
+ // Local interface? (illegal for components to support).
+ if (iface->is_local ())
+ {
+ idl_global->err ()->unconstrained_interface_expected (
+ this->name (),
+ iface->name ());
+
+ continue;
+ }
}
else if (nt == AST_Decl::NT_param_holder)
{
@@ -201,22 +221,6 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports)
continue;
}
- // Undefined interface?
- if (iface != 0 && !iface->is_defined ())
- {
- idl_global->err ()->inheritance_fwd_error (this->interface_name_,
- iface);
- continue;
- }
-
- // Local interface? (illegal for components to support).
- if (iface->is_local ())
- {
- idl_global->err ()->unconstrained_interface_expected (this->name (),
- iface->name ());
- continue;
- }
-
// OK, see if we have to add this to the list of interfaces
// inherited from.
this->compile_one_inheritance (t);
diff --git a/modules/TAO/TAO_IDL/fe/fe_home_header.cpp b/modules/TAO/TAO_IDL/fe/fe_home_header.cpp
index 987dd395597..2d03c261d58 100644
--- a/modules/TAO/TAO_IDL/fe/fe_home_header.cpp
+++ b/modules/TAO/TAO_IDL/fe/fe_home_header.cpp
@@ -170,7 +170,7 @@ FE_HomeHeader::compile_primary_key (UTL_ScopedName *primary_key)
nt = ph->info ()->type_;
if (nt != AST_Decl::NT_type
- && nt != AST_Decl::NT_except)
+ && nt != AST_Decl::NT_valuetype)
{
idl_global->err ()->mismatched_template_param (
ph->info ()->name_.c_str ());
diff --git a/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp b/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp
index 2e9ff36f942..793518c41c5 100644
--- a/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp
+++ b/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp
@@ -227,7 +227,7 @@ FE_InterfaceHeader::compile_one_inheritance (AST_Type *i)
}
// Add i's parents to the flat list.
- AST_Type **parents = iface->inherits_flat ();
+ AST_Interface **parents = iface->inherits_flat ();
long num_parents = iface->n_inherits_flat ();
for (long j = 0; j < num_parents; ++j)
diff --git a/modules/TAO/TAO_IDL/fe/fe_obv_header.cpp b/modules/TAO/TAO_IDL/fe/fe_obv_header.cpp
index 2ecb2c6a2f5..7850ce9c982 100644
--- a/modules/TAO/TAO_IDL/fe/fe_obv_header.cpp
+++ b/modules/TAO/TAO_IDL/fe/fe_obv_header.cpp
@@ -306,7 +306,7 @@ FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d)
}
AST_ValueType *vt = 0;
- AST_Interface *concrete = 0;
+ AST_Type *concrete = 0;
AST_Interface *ancestor = 0;
for (long i = 0; i < this->n_inherits_; ++i)
diff --git a/modules/TAO/TAO_IDL/include/ast_component.h b/modules/TAO/TAO_IDL/include/ast_component.h
index 564fff3edee..82f38fa3961 100644
--- a/modules/TAO/TAO_IDL/include/ast_component.h
+++ b/modules/TAO/TAO_IDL/include/ast_component.h
@@ -23,7 +23,7 @@ public:
AST_Component (UTL_ScopedName *n,
AST_Component *base_component,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat);
@@ -45,7 +45,7 @@ public:
AST_Component *base_component (void) const;
- AST_Interface **supports (void) const;
+ AST_Type **supports (void) const;
long n_supports (void) const;
diff --git a/modules/TAO/TAO_IDL/include/ast_eventtype.h b/modules/TAO/TAO_IDL/include/ast_eventtype.h
index 2eccc0b52f5..fad9ed9e40d 100644
--- a/modules/TAO/TAO_IDL/include/ast_eventtype.h
+++ b/modules/TAO/TAO_IDL/include/ast_eventtype.h
@@ -12,14 +12,14 @@ public:
AST_EventType (void);
AST_EventType (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool abstract,
bool truncatable,
bool custom);
diff --git a/modules/TAO/TAO_IDL/include/ast_generator.h b/modules/TAO/TAO_IDL/include/ast_generator.h
index 457d8b0ad3a..fa342900cad 100644
--- a/modules/TAO/TAO_IDL/include/ast_generator.h
+++ b/modules/TAO/TAO_IDL/include/ast_generator.h
@@ -119,7 +119,7 @@ public:
// Create a node representing an interface.
virtual AST_Interface *create_interface (
UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
AST_Interface **inherits_flat,
long n_inherits_flat,
@@ -137,14 +137,14 @@ public:
// Create a node representing a valuetype.
virtual AST_ValueType *create_valuetype (
UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool is_abstract,
bool is_truncatable,
bool is_custom
@@ -159,14 +159,14 @@ public:
// Create a node representing an eventtype.
virtual AST_EventType *create_eventtype (
UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool is_abstract,
bool is_truncatable,
bool is_custom
@@ -182,7 +182,7 @@ public:
virtual AST_Component *create_component (
UTL_ScopedName *n,
AST_Component *base_component,
- AST_Interface **supports_list,
+ AST_Type **supports_list,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat
@@ -198,8 +198,8 @@ public:
UTL_ScopedName *n,
AST_Home *base_home,
AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **support_lists,
+ AST_Type *primary_key,
+ AST_Type **support_lists,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat
diff --git a/modules/TAO/TAO_IDL/include/ast_home.h b/modules/TAO/TAO_IDL/include/ast_home.h
index 9b155bd75c1..1dafeaeda0a 100644
--- a/modules/TAO/TAO_IDL/include/ast_home.h
+++ b/modules/TAO/TAO_IDL/include/ast_home.h
@@ -19,8 +19,8 @@ public:
AST_Home (UTL_ScopedName *n,
AST_Home *base_home,
AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports,
+ AST_Type *primary_key,
+ AST_Type **supports,
long n_supports,
AST_Interface **supports_flat,
long n_supports_flat);
@@ -39,13 +39,13 @@ public:
AST_Home *base_home (void) const;
- AST_Interface **supports (void) const;
+ AST_Type **supports (void) const;
long n_supports (void) const;
AST_Component *managed_component (void) const;
- AST_ValueType *primary_key (void) const;
+ AST_Type *primary_key (void) const;
typedef ACE_Unbounded_Queue<AST_Operation *> INIT_LIST;
@@ -70,9 +70,10 @@ public:
private:
AST_Home *pd_base_home;
AST_Component *pd_managed_component;
- AST_ValueType *pd_primary_key;
+ AST_Type *pd_primary_key;
INIT_LIST pd_factories;
INIT_LIST pd_finders;
+ bool owns_primary_key_;
};
#endif // _AST_HOME_AST_HOME_HH
diff --git a/modules/TAO/TAO_IDL/include/ast_interface.h b/modules/TAO/TAO_IDL/include/ast_interface.h
index 465a271ba84..2e59a7444a5 100644
--- a/modules/TAO/TAO_IDL/include/ast_interface.h
+++ b/modules/TAO/TAO_IDL/include/ast_interface.h
@@ -83,7 +83,7 @@ public:
AST_Interface (UTL_ScopedName *n,
AST_Type **ih,
long nih,
- AST_Type **ih_flat,
+ AST_Interface **ih_flat,
long nih_flat,
bool local,
bool abstract);
@@ -105,8 +105,8 @@ public:
long n_inherits_flat (void) const;
- ACE_Unbounded_Queue<AST_Interface *> &get_insert_queue (void);
- ACE_Unbounded_Queue<AST_Interface *> &get_del_queue (void);
+ ACE_Unbounded_Queue<AST_Type *> &get_insert_queue (void);
+ ACE_Unbounded_Queue<AST_Type *> &get_del_queue (void);
AST_Operation *be_add_operation (AST_Operation *);
@@ -157,7 +157,7 @@ protected:
// Data.
// Immediate ancestors.
- AST_Interface **pd_inherits;
+ AST_Type **pd_inherits;
long pd_n_inherits;
// All ancestors.
@@ -184,6 +184,13 @@ protected:
// The forward declaration we may have been created from.
AST_InterfaceFwd *fwd_decl_;
+
+ // Must keep these base interface placeholders in a separate
+ // container, so they can be destroyed. Iterating over
+ // pd_inherits won't work because the real interfaces will
+ // probably already be destroyed and the pointers will be
+ // garbage.
+ ACE_Unbounded_Queue<AST_Type *> param_holders_;
protected:
// Scope Management Protocol.
@@ -221,12 +228,12 @@ protected:
AST_Decl *lookup_for_add (AST_Decl *d,
bool treat_as_ref);
- void redef_clash_populate_r (AST_Interface *t);
+ void redef_clash_populate_r (AST_Type *t);
// Populate the insert queue with our parents, and, if we are a
// valuetype, with our supported interface and our parents'
// supported interfaces.
- int insert_non_dup (AST_Interface *t,
+ int insert_non_dup (AST_Type *t,
bool abstract_paths_only = false);
// Do non-duplicating insert of bi, by searching both the
// insert queue and the delete queue.
diff --git a/modules/TAO/TAO_IDL/include/ast_valuetype.h b/modules/TAO/TAO_IDL/include/ast_valuetype.h
index 3539214c7ca..bacd756a3ab 100644
--- a/modules/TAO/TAO_IDL/include/ast_valuetype.h
+++ b/modules/TAO/TAO_IDL/include/ast_valuetype.h
@@ -12,14 +12,14 @@ public:
AST_ValueType (void);
AST_ValueType (UTL_ScopedName *n,
- AST_Interface **inherits,
+ AST_Type **inherits,
long n_inherits,
- AST_ValueType *inherits_concrete,
+ AST_Type *inherits_concrete,
AST_Interface **inherits_flat,
long n_inherits_flat,
- AST_Interface **supports,
+ AST_Type **supports,
long n_supports,
- AST_Interface *supports_concrete,
+ AST_Type *supports_concrete,
bool abstract,
bool truncatable,
bool custom);
@@ -32,13 +32,13 @@ public:
// This also calls the base class version.
virtual void redefine (AST_Interface *from);
- AST_Interface **supports (void) const;
+ AST_Type **supports (void) const;
long n_supports (void) const;
- AST_ValueType *inherits_concrete (void) const;
+ AST_Type *inherits_concrete (void) const;
- AST_Interface *supports_concrete (void) const;
+ AST_Type *supports_concrete (void) const;
bool truncatable (void) const;
bool custom (void) const;
@@ -70,10 +70,10 @@ public:
virtual int ast_accept (ast_visitor *visitor);
protected:
- AST_Interface **pd_supports;
+ AST_Type **pd_supports;
long pd_n_supports;
- AST_ValueType *pd_inherits_concrete;
- AST_Interface *pd_supports_concrete;
+ AST_Type *pd_inherits_concrete;
+ AST_Type *pd_supports_concrete;
bool pd_truncatable;
bool pd_custom;
diff --git a/modules/TAO/TAO_IDL/narrow/narrow.cpp b/modules/TAO/TAO_IDL/narrow/narrow.cpp
index 2a5e3eaa547..038d038a7c3 100644
--- a/modules/TAO/TAO_IDL/narrow/narrow.cpp
+++ b/modules/TAO/TAO_IDL/narrow/narrow.cpp
@@ -70,6 +70,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "ast_eventtype.h"
#include "ast_component.h"
#include "ast_porttype.h"
+#include "ast_connector.h"
#include "ast_home.h"
#include "ast_operation.h"
#include "ast_factory.h"
@@ -106,6 +107,8 @@ ScopeAsDecl (UTL_Scope *s)
return AST_Component::narrow_from_scope (s);
case AST_Decl::NT_porttype:
return AST_PortType::narrow_from_scope (s);
+ case AST_Decl::NT_connector:
+ return AST_Connector::narrow_from_scope (s);
case AST_Decl::NT_home:
return AST_Home::narrow_from_scope (s);
case AST_Decl::NT_op:
diff --git a/modules/TAO/TAO_IDL/util/utl_scope.cpp b/modules/TAO/TAO_IDL/util/utl_scope.cpp
index 9ee364a8b7f..135a724ba97 100644
--- a/modules/TAO/TAO_IDL/util/utl_scope.cpp
+++ b/modules/TAO/TAO_IDL/util/utl_scope.cpp
@@ -1811,7 +1811,8 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
// look in previous openings, if any.
AST_Decl *last_chance = ScopeAsDecl (this);
- if (0 == index && last_chance->node_type () == AST_Decl::NT_module)
+ if (0 == index
+ && last_chance->node_type () == AST_Decl::NT_module)
{
// Check the result using the full_def_only constraint.
AST_Module *m = AST_Module::narrow_from_decl (last_chance);