diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-09-17 13:37:08 +0200 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-09-17 13:37:08 +0200 |
commit | fdeff1b597fed3d27b975d0486ba4966a89b977b (patch) | |
tree | ef434018424594109d5d8a734892c457711b2173 | |
parent | 0ca9c019335cde957877214b6ffb4328de4ca198 (diff) | |
download | ATCD-fdeff1b597fed3d27b975d0486ba4966a89b977b.tar.gz |
Remove manual narrow support and use dynamic_cast
405 files changed, 1227 insertions, 1985 deletions
diff --git a/ACE/ace/Service_Object.cpp b/ACE/ace/Service_Object.cpp index a16b9af04f2..742463e479d 100644 --- a/ACE/ace/Service_Object.cpp +++ b/ACE/ace/Service_Object.cpp @@ -110,7 +110,7 @@ ACE_Service_Type::fini (void) return 1; // No implementation was found. } - int ret = this->type_->fini (); + int const ret = this->type_->fini (); // Ensure type is 0 to prevent invalid access after call to fini. this->type_ = 0; diff --git a/ACE/ace/Service_Types.cpp b/ACE/ace/Service_Types.cpp index 1d835685e06..b44fb43f116 100644 --- a/ACE/ace/Service_Types.cpp +++ b/ACE/ace/Service_Types.cpp @@ -121,7 +121,7 @@ ACE_Service_Object_Type::fini (void) const ACE_Service_Object * const so = static_cast<ACE_Service_Object *> (obj); - // Call fini() if an only if, the object was successfuly + // Call fini() if an only if, the object was successfully // initialized, i.e. init() returned 0. This is necessary to // maintain the ctor/dtor-like semantics for init/fini. if (so != 0 && this->initialized_ == 0) diff --git a/TAO/TAO_IDL/ast/ast_annotation_appl.cpp b/TAO/TAO_IDL/ast/ast_annotation_appl.cpp index aed09a6c3cf..75eb854757c 100644 --- a/TAO/TAO_IDL/ast/ast_annotation_appl.cpp +++ b/TAO/TAO_IDL/ast/ast_annotation_appl.cpp @@ -103,9 +103,6 @@ const char *AST_Annotation_Appl::original_name () const return original_name_; } -IMPL_NARROW_FROM_DECL (AST_Annotation_Appl) -IMPL_NARROW_FROM_SCOPE (AST_Annotation_Appl) - bool AST_Annotation_Appl::apply_from (AST_Annotation_Decl *decl) { @@ -117,7 +114,7 @@ AST_Annotation_Appl::apply_from (AST_Annotation_Decl *decl) si.next ()) { AST_Annotation_Member *member = - AST_Annotation_Member::narrow_from_decl (si.item ()); + dynamic_cast<AST_Annotation_Member*> (si.item ()); if (member) { AST_Annotation_Member *new_member = fe_add_annotation_member ( diff --git a/TAO/TAO_IDL/ast/ast_annotation_appls.cpp b/TAO/TAO_IDL/ast/ast_annotation_appls.cpp index 7f4949ddbd2..d96c302fbee 100644 --- a/TAO/TAO_IDL/ast/ast_annotation_appls.cpp +++ b/TAO/TAO_IDL/ast/ast_annotation_appls.cpp @@ -114,5 +114,5 @@ AST_Annotation_Appls::find (const char *annotation) return 0; } - return find (AST_Annotation_Decl::narrow_from_decl (decl)); + return find (dynamic_cast<AST_Annotation_Decl*> (decl)); } diff --git a/TAO/TAO_IDL/ast/ast_annotation_decl.cpp b/TAO/TAO_IDL/ast/ast_annotation_decl.cpp index 45eab38d7d6..280c085a50f 100644 --- a/TAO/TAO_IDL/ast/ast_annotation_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_annotation_decl.cpp @@ -40,9 +40,6 @@ void AST_Annotation_Decl::destroy () AST_Decl::destroy (); } -IMPL_NARROW_FROM_DECL (AST_Annotation_Decl) -IMPL_NARROW_FROM_SCOPE (AST_Annotation_Decl) - void AST_Annotation_Decl::escape_name (Identifier *name) { @@ -86,19 +83,19 @@ AST_Annotation_Decl::fe_add_annotation_member ( } } - AST_Annotation_Decl *s = AST_Annotation_Decl::narrow_from_scope (this); + AST_Annotation_Decl *s = dynamic_cast<AST_Annotation_Decl*> (this); if (s) { s->fields ().enqueue_tail (annotation_member); } - return AST_Annotation_Member::narrow_from_decl (d); + return dynamic_cast<AST_Annotation_Member*> (d); } AST_Constant * AST_Annotation_Decl::fe_add_constant (AST_Constant *t) { - return AST_Constant::narrow_from_decl (fe_add_decl (t)); + return dynamic_cast<AST_Constant*> (fe_add_decl (t)); } int diff --git a/TAO/TAO_IDL/ast/ast_annotation_member.cpp b/TAO/TAO_IDL/ast/ast_annotation_member.cpp index d15d73b557a..8c872a7777a 100644 --- a/TAO/TAO_IDL/ast/ast_annotation_member.cpp +++ b/TAO/TAO_IDL/ast/ast_annotation_member.cpp @@ -57,9 +57,6 @@ AST_Annotation_Member::destroy () AST_Field::destroy (); } -IMPL_NARROW_FROM_DECL (AST_Annotation_Member); -IMPL_NARROW_FROM_SCOPE (AST_Annotation_Member); - void AST_Annotation_Member::dump (ACE_OSTREAM_TYPE &o) { diff --git a/TAO/TAO_IDL/ast/ast_argument.cpp b/TAO/TAO_IDL/ast/ast_argument.cpp index 5867a6c0763..4bea2d21cfc 100644 --- a/TAO/TAO_IDL/ast/ast_argument.cpp +++ b/TAO/TAO_IDL/ast/ast_argument.cpp @@ -133,5 +133,3 @@ AST_Argument::direction (void) { return this->pd_direction; } - -IMPL_NARROW_FROM_DECL(AST_Argument) diff --git a/TAO/TAO_IDL/ast/ast_array.cpp b/TAO/TAO_IDL/ast/ast_array.cpp index 110279a2411..fc96ef025ba 100644 --- a/TAO/TAO_IDL/ast/ast_array.cpp +++ b/TAO/TAO_IDL/ast/ast_array.cpp @@ -270,8 +270,6 @@ AST_Array::set_dims (AST_Expression **ds, this->pd_n_dims = nds; } -IMPL_NARROW_FROM_DECL(AST_Array) - AST_Annotation_Appls & AST_Array::base_type_annotations () { diff --git a/TAO/TAO_IDL/ast/ast_attribute.cpp b/TAO/TAO_IDL/ast/ast_attribute.cpp index 3dc8331d3a8..d16804d1467 100644 --- a/TAO/TAO_IDL/ast/ast_attribute.cpp +++ b/TAO/TAO_IDL/ast/ast_attribute.cpp @@ -232,7 +232,7 @@ AST_Attribute::fe_add_get_exceptions (UTL_NameList *t) return 0; } - fe = AST_Type::narrow_from_decl (d); + fe = dynamic_cast<AST_Type*> (d); UTL_ExceptList *el = 0; ACE_NEW_RETURN (el, @@ -285,7 +285,7 @@ AST_Attribute::fe_add_set_exceptions (UTL_NameList *t) return 0; } - fe = AST_Type::narrow_from_decl (d); + fe = dynamic_cast<AST_Type*> (d); UTL_ExceptList *el = 0; ACE_NEW_RETURN (el, @@ -310,5 +310,3 @@ AST_Attribute::annotatable () const { return true; } - -IMPL_NARROW_FROM_DECL(AST_Attribute) diff --git a/TAO/TAO_IDL/ast/ast_component.cpp b/TAO/TAO_IDL/ast/ast_component.cpp index c1cbe1729b5..14d697af2b8 100644 --- a/TAO/TAO_IDL/ast/ast_component.cpp +++ b/TAO/TAO_IDL/ast/ast_component.cpp @@ -53,7 +53,7 @@ AST_Component::~AST_Component (void) void AST_Component::redefine (AST_Interface *from) { - AST_Component *c = AST_Component::narrow_from_decl (from); + AST_Component *c = dynamic_cast<AST_Component*> (from); if (c == 0) { @@ -113,7 +113,7 @@ AST_Component::look_in_supported (UTL_ScopedName *e, } AST_Interface *i = - AST_Interface::narrow_from_decl (*is); + dynamic_cast<AST_Interface*> (*is); d = (i)->lookup_by_name_r (e, full_def_only); @@ -212,57 +212,43 @@ AST_Component::ast_accept (ast_visitor *visitor) AST_Provides * AST_Component::fe_add_provides (AST_Provides *p) { - return - AST_Provides::narrow_from_decl ( - this->fe_add_ref_decl (p)); + return dynamic_cast<AST_Provides*> (this->fe_add_ref_decl (p)); } AST_Uses * AST_Component::fe_add_uses (AST_Uses *u) { - return - AST_Uses::narrow_from_decl ( - this->fe_add_ref_decl (u)); + return dynamic_cast<AST_Uses*> (this->fe_add_ref_decl (u)); } AST_Publishes * AST_Component::fe_add_publishes (AST_Publishes *p) { - return - AST_Publishes::narrow_from_decl ( - this->fe_add_ref_decl (p)); + return dynamic_cast<AST_Publishes*> (this->fe_add_ref_decl (p)); } AST_Emits * AST_Component::fe_add_emits (AST_Emits *e) { - return - AST_Emits::narrow_from_decl ( - this->fe_add_ref_decl (e)); + return dynamic_cast<AST_Emits*> (this->fe_add_ref_decl (e)); } AST_Consumes * AST_Component::fe_add_consumes (AST_Consumes *c) { - return - AST_Consumes::narrow_from_decl ( - this->fe_add_ref_decl (c)); + return dynamic_cast<AST_Consumes*> (this->fe_add_ref_decl (c)); } AST_Extended_Port * AST_Component::fe_add_extended_port (AST_Extended_Port *p) { - return - AST_Extended_Port::narrow_from_decl ( - this->fe_add_ref_decl (p)); + return dynamic_cast<AST_Extended_Port*> (this->fe_add_ref_decl (p)); } AST_Mirror_Port * AST_Component::fe_add_mirror_port (AST_Mirror_Port *p) { - return - AST_Mirror_Port::narrow_from_decl ( - this->fe_add_ref_decl (p)); + return dynamic_cast<AST_Mirror_Port*> (this->fe_add_ref_decl (p)); } int @@ -282,5 +268,3 @@ AST_Component::be_add_uses (AST_Uses *i, return 0; } -IMPL_NARROW_FROM_DECL (AST_Component) -IMPL_NARROW_FROM_SCOPE (AST_Component) diff --git a/TAO/TAO_IDL/ast/ast_component_fwd.cpp b/TAO/TAO_IDL/ast/ast_component_fwd.cpp index 597f6434d52..361faa89a99 100644 --- a/TAO/TAO_IDL/ast/ast_component_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_component_fwd.cpp @@ -50,5 +50,3 @@ AST_ComponentFwd::is_fwd (void) { return true; // This is a fwd declared type } - -IMPL_NARROW_FROM_DECL (AST_ComponentFwd) diff --git a/TAO/TAO_IDL/ast/ast_concrete_type.cpp b/TAO/TAO_IDL/ast/ast_concrete_type.cpp index fb198cd9d89..dc3c3648174 100644 --- a/TAO/TAO_IDL/ast/ast_concrete_type.cpp +++ b/TAO/TAO_IDL/ast/ast_concrete_type.cpp @@ -87,4 +87,3 @@ AST_ConcreteType::destroy (void) this->AST_Type::destroy (); } -IMPL_NARROW_FROM_DECL(AST_ConcreteType) diff --git a/TAO/TAO_IDL/ast/ast_connector.cpp b/TAO/TAO_IDL/ast/ast_connector.cpp index e92a55de7d7..0b2fe0ca15b 100644 --- a/TAO/TAO_IDL/ast/ast_connector.cpp +++ b/TAO/TAO_IDL/ast/ast_connector.cpp @@ -45,7 +45,7 @@ AST_Connector::~AST_Connector (void) AST_Connector * AST_Connector::base_connector (void) const { - return AST_Connector::narrow_from_decl (this->pd_base_component); + return dynamic_cast<AST_Connector*> (this->pd_base_component); } void @@ -82,6 +82,3 @@ AST_Connector::ast_accept (ast_visitor *visitor) { return visitor->visit_connector (this); } - -IMPL_NARROW_FROM_DECL (AST_Connector) -IMPL_NARROW_FROM_SCOPE (AST_Connector) diff --git a/TAO/TAO_IDL/ast/ast_constant.cpp b/TAO/TAO_IDL/ast/ast_constant.cpp index f3a51add81e..674d63dbdf4 100644 --- a/TAO/TAO_IDL/ast/ast_constant.cpp +++ b/TAO/TAO_IDL/ast/ast_constant.cpp @@ -298,5 +298,3 @@ AST_Constant::enum_full_name (void) return 0; } } - -IMPL_NARROW_FROM_DECL(AST_Constant) diff --git a/TAO/TAO_IDL/ast/ast_consumes.cpp b/TAO/TAO_IDL/ast/ast_consumes.cpp index 1a1308094aa..48720706f83 100644 --- a/TAO/TAO_IDL/ast/ast_consumes.cpp +++ b/TAO/TAO_IDL/ast/ast_consumes.cpp @@ -44,5 +44,3 @@ AST_Consumes::destroy (void) { this->AST_Field::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_Consumes) diff --git a/TAO/TAO_IDL/ast/ast_decl.cpp b/TAO/TAO_IDL/ast/ast_decl.cpp index 96a46df6707..59152a256b2 100644 --- a/TAO/TAO_IDL/ast/ast_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_decl.cpp @@ -385,7 +385,7 @@ AST_Decl::set_prefix_with_typeprefix_r (const char *value, // This will recursively catch all previous openings of a module. if (this->node_type () == AST_Decl::NT_module) { - AST_Module *m = AST_Module::narrow_from_decl (this); + AST_Module *m = dynamic_cast<AST_Module*> (this); while (!!(m = m->previous_opening ())) { for (UTL_ScopeActiveIterator si (m, UTL_Scope::IK_decls); @@ -867,7 +867,7 @@ AST_Decl::has_ancestor (AST_Decl *s) return true; } - AST_Module *m = AST_Module::narrow_from_decl (s); + AST_Module *m = dynamic_cast<AST_Module*> (s); if (m) { while (!!(m = m->previous_opening ())) @@ -1470,7 +1470,7 @@ AST_Decl::contains_wstring (void) { case AST_Decl::NT_array: { - AST_Array *a = AST_Array::narrow_from_decl (this); + AST_Array *a = dynamic_cast<AST_Array*> (this); this->contains_wstring_ = a->base_type ()->contains_wstring (); break; } @@ -1479,14 +1479,14 @@ AST_Decl::contains_wstring (void) case AST_Decl::NT_struct: case AST_Decl::NT_union: { - AST_Structure *s = AST_Structure::narrow_from_decl (this); + AST_Structure *s = dynamic_cast<AST_Structure*> (this); this->contains_wstring_ = s->contains_wstring (); break; } case AST_Decl::NT_sequence: { - AST_Sequence *s = AST_Sequence::narrow_from_decl (this); + AST_Sequence *s = dynamic_cast<AST_Sequence*> (this); this->contains_wstring_ = s->base_type ()->contains_wstring (); break; } @@ -1495,14 +1495,14 @@ AST_Decl::contains_wstring (void) case AST_Decl::NT_field: case AST_Decl::NT_union_branch: { - AST_Field *f = AST_Field::narrow_from_decl (this); + AST_Field *f = dynamic_cast<AST_Field*> (this); this->contains_wstring_ = f->field_type ()->contains_wstring (); break; } case AST_Decl::NT_typedef: { - AST_Typedef *td = AST_Typedef::narrow_from_decl (this); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (this); this->contains_wstring_ = td->primitive_base_type ()->contains_wstring (); break; @@ -1536,11 +1536,11 @@ AST_Decl::masking_checks (AST_Decl *mod) return true; } - AST_Module *me_mod = AST_Module::narrow_from_decl (this); + AST_Module *me_mod = dynamic_cast<AST_Module*> (this); if (me_mod != 0) { - AST_Module *po_mod = AST_Module::narrow_from_decl (mod); + AST_Module *po_mod = dynamic_cast<AST_Module*> (mod); if (po_mod) { while (!!(po_mod = po_mod->previous_opening ())) @@ -1568,11 +1568,6 @@ AST_Decl::in_tmpl_mod_not_aliased (bool val) this->in_tmpl_mod_not_aliased_ = val; } -//Narrowing methods for AST_Decl. - -IMPL_NARROW_FROM_DECL(AST_Decl) - - void AST_Decl::annotation_appls (const AST_Annotation_Appls &annotations) { diff --git a/TAO/TAO_IDL/ast/ast_emits.cpp b/TAO/TAO_IDL/ast/ast_emits.cpp index 581b557ec9b..eaecaea725f 100644 --- a/TAO/TAO_IDL/ast/ast_emits.cpp +++ b/TAO/TAO_IDL/ast/ast_emits.cpp @@ -43,5 +43,3 @@ AST_Emits::destroy (void) { this->AST_Field::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_Emits) diff --git a/TAO/TAO_IDL/ast/ast_enum.cpp b/TAO/TAO_IDL/ast/ast_enum.cpp index 6ad9afb3fc9..0be8d222345 100644 --- a/TAO/TAO_IDL/ast/ast_enum.cpp +++ b/TAO/TAO_IDL/ast/ast_enum.cpp @@ -117,7 +117,7 @@ AST_Enum::value_to_name (const unsigned long v) for (UTL_ScopeActiveIterator i (this, IK_decls); !i.is_done (); i.next ()) { d = i.item (); - item = AST_EnumVal::narrow_from_decl (d); + item = dynamic_cast<AST_EnumVal*> (d); if (item->constant_value ()->ev ()->u.ulval == v) { @@ -140,7 +140,7 @@ AST_Enum::lookup_by_value (const AST_Expression *v) i.next ()) { d = i.item (); - item = AST_EnumVal::narrow_from_decl (d); + item = dynamic_cast<AST_EnumVal*> (d); AST_Expression *cv = item->constant_value (); if (cv == v) @@ -371,9 +371,3 @@ AST_Enum::destroy (void) this->UTL_Scope::destroy (); this->AST_ConcreteType::destroy (); } - - - - -IMPL_NARROW_FROM_DECL(AST_Enum) -IMPL_NARROW_FROM_SCOPE(AST_Enum) diff --git a/TAO/TAO_IDL/ast/ast_enum_val.cpp b/TAO/TAO_IDL/ast/ast_enum_val.cpp index eef74bb560a..5769cb28487 100644 --- a/TAO/TAO_IDL/ast/ast_enum_val.cpp +++ b/TAO/TAO_IDL/ast/ast_enum_val.cpp @@ -103,8 +103,6 @@ AST_EnumVal::ast_accept (ast_visitor *visitor) return visitor->visit_enum_val (this); } -IMPL_NARROW_FROM_DECL(AST_EnumVal) - AST_Enum * AST_EnumVal::enum_parent () { diff --git a/TAO/TAO_IDL/ast/ast_eventtype.cpp b/TAO/TAO_IDL/ast/ast_eventtype.cpp index 107dc1fc1b8..98de5fa0ca3 100644 --- a/TAO/TAO_IDL/ast/ast_eventtype.cpp +++ b/TAO/TAO_IDL/ast/ast_eventtype.cpp @@ -121,9 +121,3 @@ AST_EventType::ast_accept (ast_visitor *visitor) { return visitor->visit_eventtype (this); } - - // Narrowing. - -IMPL_NARROW_FROM_DECL(AST_EventType) -IMPL_NARROW_FROM_SCOPE(AST_EventType) - diff --git a/TAO/TAO_IDL/ast/ast_eventtype_fwd.cpp b/TAO/TAO_IDL/ast/ast_eventtype_fwd.cpp index 41690400f88..f9c02872ec6 100644 --- a/TAO/TAO_IDL/ast/ast_eventtype_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_eventtype_fwd.cpp @@ -51,7 +51,3 @@ void AST_EventTypeFwd::destroy (void) { } - - - -IMPL_NARROW_FROM_DECL (AST_EventTypeFwd) diff --git a/TAO/TAO_IDL/ast/ast_exception.cpp b/TAO/TAO_IDL/ast/ast_exception.cpp index f2dddf6946b..387921a3218 100644 --- a/TAO/TAO_IDL/ast/ast_exception.cpp +++ b/TAO/TAO_IDL/ast/ast_exception.cpp @@ -137,7 +137,7 @@ AST_Exception::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) // Continue until each element is visited. for (UTL_ScopeActiveIterator i (this, IK_decls);!i.is_done ();i.next ()) { - AST_Field *field = AST_Field::narrow_from_decl (i.item ()); + AST_Field *field = dynamic_cast<AST_Field*> (i.item ()); if (field == 0) // This will be an enum value or other legitimate non-field @@ -150,7 +150,7 @@ AST_Exception::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) if (type->node_type () == AST_Decl::NT_typedef) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (type); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (type); type = td->primitive_base_type (); } @@ -202,6 +202,3 @@ AST_Exception::destroy (void) { this->AST_Structure::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_Exception) -IMPL_NARROW_FROM_SCOPE(AST_Exception) diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp index 34014a58cc2..c0303b60d21 100644 --- a/TAO/TAO_IDL/ast/ast_expression.cpp +++ b/TAO/TAO_IDL/ast/ast_expression.cpp @@ -116,7 +116,7 @@ AST_Expression::AST_Expression (UTL_ScopedName *nm) if (d->node_type () == AST_Decl::NT_param_holder) { this->param_holder_ = - AST_Param_Holder::narrow_from_decl (d); + dynamic_cast<AST_Param_Holder*> (d); } } @@ -2517,12 +2517,12 @@ AST_Expression::eval_symbol (AST_Expression::EvalKind ek) if (d->node_type () == AST_Decl::NT_enum_val) { - AST_EnumVal *enumval = AST_EnumVal::narrow_from_decl (d); + AST_EnumVal *enumval = dynamic_cast<AST_EnumVal*> (d); enum_parent (enumval->enum_parent ()); } // OK, now evaluate the constant we just got, to produce its value. - c = AST_Constant::narrow_from_decl (d); + c = dynamic_cast<AST_Constant*> (d); if (c == 0) { @@ -2575,7 +2575,7 @@ AST_Expression::check_and_coerce (AST_Expression::ExprType t, if (d->node_type () == AST_Decl::NT_typedef) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (d); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (d); d = td->primitive_base_type (); } diff --git a/TAO/TAO_IDL/ast/ast_extended_port.cpp b/TAO/TAO_IDL/ast/ast_extended_port.cpp index 66a755dcb0e..18bd45e6a9f 100644 --- a/TAO/TAO_IDL/ast/ast_extended_port.cpp +++ b/TAO/TAO_IDL/ast/ast_extended_port.cpp @@ -28,7 +28,7 @@ AST_Extended_Port::~AST_Extended_Port (void) AST_PortType * AST_Extended_Port::port_type (void) const { - return AST_PortType::narrow_from_decl (this->field_type ()); + return dynamic_cast<AST_PortType*> (this->field_type ()); } void @@ -50,6 +50,3 @@ AST_Extended_Port::ast_accept (ast_visitor *visitor) { return visitor->visit_extended_port (this); } - -IMPL_NARROW_FROM_DECL (AST_Extended_Port) - diff --git a/TAO/TAO_IDL/ast/ast_factory.cpp b/TAO/TAO_IDL/ast/ast_factory.cpp index 15b779fbd10..70f05f3ac5d 100644 --- a/TAO/TAO_IDL/ast/ast_factory.cpp +++ b/TAO/TAO_IDL/ast/ast_factory.cpp @@ -190,9 +190,9 @@ AST_Factory::compute_argument_attr (void) { this->argument_count_++; - arg = AST_Argument::narrow_from_decl (d); + arg = dynamic_cast<AST_Argument*> (d); - type = AST_Type::narrow_from_decl (arg->field_type ()); + type = dynamic_cast<AST_Type*> (arg->field_type ()); if (type->node_type () == AST_Decl::NT_native) { @@ -209,7 +209,7 @@ AST_Argument * AST_Factory::fe_add_argument (AST_Argument *t) { return - AST_Argument::narrow_from_decl ( + dynamic_cast<AST_Argument*> ( this->fe_add_ref_decl (t)); } @@ -246,7 +246,7 @@ AST_Factory::fe_add_exceptions (UTL_NameList *t) return 0; } - fe = AST_Type::narrow_from_decl (d); + fe = dynamic_cast<AST_Type*> (d); UTL_ExceptList *el = 0; ACE_NEW_RETURN (el, @@ -307,7 +307,3 @@ AST_Factory::ast_accept (ast_visitor *visitor) { return visitor->visit_factory (this); } - -IMPL_NARROW_FROM_DECL(AST_Factory) -IMPL_NARROW_FROM_SCOPE(AST_Factory) - diff --git a/TAO/TAO_IDL/ast/ast_field.cpp b/TAO/TAO_IDL/ast/ast_field.cpp index 15f5d97b957..71dc55e963a 100644 --- a/TAO/TAO_IDL/ast/ast_field.cpp +++ b/TAO/TAO_IDL/ast/ast_field.cpp @@ -108,7 +108,7 @@ AST_Field::AST_Field (AST_Type *ft, if (fnt == AST_Decl::NT_param_holder) { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (ft); + dynamic_cast<AST_Param_Holder*> (ft); if (ph->info ()->type_ == AST_Decl::NT_const) { @@ -141,7 +141,7 @@ AST_Field::AST_Field (AST_Decl::NodeType nt, if (fnt == AST_Decl::NT_param_holder) { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (ft); + dynamic_cast<AST_Param_Holder*> (ft); if (ph->info ()->type_ == AST_Decl::NT_const) { @@ -234,8 +234,6 @@ AST_Field::contains_wstring (void) return this->ref_type_->contains_wstring (); } -IMPL_NARROW_FROM_DECL(AST_Field) - bool AST_Field::annotatable () const { return true; diff --git a/TAO/TAO_IDL/ast/ast_finder.cpp b/TAO/TAO_IDL/ast/ast_finder.cpp index 5945fdb228c..fe474026188 100644 --- a/TAO/TAO_IDL/ast/ast_finder.cpp +++ b/TAO/TAO_IDL/ast/ast_finder.cpp @@ -58,7 +58,3 @@ AST_Finder::ast_accept (ast_visitor *visitor) { return visitor->visit_finder (this); } - -IMPL_NARROW_FROM_DECL(AST_Finder) -IMPL_NARROW_FROM_SCOPE(AST_Finder) - diff --git a/TAO/TAO_IDL/ast/ast_fixed.cpp b/TAO/TAO_IDL/ast/ast_fixed.cpp index ded0d58b581..a001d37421c 100644 --- a/TAO/TAO_IDL/ast/ast_fixed.cpp +++ b/TAO/TAO_IDL/ast/ast_fixed.cpp @@ -54,5 +54,3 @@ AST_Expression *AST_Fixed::scale () { return pd_scale; } - -IMPL_NARROW_FROM_DECL(AST_Fixed) diff --git a/TAO/TAO_IDL/ast/ast_generator.cpp b/TAO/TAO_IDL/ast/ast_generator.cpp index 0c1c673aca6..ec289b43547 100644 --- a/TAO/TAO_IDL/ast/ast_generator.cpp +++ b/TAO/TAO_IDL/ast/ast_generator.cpp @@ -139,7 +139,7 @@ AST_Generator::create_module (UTL_Scope *s, { // Can't just check node type here, since it could be a // template module or template module instantiation. - AST_Module *m = AST_Module::narrow_from_decl (iter.item ()); + AST_Module *m = dynamic_cast<AST_Module*> (iter.item ()); if (m && m->local_name ()->compare (n->last_component ())) { // Create this new module with referance to the @@ -155,8 +155,7 @@ AST_Generator::create_module (UTL_Scope *s, // is itself a module, and has been previously opened, any // of the previous openings may contain a previous opening // of the module we're creating. - // AST_Module *prev_module = AST_Module::narrow_from_scope (s); - AST_Module *prev_module = AST_Module::narrow_from_scope (s); + AST_Module *prev_module = dynamic_cast<AST_Module*> (s); if (prev_module) { while (!!(prev_module= prev_module->previous_opening ())) @@ -165,7 +164,7 @@ AST_Generator::create_module (UTL_Scope *s, !iter.is_done (); iter.next ()) { - AST_Module *m = AST_Module::narrow_from_decl (iter.item ()); + AST_Module *m = dynamic_cast<AST_Module*> (iter.item ()); if (m && m->local_name ()->compare (n->last_component ())) { // Create this new module with referance to the @@ -269,7 +268,7 @@ AST_Generator::create_valuetype (UTL_ScopedName *n, 0); // The following helps with OBV_ namespace generation. - AST_Module *m = AST_Module::narrow_from_scope (retval->defined_in ()); + AST_Module *m = dynamic_cast<AST_Module*> (retval->defined_in ()); if (m) { m->set_has_nested_valuetype (); @@ -336,7 +335,7 @@ AST_Generator::create_eventtype (UTL_ScopedName *n, 0); // The following helps with OBV_ namespace generation. - AST_Module *m = AST_Module::narrow_from_scope (retval->defined_in ()); + AST_Module *m = dynamic_cast<AST_Module*> (retval->defined_in ()); if (m != 0) { diff --git a/TAO/TAO_IDL/ast/ast_home.cpp b/TAO/TAO_IDL/ast/ast_home.cpp index b7e773b1fdd..057080b35e2 100644 --- a/TAO/TAO_IDL/ast/ast_home.cpp +++ b/TAO/TAO_IDL/ast/ast_home.cpp @@ -43,8 +43,7 @@ AST_Home::AST_Home (UTL_ScopedName *n, { FE_Utils::tmpl_mod_ref_check (this, base_home); - AST_ValueType *pk = - AST_ValueType::narrow_from_decl (primary_key); + AST_ValueType *pk = dynamic_cast<AST_ValueType*> (primary_key); if (pk != 0) { @@ -107,8 +106,7 @@ AST_Home::look_in_supported (UTL_ScopedName *e, continue; } - AST_Interface *i = - AST_Interface::narrow_from_decl (*is); + AST_Interface *i = dynamic_cast<AST_Interface*> (*is); d = (i)->lookup_by_name_r (e, full_def_only); @@ -266,21 +264,11 @@ AST_Home::ast_accept (ast_visitor *visitor) AST_Factory * AST_Home::fe_add_factory (AST_Factory *f) { - return - AST_Factory::narrow_from_decl ( - this->fe_add_decl (f)); + return dynamic_cast<AST_Factory*> (this->fe_add_decl (f)); } AST_Finder * AST_Home::fe_add_finder (AST_Finder *f) { - return - AST_Finder::narrow_from_decl ( - this->fe_add_decl (f)); + return dynamic_cast<AST_Finder*> (this->fe_add_decl (f)); } - - // Narrowing. - -IMPL_NARROW_FROM_DECL(AST_Home) -IMPL_NARROW_FROM_SCOPE(AST_Home) - diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index 9e3d780b418..909c3bf602f 100644 --- a/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/TAO/TAO_IDL/ast/ast_interface.cpp @@ -184,33 +184,25 @@ AST_Interface::is_defined (void) AST_Constant * AST_Interface::fe_add_constant (AST_Constant *t) { - return - AST_Constant::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Constant*> (this->fe_add_decl (t)); } AST_Exception * AST_Interface::fe_add_exception (AST_Exception *t) { - return - AST_Exception::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Exception*> (this->fe_add_decl (t)); } AST_Attribute * AST_Interface::fe_add_attribute (AST_Attribute *t) { - return - AST_Attribute::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Attribute*> (this->fe_add_decl (t)); } AST_Operation * AST_Interface::fe_add_operation (AST_Operation *t) { - return - AST_Operation::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Operation*> (this->fe_add_decl (t)); } AST_Structure * @@ -228,25 +220,19 @@ AST_Interface::fe_add_structure_fwd (AST_StructureFwd *t) AST_Enum * AST_Interface::fe_add_enum (AST_Enum *t) { - return - AST_Enum::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Enum*> (this->fe_add_decl (t)); } AST_Union * AST_Interface::fe_add_union (AST_Union *t) { - return - AST_Union::narrow_from_decl ( - this->fe_add_full_struct_type (t)); + return dynamic_cast<AST_Union*> (this->fe_add_full_struct_type (t)); } AST_UnionFwd * AST_Interface::fe_add_union_fwd (AST_UnionFwd *t) { - return - AST_UnionFwd::narrow_from_decl ( - this->fe_add_fwd_struct_type (t)); + return dynamic_cast<AST_UnionFwd*> (this->fe_add_fwd_struct_type (t)); } // Add an AST_EnumVal node (an enumerator) to this scope. @@ -257,7 +243,7 @@ AST_EnumVal * AST_Interface::fe_add_enum_val (AST_EnumVal *t) { return - AST_EnumVal::narrow_from_decl ( + dynamic_cast<AST_EnumVal*> ( this->fe_add_decl (t)); } @@ -266,7 +252,7 @@ AST_Typedef * AST_Interface::fe_add_typedef (AST_Typedef *t) { return - AST_Typedef::narrow_from_decl ( + dynamic_cast<AST_Typedef*> ( this->fe_add_ref_decl (t)); } @@ -274,7 +260,7 @@ AST_Native * AST_Interface::fe_add_native (AST_Native *t) { return - AST_Native::narrow_from_decl ( + dynamic_cast<AST_Native*> ( this->fe_add_decl (t)); } @@ -443,7 +429,7 @@ AST_Interface::redef_clash_populate_r (AST_Type *t) if (nt != AST_Decl::NT_param_holder) { AST_Interface *i = - AST_Interface::narrow_from_decl (t); + dynamic_cast<AST_Interface*> (t); AST_Type **parents = i->inherits (); long n_parents = i->n_inherits (); @@ -456,7 +442,7 @@ AST_Interface::redef_clash_populate_r (AST_Type *t) if (nt == AST_Decl::NT_valuetype || nt == AST_Decl::NT_eventtype) { - AST_ValueType *v = AST_ValueType::narrow_from_decl (t); + AST_ValueType *v = dynamic_cast<AST_ValueType*> (t); AST_Type **supports = v->supports (); long n_supports = v->n_supports (); @@ -467,7 +453,7 @@ AST_Interface::redef_clash_populate_r (AST_Type *t) } else if (nt == AST_Decl::NT_component) { - AST_Component *c = AST_Component::narrow_from_decl (t); + AST_Component *c = dynamic_cast<AST_Component*> (t); AST_Type **supports = c->supports (); long n_supports = c->n_supports (); @@ -507,7 +493,7 @@ AST_Interface::insert_non_dup (AST_Type *t, bool abstract_paths_only) { AST_Interface *f = - AST_Interface::narrow_from_decl (t); + dynamic_cast<AST_Interface*> (t); // Now check if the dequeued element has any ancestors. If yes, insert // them inside the queue making sure that there are no duplicates. @@ -829,7 +815,7 @@ AST_Interface::look_in_inherited (UTL_ScopedName *e, nis--, is++) { AST_Interface *i = - AST_Interface::narrow_from_decl (*is); + dynamic_cast<AST_Interface*> (*is); if (i == 0) { @@ -897,7 +883,7 @@ AST_Interface::look_in_inherited_local (Identifier *e, nis--, is++) { AST_Interface *i = - AST_Interface::narrow_from_decl (*is); + dynamic_cast<AST_Interface*> (*is); if (i == 0) { @@ -1010,7 +996,7 @@ AST_Interface::analyze_parentage (void) for (long i = 0; i < this->pd_n_inherits; ++i) { AST_Interface *parent = - AST_Interface::narrow_from_decl (this->pd_inherits[i]); + dynamic_cast<AST_Interface*> (this->pd_inherits[i]); if (parent == 0) { @@ -1035,7 +1021,7 @@ AST_Interface::analyze_parentage (void) while (s != 0) { AST_Template_Module *m = - AST_Template_Module::narrow_from_scope (s); + dynamic_cast<AST_Template_Module*> (s); if (m != 0) { @@ -1151,6 +1137,3 @@ AST_Interface::annotatable () const { return true; } - -IMPL_NARROW_FROM_DECL(AST_Interface) -IMPL_NARROW_FROM_SCOPE(AST_Interface) diff --git a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp index 655008fd030..9eeb47cc4c7 100644 --- a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp @@ -136,14 +136,14 @@ AST_InterfaceFwd::full_def_seen (void) if (AST_Decl::NT_module == s->scope_node_type ()) { - AST_Module *m = AST_Module::narrow_from_scope (s); + AST_Module *m = dynamic_cast<AST_Module*> (s); AST_Decl *d = m->look_in_prev_mods_local (this->local_name (), false); if (0 != d) { - i = AST_Interface::narrow_from_decl (d); + i = dynamic_cast<AST_Interface*> (d); if (0 != i && i->is_defined ()) { @@ -156,7 +156,7 @@ AST_InterfaceFwd::full_def_seen (void) !iter.is_done (); iter.next ()) { - i = AST_Interface::narrow_from_decl (iter.item ()); + i = dynamic_cast<AST_Interface*> (iter.item ()); if (0 != i && this->local_name ()->compare (i->local_name ())) { @@ -224,7 +224,7 @@ AST_InterfaceFwd::is_defined (void) if (!this->is_defined_) { AST_Module *m = - AST_Module::narrow_from_scope (this->defined_in ()); + dynamic_cast<AST_Module*> (this->defined_in ()); if (0 != m) { @@ -242,7 +242,7 @@ AST_InterfaceFwd::is_defined (void) } AST_InterfaceFwd *fwd = - AST_InterfaceFwd::narrow_from_decl (d); + dynamic_cast<AST_InterfaceFwd*> (d); // Since fwd_redefinition_helper() is called // before fe_add_interface(), we can't check @@ -306,5 +306,3 @@ AST_InterfaceFwd::adjust_found ( return this; } - -IMPL_NARROW_FROM_DECL (AST_InterfaceFwd) diff --git a/TAO/TAO_IDL/ast/ast_mirror_port.cpp b/TAO/TAO_IDL/ast/ast_mirror_port.cpp index 640e556d5ea..c9456fa137a 100644 --- a/TAO/TAO_IDL/ast/ast_mirror_port.cpp +++ b/TAO/TAO_IDL/ast/ast_mirror_port.cpp @@ -47,6 +47,3 @@ AST_Mirror_Port::ast_accept (ast_visitor *visitor) { return visitor->visit_mirror_port (this); } - -IMPL_NARROW_FROM_DECL (AST_Mirror_Port) - diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp index b428d3c5dd6..7161b5b66a4 100644 --- a/TAO/TAO_IDL/ast/ast_module.cpp +++ b/TAO/TAO_IDL/ast/ast_module.cpp @@ -131,9 +131,6 @@ AST_Module::destroy (void) this->AST_Decl::destroy (); } -IMPL_NARROW_FROM_DECL(AST_Module) -IMPL_NARROW_FROM_SCOPE(AST_Module) - // Dump this AST_Module node to the ostream o. void AST_Module::dump (ACE_OSTREAM_TYPE &o) @@ -164,7 +161,7 @@ AST_Module::set_has_nested_valuetype (void) UTL_Scope *parent = this->defined_in (); if (parent && !this->pd_has_nested_valuetype_) { - AST_Module *pm = AST_Module::narrow_from_scope (parent); + AST_Module *pm = dynamic_cast<AST_Module*> (parent); if (pm) { pm->set_has_nested_valuetype (); @@ -226,7 +223,7 @@ AST_Module::referenced (AST_Decl *e, return false; } - AST_Type *t = AST_Type::narrow_from_decl (d); + AST_Type *t = dynamic_cast<AST_Type*> (d); return (!t || t->is_defined ()); } @@ -345,7 +342,7 @@ AST_Module::special_lookup (UTL_ScopedName *e, AST_PredefinedType * AST_Module::fe_add_predefined_type (AST_PredefinedType *t) { - return AST_PredefinedType::narrow_from_decl ( + return dynamic_cast<AST_PredefinedType*> ( this->fe_add_decl (t)); } @@ -393,7 +390,7 @@ AST_Module::fe_add_module (AST_Module *t) } // has_ancestor() returns TRUE if both nodes are the same. - m = AST_Module::narrow_from_decl (d); + m = dynamic_cast<AST_Module*> (d); if (t != m && t->has_ancestor (d)) { idl_global->err ()->redefinition_in_scope (t, d); @@ -464,7 +461,7 @@ AST_Template_Module_Inst * AST_Module::fe_add_template_module_inst (AST_Template_Module_Inst *t) { return - AST_Template_Module_Inst::narrow_from_decl ( + dynamic_cast<AST_Template_Module_Inst*> ( this->fe_add_ref_decl (t)); } @@ -479,7 +476,7 @@ AST_ValueBox * AST_Module::fe_add_valuebox (AST_ValueBox *t) { return - AST_ValueBox::narrow_from_decl ( + dynamic_cast<AST_ValueBox*> ( this->fe_add_decl (t)); } @@ -508,7 +505,7 @@ AST_Connector * AST_Module::fe_add_connector (AST_Connector *t) { return - AST_Connector::narrow_from_decl ( + dynamic_cast<AST_Connector*> ( this->fe_add_decl (t)); } @@ -516,7 +513,7 @@ AST_Home * AST_Module::fe_add_home (AST_Home *t) { return - AST_Home::narrow_from_decl ( + dynamic_cast<AST_Home*> ( this->fe_add_decl (t)); } @@ -552,7 +549,7 @@ AST_Constant * AST_Module::fe_add_constant (AST_Constant *t) { return - AST_Constant::narrow_from_decl ( + dynamic_cast<AST_Constant*> ( this->fe_add_decl (t)); } @@ -560,7 +557,7 @@ AST_Exception * AST_Module::fe_add_exception (AST_Exception *t) { return - AST_Exception::narrow_from_decl ( + dynamic_cast<AST_Exception*> ( this->fe_add_decl (t)); } @@ -568,7 +565,7 @@ AST_Union * AST_Module::fe_add_union (AST_Union *t) { return - AST_Union::narrow_from_decl ( + dynamic_cast<AST_Union*> ( this->fe_add_full_struct_type (t)); } @@ -576,7 +573,7 @@ AST_UnionFwd * AST_Module::fe_add_union_fwd (AST_UnionFwd *t) { return - AST_UnionFwd::narrow_from_decl ( + dynamic_cast<AST_UnionFwd*> ( this->fe_add_fwd_struct_type (t)); } @@ -596,7 +593,7 @@ AST_Enum * AST_Module::fe_add_enum (AST_Enum *t) { return - AST_Enum::narrow_from_decl ( + dynamic_cast<AST_Enum*> ( this->fe_add_decl (t)); } @@ -608,7 +605,7 @@ AST_EnumVal * AST_Module::fe_add_enum_val (AST_EnumVal *t) { return - AST_EnumVal::narrow_from_decl ( + dynamic_cast<AST_EnumVal*> ( this->fe_add_decl (t)); } @@ -616,7 +613,7 @@ AST_Typedef * AST_Module::fe_add_typedef (AST_Typedef *t) { return - AST_Typedef::narrow_from_decl ( + dynamic_cast<AST_Typedef*> ( this->fe_add_ref_decl (t)); } @@ -624,7 +621,7 @@ AST_Native * AST_Module::fe_add_native (AST_Native *t) { return - AST_Native::narrow_from_decl ( + dynamic_cast<AST_Native*> ( this->fe_add_decl (t)); } @@ -632,7 +629,7 @@ AST_PortType * AST_Module::fe_add_porttype (AST_PortType *t) { return - AST_PortType::narrow_from_decl ( + dynamic_cast<AST_PortType*> ( this->fe_add_decl (t)); } @@ -646,6 +643,6 @@ AST_Annotation_Decl * AST_Module::fe_add_annotation_decl ( AST_Annotation_Decl *annotation_decl) { - return AST_Annotation_Decl::narrow_from_decl ( + return dynamic_cast<AST_Annotation_Decl*> ( fe_add_decl (annotation_decl)); } diff --git a/TAO/TAO_IDL/ast/ast_native.cpp b/TAO/TAO_IDL/ast/ast_native.cpp index db4cbca8c65..a07ccfc1e33 100644 --- a/TAO/TAO_IDL/ast/ast_native.cpp +++ b/TAO/TAO_IDL/ast/ast_native.cpp @@ -45,7 +45,3 @@ AST_Native::ast_accept (ast_visitor *visitor) { return visitor->visit_native (this); } - - - -IMPL_NARROW_FROM_DECL(AST_Native) diff --git a/TAO/TAO_IDL/ast/ast_operation.cpp b/TAO/TAO_IDL/ast/ast_operation.cpp index d82257840b4..653da88fd75 100644 --- a/TAO/TAO_IDL/ast/ast_operation.cpp +++ b/TAO/TAO_IDL/ast/ast_operation.cpp @@ -122,7 +122,7 @@ AST_Operation::AST_Operation (AST_Type *rt, } else { - pdt = AST_PredefinedType::narrow_from_decl (rt); + pdt = dynamic_cast<AST_PredefinedType*> (rt); if (pdt == 0 || pdt->pt () != AST_PredefinedType::PT_void) { @@ -145,7 +145,7 @@ AST_Operation::void_return_type (void) AST_Type* type = this->return_type (); return (type->node_type () == AST_Decl::NT_pre_defined - && (AST_PredefinedType::narrow_from_decl (type)->pt () + && (dynamic_cast<AST_PredefinedType*> (type)->pt () == AST_PredefinedType::PT_void)); } @@ -177,7 +177,7 @@ AST_Operation::count_arguments_with_direction (int direction_mask) si.next ()) { AST_Argument *arg = - AST_Argument::narrow_from_decl (si.item ()); + dynamic_cast<AST_Argument*> (si.item ()); if ((arg->direction () & direction_mask) != 0) { @@ -264,7 +264,7 @@ AST_Operation::compute_argument_attr (void) { this->argument_count_++; - arg = AST_Argument::narrow_from_decl (d); + arg = dynamic_cast<AST_Argument*> (d); if (arg->direction() == AST_Argument::dir_IN || arg->direction() == AST_Argument::dir_INOUT) @@ -273,7 +273,7 @@ AST_Operation::compute_argument_attr (void) } - type = AST_Type::narrow_from_decl (arg->field_type ()); + type = dynamic_cast<AST_Type*> (arg->field_type ()); if (type->node_type () == AST_Decl::NT_native) { @@ -283,7 +283,7 @@ AST_Operation::compute_argument_attr (void) } } - type = AST_Type::narrow_from_decl (this->return_type ()); + type = dynamic_cast<AST_Type*> (this->return_type ()); if (type->node_type () == AST_Decl::NT_native) { @@ -343,7 +343,7 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t) case AST_Decl::NT_param_holder: { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (d); + dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; @@ -359,7 +359,7 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t) case AST_Decl::NT_typedef: { AST_Typedef *td = - AST_Typedef::narrow_from_decl (d); + dynamic_cast<AST_Typedef*> (d); nt = td->primitive_base_type ()->node_type (); @@ -399,7 +399,7 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t) bool oneway_op = (this->flags () == AST_Operation::OP_oneway); - fe = AST_Type::narrow_from_decl (d); + fe = dynamic_cast<AST_Type*> (d); if (oneway_op && fe != 0) { @@ -446,7 +446,7 @@ AST_Argument * AST_Operation::fe_add_argument (AST_Argument *t) { return - AST_Argument::narrow_from_decl ( + dynamic_cast<AST_Argument*> ( this->fe_add_decl (t)); } @@ -566,6 +566,3 @@ AST_Operation::annotatable () const { return true; } - -IMPL_NARROW_FROM_DECL(AST_Operation) -IMPL_NARROW_FROM_SCOPE(AST_Operation) diff --git a/TAO/TAO_IDL/ast/ast_param_holder.cpp b/TAO/TAO_IDL/ast/ast_param_holder.cpp index a421873ba19..aa4ac97a198 100644 --- a/TAO/TAO_IDL/ast/ast_param_holder.cpp +++ b/TAO/TAO_IDL/ast/ast_param_holder.cpp @@ -44,6 +44,3 @@ void AST_Param_Holder::dump (ACE_OSTREAM_TYPE & /* o */) { } - -IMPL_NARROW_FROM_DECL (AST_Param_Holder) - diff --git a/TAO/TAO_IDL/ast/ast_porttype.cpp b/TAO/TAO_IDL/ast/ast_porttype.cpp index 28e9cf634c0..96d9f397f1c 100644 --- a/TAO/TAO_IDL/ast/ast_porttype.cpp +++ b/TAO/TAO_IDL/ast/ast_porttype.cpp @@ -48,7 +48,7 @@ AST_Provides * AST_PortType::fe_add_provides (AST_Provides *p) { return - AST_Provides::narrow_from_decl ( + dynamic_cast<AST_Provides*> ( this->fe_add_ref_decl (p)); } @@ -56,7 +56,7 @@ AST_Uses * AST_PortType::fe_add_uses (AST_Uses *u) { return - AST_Uses::narrow_from_decl ( + dynamic_cast<AST_Uses*> ( this->fe_add_ref_decl (u)); } @@ -64,10 +64,6 @@ AST_Attribute * AST_PortType::fe_add_attribute (AST_Attribute *t) { return - AST_Attribute::narrow_from_decl ( + dynamic_cast<AST_Attribute*> ( this->fe_add_decl (t)); } - -IMPL_NARROW_FROM_DECL (AST_PortType) -IMPL_NARROW_FROM_SCOPE (AST_PortType) - diff --git a/TAO/TAO_IDL/ast/ast_predefined_type.cpp b/TAO/TAO_IDL/ast/ast_predefined_type.cpp index db6d0923737..8ce1533a825 100644 --- a/TAO/TAO_IDL/ast/ast_predefined_type.cpp +++ b/TAO/TAO_IDL/ast/ast_predefined_type.cpp @@ -272,7 +272,3 @@ AST_PredefinedType::pt (void) { return this->pd_pt; } - - - -IMPL_NARROW_FROM_DECL(AST_PredefinedType) diff --git a/TAO/TAO_IDL/ast/ast_provides.cpp b/TAO/TAO_IDL/ast/ast_provides.cpp index 07bfd679480..aa7e07267f6 100644 --- a/TAO/TAO_IDL/ast/ast_provides.cpp +++ b/TAO/TAO_IDL/ast/ast_provides.cpp @@ -44,5 +44,3 @@ AST_Provides::destroy (void) { this->AST_Field::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_Provides) diff --git a/TAO/TAO_IDL/ast/ast_publishes.cpp b/TAO/TAO_IDL/ast/ast_publishes.cpp index 07a31eb4d41..7d44b54be22 100644 --- a/TAO/TAO_IDL/ast/ast_publishes.cpp +++ b/TAO/TAO_IDL/ast/ast_publishes.cpp @@ -43,5 +43,3 @@ AST_Publishes::destroy (void) { this->AST_Field::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_Publishes) diff --git a/TAO/TAO_IDL/ast/ast_recursive.cpp b/TAO/TAO_IDL/ast/ast_recursive.cpp index d981d3cddb6..6f483984d17 100644 --- a/TAO/TAO_IDL/ast/ast_recursive.cpp +++ b/TAO/TAO_IDL/ast/ast_recursive.cpp @@ -120,7 +120,7 @@ AST_illegal_recursive_type (AST_Decl *t) } AST_Decl::NodeType nt; - AST_Type *ut = AST_Type::narrow_from_decl (t); + AST_Type *ut = dynamic_cast<AST_Type*> (t); if (ut != 0) { @@ -152,7 +152,7 @@ AST_illegal_recursive_type (AST_Decl *t) if (t->node_type () == AST_Decl::NT_struct) { check_for_struct = true; - st1 = AST_Structure::narrow_from_decl (t); + st1 = dynamic_cast<AST_Structure*> (t); if (st1 == 0) { @@ -162,7 +162,7 @@ AST_illegal_recursive_type (AST_Decl *t) else if (t->node_type () == AST_Decl::NT_union) { check_for_union = true; - un1 = AST_Union::narrow_from_decl (t); + un1 = dynamic_cast<AST_Union*> (t); if (un1 == 0) { @@ -192,7 +192,7 @@ AST_illegal_recursive_type (AST_Decl *t) if (s->scope_node_type () == AST_Decl::NT_struct && check_for_struct == true) { - st2 = AST_Structure::narrow_from_scope (s); + st2 = dynamic_cast<AST_Structure*> (s); if (st2 != 0 && st2 == st1) { @@ -202,7 +202,7 @@ AST_illegal_recursive_type (AST_Decl *t) else if (s->scope_node_type () == AST_Decl::NT_union && check_for_union == true) { - un2 = AST_Union::narrow_from_scope (s); + un2 = dynamic_cast<AST_Union*> (s); if (un2 != 0 && un2 == un1) { diff --git a/TAO/TAO_IDL/ast/ast_root.cpp b/TAO/TAO_IDL/ast/ast_root.cpp index 220b85babc3..51106457bd3 100644 --- a/TAO/TAO_IDL/ast/ast_root.cpp +++ b/TAO/TAO_IDL/ast/ast_root.cpp @@ -220,6 +220,3 @@ AST_Root::fini (void) this->UTL_Scope::destroy (); this->AST_Decl::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_Root) -IMPL_NARROW_FROM_SCOPE(AST_Root) diff --git a/TAO/TAO_IDL/ast/ast_sequence.cpp b/TAO/TAO_IDL/ast/ast_sequence.cpp index 0ab4820c2da..6d1c20adb60 100644 --- a/TAO/TAO_IDL/ast/ast_sequence.cpp +++ b/TAO/TAO_IDL/ast/ast_sequence.cpp @@ -114,7 +114,7 @@ AST_Sequence::AST_Sequence (AST_Expression *ms, if (bnt == AST_Decl::NT_param_holder) { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (bt); + dynamic_cast<AST_Param_Holder*> (bt); if (ph->info ()->type_ == AST_Decl::NT_const) { @@ -159,7 +159,7 @@ AST_Sequence::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) list.enqueue_tail(this); - AST_Type *type = AST_Type::narrow_from_decl (this->base_type ()); + AST_Type *type = dynamic_cast<AST_Type*> (this->base_type ()); if (type == 0) { @@ -173,7 +173,7 @@ AST_Sequence::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) if (nt == AST_Decl::NT_typedef) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (type); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (type); type = td->primitive_base_type (); nt = type->node_type (); } @@ -281,8 +281,6 @@ AST_Sequence::destroy (void) this->AST_ConcreteType::destroy (); } -IMPL_NARROW_FROM_DECL(AST_Sequence) - AST_Annotation_Appls & AST_Sequence::base_type_annotations () { diff --git a/TAO/TAO_IDL/ast/ast_string.cpp b/TAO/TAO_IDL/ast/ast_string.cpp index 18366d6d89f..21b82bade87 100644 --- a/TAO/TAO_IDL/ast/ast_string.cpp +++ b/TAO/TAO_IDL/ast/ast_string.cpp @@ -192,7 +192,3 @@ AST_String::width (void) { return this->pd_width; } - - - -IMPL_NARROW_FROM_DECL(AST_String) diff --git a/TAO/TAO_IDL/ast/ast_structure.cpp b/TAO/TAO_IDL/ast/ast_structure.cpp index 0bd62aa3c8c..401abd7dd93 100644 --- a/TAO/TAO_IDL/ast/ast_structure.cpp +++ b/TAO/TAO_IDL/ast/ast_structure.cpp @@ -159,7 +159,7 @@ AST_Structure::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) !si.is_done (); si.next ()) { - AST_Field *field = AST_Field::narrow_from_decl (si.item ()); + AST_Field *field = dynamic_cast<AST_Field*> (si.item ()); if (field == 0) // This will be an enum value or other legitimate non-field @@ -172,7 +172,7 @@ AST_Structure::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) if (type->node_type () == AST_Decl::NT_typedef) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (type); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (type); type = td->primitive_base_type (); } @@ -300,7 +300,7 @@ AST_Structure::legal_for_primary_key (void) const !si.is_done (); si.next ()) { - AST_Field *f = AST_Field::narrow_from_decl (si.item ()); + AST_Field *f = dynamic_cast<AST_Field*> (si.item ()); if (f != 0 && !f->field_type ()->legal_for_primary_key ()) { @@ -351,7 +351,7 @@ AST_Union * AST_Structure::fe_add_union (AST_Union *t) { return - AST_Union::narrow_from_decl ( + dynamic_cast<AST_Union*> ( this->fe_add_full_struct_type (t)); } @@ -359,7 +359,7 @@ AST_Enum * AST_Structure::fe_add_enum (AST_Enum *t) { return - AST_Enum::narrow_from_decl ( + dynamic_cast<AST_Enum*> ( this->fe_add_decl (t)); } @@ -371,7 +371,7 @@ AST_EnumVal * AST_Structure::fe_add_enum_val (AST_EnumVal *t) { return - AST_EnumVal::narrow_from_decl ( + dynamic_cast<AST_EnumVal*> ( this->fe_add_decl (t)); } @@ -450,7 +450,7 @@ AST_Structure::fwd_redefinition_helper (AST_Structure *&i, || nt == AST_Decl::NT_union_fwd) { AST_StructureFwd *fwd_def = - AST_StructureFwd::narrow_from_decl (d); + dynamic_cast<AST_StructureFwd*> (d); fd = fwd_def->full_definition (); } @@ -458,7 +458,7 @@ AST_Structure::fwd_redefinition_helper (AST_Structure *&i, else if (nt == AST_Decl::NT_struct || nt == AST_Decl::NT_union) { - fd = AST_Structure::narrow_from_decl (d); + fd = dynamic_cast<AST_Structure*> (d); } // Successful? @@ -552,7 +552,7 @@ AST_Structure::compute_size_type (void) continue; } - AST_Field *f = AST_Field::narrow_from_decl (d); + AST_Field *f = dynamic_cast<AST_Field*> (d); AST_Type *t = f->field_type (); if (t != 0) @@ -566,7 +566,7 @@ AST_Structure::compute_size_type (void) { ACE_DEBUG ((LM_DEBUG, "WARNING (%N:%l) be_structure::compute_size_type - " - "narrow_from_decl returned 0\n")); + "dynamic_cast returned 0\n")); } } @@ -586,9 +586,6 @@ AST_Structure::destroy (void) this->UTL_Scope::destroy (); } -IMPL_NARROW_FROM_DECL(AST_Structure) -IMPL_NARROW_FROM_SCOPE(AST_Structure) - bool AST_Structure::annotatable () const { return true; diff --git a/TAO/TAO_IDL/ast/ast_structure_fwd.cpp b/TAO/TAO_IDL/ast/ast_structure_fwd.cpp index 6f444e67dae..ea9771c9770 100644 --- a/TAO/TAO_IDL/ast/ast_structure_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_structure_fwd.cpp @@ -109,5 +109,3 @@ AST_StructureFwd::adjust_found ( return this; } - -IMPL_NARROW_FROM_DECL (AST_StructureFwd) diff --git a/TAO/TAO_IDL/ast/ast_template_module.cpp b/TAO/TAO_IDL/ast/ast_template_module.cpp index 364040dc4ca..254a1c5b275 100644 --- a/TAO/TAO_IDL/ast/ast_template_module.cpp +++ b/TAO/TAO_IDL/ast/ast_template_module.cpp @@ -62,7 +62,7 @@ AST_Template_Module::match_arg_names (FE_Utils::T_ARGLIST *args) if (d->node_type () == AST_Decl::NT_typedef) { AST_Typedef *td = - AST_Typedef::narrow_from_decl (d); + dynamic_cast<AST_Typedef*> (d); d = td->primitive_base_type (); } @@ -78,7 +78,7 @@ AST_Template_Module::match_arg_names (FE_Utils::T_ARGLIST *args) if (n == 0) { AST_Constant *c = - AST_Constant::narrow_from_decl (d); + dynamic_cast<AST_Constant*> (d); s = c->exprtype_to_string (); } @@ -105,7 +105,7 @@ AST_Template_Module::match_param_refs (UTL_StrList *refs, while (enclosing == 0 && s != 0) { - enclosing = AST_Template_Module::narrow_from_scope (s); + enclosing = dynamic_cast<AST_Template_Module*> (s); s = ScopeAsDecl (s)->defined_in (); } @@ -162,7 +162,7 @@ AST_Template_Module::fe_add_template_module_ref ( AST_Template_Module_Ref *m) { return - AST_Template_Module_Ref::narrow_from_decl ( + dynamic_cast<AST_Template_Module_Ref*> ( this->fe_add_ref_decl (m)); } @@ -182,7 +182,7 @@ AST_Template_Module::match_one_param (FE_Utils::T_Param_Info *param, if (d->node_type () == AST_Decl::NT_typedef) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (d); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (d); d = td->primitive_base_type (); } @@ -191,7 +191,7 @@ AST_Template_Module::match_one_param (FE_Utils::T_Param_Info *param, if (other_type == AST_Decl::NT_const) { AST_Constant *c = - AST_Constant::narrow_from_decl (d); + dynamic_cast<AST_Constant*> (d); AST_Expression *ex = c->constant_value (); @@ -278,7 +278,3 @@ AST_Template_Module::match_param_by_type ( return false; } - -IMPL_NARROW_FROM_DECL (AST_Template_Module) -IMPL_NARROW_FROM_SCOPE (AST_Template_Module) - diff --git a/TAO/TAO_IDL/ast/ast_template_module_inst.cpp b/TAO/TAO_IDL/ast/ast_template_module_inst.cpp index 1156d1b020d..6f0a4874149 100644 --- a/TAO/TAO_IDL/ast/ast_template_module_inst.cpp +++ b/TAO/TAO_IDL/ast/ast_template_module_inst.cpp @@ -28,7 +28,7 @@ AST_Template_Module * AST_Template_Module_Inst::ref (void) const { return - AST_Template_Module::narrow_from_decl (this->field_type ()); + dynamic_cast<AST_Template_Module*> (this->field_type ()); } FE_Utils::T_ARGLIST const * @@ -58,6 +58,3 @@ AST_Template_Module_Inst::ast_accept (ast_visitor *visitor) { return visitor->visit_template_module_inst (this); } - -IMPL_NARROW_FROM_DECL (AST_Template_Module_Inst) - diff --git a/TAO/TAO_IDL/ast/ast_template_module_ref.cpp b/TAO/TAO_IDL/ast/ast_template_module_ref.cpp index 4110fe518d6..b3152255c38 100644 --- a/TAO/TAO_IDL/ast/ast_template_module_ref.cpp +++ b/TAO/TAO_IDL/ast/ast_template_module_ref.cpp @@ -31,7 +31,7 @@ AST_Template_Module * AST_Template_Module_Ref::ref (void) const { return - AST_Template_Module::narrow_from_decl (this->field_type ()); + dynamic_cast<AST_Template_Module*> (this->field_type ()); } UTL_StrList * @@ -87,6 +87,3 @@ AST_Template_Module_Ref::processed (bool val) { this->processed_ = val; } - -IMPL_NARROW_FROM_DECL (AST_Template_Module_Ref) - diff --git a/TAO/TAO_IDL/ast/ast_type.cpp b/TAO/TAO_IDL/ast/ast_type.cpp index 899ab6257ca..f9cb40d2297 100644 --- a/TAO/TAO_IDL/ast/ast_type.cpp +++ b/TAO/TAO_IDL/ast/ast_type.cpp @@ -217,7 +217,7 @@ AST_Type::unaliased_type (void) while (nt == AST_Decl::NT_typedef) { - td = AST_Typedef::narrow_from_decl (t); + td = dynamic_cast<AST_Typedef*> (t); t = td->base_type (); nt = t->node_type (); } @@ -542,5 +542,3 @@ AST_Type::destroy (void) this->AST_Decl::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_Type) diff --git a/TAO/TAO_IDL/ast/ast_typedef.cpp b/TAO/TAO_IDL/ast/ast_typedef.cpp index 4d682812334..d54bd51ec86 100644 --- a/TAO/TAO_IDL/ast/ast_typedef.cpp +++ b/TAO/TAO_IDL/ast/ast_typedef.cpp @@ -111,8 +111,8 @@ AST_Typedef::primitive_base_type (void) const while (d && d->node_type () == AST_Decl::NT_typedef) { - temp = AST_Typedef::narrow_from_decl (d); - d = AST_Type::narrow_from_decl (temp->base_type ()); + temp = dynamic_cast<AST_Typedef*> (d); + d = dynamic_cast<AST_Type*> (temp->base_type ()); } return d; @@ -196,8 +196,6 @@ AST_Typedef::destroy (void) this->AST_Type::destroy (); } -IMPL_NARROW_FROM_DECL(AST_Typedef) - AST_Annotation_Appls & AST_Typedef::annotations () { diff --git a/TAO/TAO_IDL/ast/ast_union.cpp b/TAO/TAO_IDL/ast/ast_union.cpp index ba352d8d7e6..7db3dbf9ba0 100644 --- a/TAO/TAO_IDL/ast/ast_union.cpp +++ b/TAO/TAO_IDL/ast/ast_union.cpp @@ -123,7 +123,7 @@ AST_Union::AST_Union (AST_ConcreteType *dt, // the pd_udisc_type field. if (dt->node_type () == AST_Decl::NT_pre_defined) { - pdt = AST_PredefinedType::narrow_from_decl (dt); + pdt = dynamic_cast<AST_PredefinedType*> (dt); if (pdt == 0) { @@ -200,7 +200,7 @@ AST_Union::~AST_Union (void) void AST_Union::redefine (AST_Structure *from) { - AST_Union *u = AST_Union::narrow_from_decl (from); + AST_Union *u = dynamic_cast<AST_Union*> (from); if (u == 0) { @@ -266,7 +266,7 @@ AST_Union::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) si.next ()) { AST_UnionBranch *field = - AST_UnionBranch::narrow_from_decl (si.item ()); + dynamic_cast<AST_UnionBranch*> (si.item ()); if (field == 0) // This will be an enum value or other legitimate non-field @@ -279,7 +279,7 @@ AST_Union::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) if (type->node_type () == AST_Decl::NT_typedef) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (type); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (type); type = td->primitive_base_type (); } @@ -323,7 +323,7 @@ AST_Union::lookup_default (void) if (d->node_type () == AST_Decl::NT_union_branch) { - b = AST_UnionBranch::narrow_from_decl (d); + b = dynamic_cast<AST_UnionBranch*> (d); if (b == 0) { @@ -375,7 +375,7 @@ AST_Union::lookup_label (AST_UnionBranch *b) if (d->node_type () == AST_Decl::NT_union_branch) { - fb = AST_UnionBranch::narrow_from_decl (d); + fb = dynamic_cast<AST_UnionBranch*> (d); if (fb == 0) { @@ -405,7 +405,7 @@ AST_Union::lookup_enum (AST_UnionBranch *b) { AST_UnionLabel *label = b->label(); AST_Expression *lv = label->label_val (); - AST_Enum *e = AST_Enum::narrow_from_decl (this->pd_disc_type); + AST_Enum *e = dynamic_cast<AST_Enum*> (this->pd_disc_type); AST_Decl *d = 0; AST_UnionBranch *fb = 0; @@ -450,7 +450,7 @@ AST_Union::lookup_enum (AST_UnionBranch *b) if (d->node_type () == AST_Decl::NT_union_branch) { - fb = AST_UnionBranch::narrow_from_decl (d); + fb = dynamic_cast<AST_UnionBranch*> (d); if (fb == 0) { @@ -549,7 +549,7 @@ AST_Union::compute_default_value (void) { // Get the next AST decl node. AST_UnionBranch *ub = - AST_UnionBranch::narrow_from_decl (si.item ()); + dynamic_cast<AST_UnionBranch*> (si.item ()); if (ub != 0) { @@ -716,7 +716,7 @@ AST_Union::compute_default_value (void) { // Get the next AST decl node AST_UnionBranch *ub = - AST_UnionBranch::narrow_from_decl (si.item ()); + dynamic_cast<AST_UnionBranch*> (si.item ()); if (ub != 0) { @@ -895,7 +895,7 @@ AST_Union::compute_default_index (void) if (!d->imported ()) { - ub = AST_UnionBranch::narrow_from_decl (d); + ub = dynamic_cast<AST_UnionBranch*> (d); for (unsigned long j = 0; j < ub->label_list_length (); ++j) { @@ -925,7 +925,7 @@ AST_UnionBranch * AST_Union::fe_add_union_branch (AST_UnionBranch *t) { return - AST_UnionBranch::narrow_from_decl ( + dynamic_cast<AST_UnionBranch*> ( this->fe_add_ref_decl (t)); } @@ -933,7 +933,7 @@ AST_Union * AST_Union::fe_add_union (AST_Union *t) { return - AST_Union::narrow_from_decl ( + dynamic_cast<AST_Union*> ( this->fe_add_full_struct_type (t)); } @@ -947,7 +947,7 @@ AST_Enum * AST_Union::fe_add_enum (AST_Enum *t) { return - AST_Enum::narrow_from_decl ( + dynamic_cast<AST_Enum*> ( this->fe_add_decl (t)); } @@ -959,7 +959,7 @@ AST_EnumVal * AST_Union::fe_add_enum_val (AST_EnumVal *t) { return - AST_EnumVal::narrow_from_decl ( + dynamic_cast<AST_EnumVal*> ( this->fe_add_decl (t)); } @@ -1001,7 +1001,7 @@ AST_Union::compute_size_type (void) continue; } - AST_Field *f = AST_Field::narrow_from_decl (d); + AST_Field *f = dynamic_cast<AST_Field*> (d); if (f != 0) { @@ -1016,7 +1016,7 @@ AST_Union::compute_size_type (void) { ACE_DEBUG ((LM_DEBUG, "WARNING (%N:%l) be_union::compute_size_type - " - "narrow_from_decl returned 0\n")); + "dynamic_cast returned 0\n")); } } @@ -1043,9 +1043,6 @@ AST_Union::udisc_type (void) return this->pd_udisc_type; } -IMPL_NARROW_FROM_DECL(AST_Union) -IMPL_NARROW_FROM_SCOPE(AST_Union) - AST_Annotation_Appls & AST_Union::disc_annotations () { diff --git a/TAO/TAO_IDL/ast/ast_union_branch.cpp b/TAO/TAO_IDL/ast/ast_union_branch.cpp index e0a205b9a87..19c0291fa1c 100644 --- a/TAO/TAO_IDL/ast/ast_union_branch.cpp +++ b/TAO/TAO_IDL/ast/ast_union_branch.cpp @@ -211,7 +211,7 @@ AST_UnionBranch::add_labels (AST_Union *u) if (enum_labels) { ex->ev ()->et = AST_Expression::EV_enum; - AST_Enum *disc = AST_Enum::narrow_from_decl (u->disc_type ()); + AST_Enum *disc = dynamic_cast<AST_Enum*> (u->disc_type ()); AST_EnumVal *dval = disc->lookup_by_value (ex); if (dval == 0) @@ -241,5 +241,3 @@ AST_UnionBranch::coerce_labels (AST_Union *u) lv->set_ev (lv->coerce (u->udisc_type ())); } } - -IMPL_NARROW_FROM_DECL(AST_UnionBranch) diff --git a/TAO/TAO_IDL/ast/ast_union_fwd.cpp b/TAO/TAO_IDL/ast/ast_union_fwd.cpp index df21ba3993a..97aa9e76881 100644 --- a/TAO/TAO_IDL/ast/ast_union_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_union_fwd.cpp @@ -48,7 +48,3 @@ AST_UnionFwd::destroy (void) { this->AST_StructureFwd::destroy (); } - - - -IMPL_NARROW_FROM_DECL (AST_UnionFwd) diff --git a/TAO/TAO_IDL/ast/ast_uses.cpp b/TAO/TAO_IDL/ast/ast_uses.cpp index 630a313f9ff..b770da8229a 100644 --- a/TAO/TAO_IDL/ast/ast_uses.cpp +++ b/TAO/TAO_IDL/ast/ast_uses.cpp @@ -52,5 +52,3 @@ AST_Uses::destroy (void) { this->AST_Field::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_Uses) diff --git a/TAO/TAO_IDL/ast/ast_valuebox.cpp b/TAO/TAO_IDL/ast/ast_valuebox.cpp index 9502a41a4ae..87ea113e996 100644 --- a/TAO/TAO_IDL/ast/ast_valuebox.cpp +++ b/TAO/TAO_IDL/ast/ast_valuebox.cpp @@ -49,7 +49,3 @@ AST_ValueBox::destroy (void) { this->AST_ConcreteType::destroy (); } - -IMPL_NARROW_FROM_DECL(AST_ValueBox) - - diff --git a/TAO/TAO_IDL/ast/ast_valuetype.cpp b/TAO/TAO_IDL/ast/ast_valuetype.cpp index 2f27d8ed3e6..a80a9836ef2 100644 --- a/TAO/TAO_IDL/ast/ast_valuetype.cpp +++ b/TAO/TAO_IDL/ast/ast_valuetype.cpp @@ -143,7 +143,7 @@ AST_ValueType::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) 0); } - AST_Field *field = AST_Field::narrow_from_decl (d); + AST_Field *field = dynamic_cast<AST_Field*> (d); if (field == 0) { @@ -162,7 +162,7 @@ AST_ValueType::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) if (type->node_type () == AST_Decl::NT_typedef) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (type); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (type); type = td->primitive_base_type (); } @@ -186,7 +186,7 @@ AST_ValueType::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) void AST_ValueType::redefine (AST_Interface *from) { - AST_ValueType *vt = AST_ValueType::narrow_from_decl (from); + AST_ValueType *vt = dynamic_cast<AST_ValueType*> (from); if (vt == 0) { @@ -276,7 +276,7 @@ AST_ValueType::look_in_supported (UTL_ScopedName *e, } AST_Interface *i = - AST_Interface::narrow_from_decl (*is); + dynamic_cast<AST_Interface*> (*is); d = (i)->lookup_by_name_r (e, full_def_only); @@ -357,7 +357,7 @@ AST_ValueType::legal_for_primary_key (void) const !i.is_done (); i.next ()) { - AST_Field *f = AST_Field::narrow_from_decl (i.item ()); + AST_Field *f = dynamic_cast<AST_Field*> (i.item ()); // We're not interested in any valuetype decls that aren't fields. if (f == 0) @@ -478,7 +478,7 @@ AST_Factory * AST_ValueType::fe_add_factory (AST_Factory *f) { return - AST_Factory::narrow_from_decl ( + dynamic_cast<AST_Factory*> ( this->fe_add_decl (f)); } @@ -497,7 +497,7 @@ AST_ValueType::derived_from_primary_key_base (const AST_ValueType *node, } AST_ValueType *concrete_parent = - AST_ValueType::narrow_from_decl (node->inherits_concrete ()); + dynamic_cast<AST_ValueType*> (node->inherits_concrete ()); if (this->derived_from_primary_key_base (concrete_parent, pk_base)) { @@ -508,7 +508,7 @@ AST_ValueType::derived_from_primary_key_base (const AST_ValueType *node, for (long i = 0; i < node->pd_n_inherits; ++i) { - AST_ValueType *tmp = AST_ValueType::narrow_from_decl (v[i]); + AST_ValueType *tmp = dynamic_cast<AST_ValueType*> (v[i]); if (this->derived_from_primary_key_base (tmp, pk_base)) { @@ -543,7 +543,7 @@ AST_ValueType::lookup_primary_key_base (void) const return 0; } - retval = AST_ValueType::narrow_from_decl (d); + retval = dynamic_cast<AST_ValueType*> (d); if (retval == 0) { @@ -556,7 +556,3 @@ AST_ValueType::lookup_primary_key_base (void) const return retval; } - -IMPL_NARROW_FROM_DECL(AST_ValueType) -IMPL_NARROW_FROM_SCOPE(AST_ValueType) - diff --git a/TAO/TAO_IDL/ast/ast_valuetype_fwd.cpp b/TAO/TAO_IDL/ast/ast_valuetype_fwd.cpp index 89b8a902a2c..09c082c9f20 100644 --- a/TAO/TAO_IDL/ast/ast_valuetype_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_valuetype_fwd.cpp @@ -50,7 +50,3 @@ AST_ValueTypeFwd::destroy (void) { this->AST_InterfaceFwd::destroy (); } - - - -IMPL_NARROW_FROM_DECL (AST_ValueTypeFwd) diff --git a/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp b/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp index 0a6132034c6..6ef4ba5333d 100644 --- a/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp +++ b/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp @@ -349,7 +349,7 @@ ast_visitor_reifying::visit_array (AST_Array *node) -1); } - bt = AST_Type::narrow_from_decl (this->reified_node_); + bt = dynamic_cast<AST_Type*> (this->reified_node_); AST_Expression **dims = node->dims (); AST_Expression *v = 0; @@ -379,7 +379,7 @@ ast_visitor_reifying::visit_array (AST_Array *node) } AST_Constant *c = - AST_Constant::narrow_from_decl (this->reified_node_); + dynamic_cast<AST_Constant*> (this->reified_node_); ACE_NEW_RETURN (v, AST_Expression (c->constant_value (), @@ -448,7 +448,7 @@ ast_visitor_reifying::visit_sequence (AST_Sequence *node) -1); } - bt = AST_Type::narrow_from_decl (this->reified_node_); + bt = dynamic_cast<AST_Type*> (this->reified_node_); AST_Expression *v = node->max_size (); AST_Param_Holder *ph = v->param_holder (); @@ -466,7 +466,7 @@ ast_visitor_reifying::visit_sequence (AST_Sequence *node) } AST_Constant *c = - AST_Constant::narrow_from_decl (this->reified_node_); + dynamic_cast<AST_Constant*> (this->reified_node_); v = c->constant_value (); } @@ -516,7 +516,7 @@ ast_visitor_reifying::visit_string (AST_String *node) } AST_Constant *c = - AST_Constant::narrow_from_decl (this->reified_node_); + dynamic_cast<AST_Constant*> (this->reified_node_); b = c->constant_value (); } @@ -645,7 +645,7 @@ ast_visitor_reifying::template_module_rel_name (AST_Decl *d) while (tmp != 0) { - if (AST_Template_Module::narrow_from_decl (tmp) != 0) + if (dynamic_cast<AST_Template_Module*> (tmp) != 0) { ACE_CString head (tmp->local_name ()->get_string ()); diff --git a/TAO/TAO_IDL/ast/ast_visitor_tmpl_module_inst.cpp b/TAO/TAO_IDL/ast/ast_visitor_tmpl_module_inst.cpp index 5edba8b1543..c26e5abf6e0 100644 --- a/TAO/TAO_IDL/ast/ast_visitor_tmpl_module_inst.cpp +++ b/TAO/TAO_IDL/ast/ast_visitor_tmpl_module_inst.cpp @@ -264,7 +264,7 @@ ast_visitor_tmpl_module_inst::visit_provides (AST_Provides *node) UTL_ScopedName sn (node->local_name (), 0); AST_Type *p_type = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->provides_type ())); AST_Provides *added_provides = @@ -282,7 +282,7 @@ ast_visitor_tmpl_module_inst::visit_uses (AST_Uses *node) UTL_ScopedName sn (node->local_name (), 0); AST_Type *u_type = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->uses_type ())); AST_Uses *added_uses = @@ -301,7 +301,7 @@ ast_visitor_tmpl_module_inst::visit_publishes (AST_Publishes *node) UTL_ScopedName sn (node->local_name (), 0); AST_Type *p_type = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->publishes_type ())); AST_Publishes *added_publishes = @@ -319,7 +319,7 @@ ast_visitor_tmpl_module_inst::visit_emits (AST_Emits *node) UTL_ScopedName sn (node->local_name (), 0); AST_Type *e_type = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->emits_type ())); AST_Emits *added_emits = @@ -336,7 +336,7 @@ ast_visitor_tmpl_module_inst::visit_consumes (AST_Consumes *node) UTL_ScopedName sn (node->local_name (), 0); AST_Type *c_type = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->consumes_type ())); AST_Consumes *added_consumes = @@ -352,7 +352,7 @@ ast_visitor_tmpl_module_inst::visit_extended_port ( AST_Extended_Port *node) { AST_PortType *pt = - AST_PortType::narrow_from_decl ( + dynamic_cast<AST_PortType*> ( this->reify_type (node->port_type ())); UTL_ScopedName sn (node->local_name (), 0); @@ -370,7 +370,7 @@ ast_visitor_tmpl_module_inst::visit_mirror_port ( AST_Mirror_Port *node) { AST_PortType *pt = - AST_PortType::narrow_from_decl ( + dynamic_cast<AST_PortType*> ( this->reify_type (node->port_type ())); UTL_ScopedName sn (node->local_name (), 0); @@ -387,7 +387,7 @@ int ast_visitor_tmpl_module_inst::visit_connector (AST_Connector *node) { AST_Connector *parent = - AST_Connector::narrow_from_decl ( + dynamic_cast<AST_Connector*> ( this->reify_type (node->base_connector ())); UTL_ScopedName sn (node->local_name (), 0); @@ -432,7 +432,7 @@ ast_visitor_tmpl_module_inst::visit_home (AST_Home *node) UTL_ScopedName *managed_comp_name = 0; AST_Component *managed_comp = - AST_Component::narrow_from_decl ( + dynamic_cast<AST_Component*> ( this->reify_type (node->managed_component ())); if (managed_comp != 0) @@ -443,7 +443,7 @@ ast_visitor_tmpl_module_inst::visit_home (AST_Home *node) UTL_ScopedName *p_key_name = 0; AST_ValueType *p_key = - AST_ValueType::narrow_from_decl ( + dynamic_cast<AST_ValueType*> ( this->reify_type (node->primary_key ())); if (p_key != 0) @@ -593,7 +593,7 @@ int ast_visitor_tmpl_module_inst::visit_union_branch (AST_UnionBranch *node) { AST_Type *ft = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->field_type ())); UTL_ScopedName sn (node->local_name (), 0); @@ -608,7 +608,7 @@ ast_visitor_tmpl_module_inst::visit_union_branch (AST_UnionBranch *node) // add_to_scope() so we need to reuse it. AST_Union *u = - AST_Union::narrow_from_scope (idl_global->scopes ().top ()); + dynamic_cast<AST_Union*> (idl_global->scopes ().top ()); u->fe_add_union_branch (added_branch); @@ -684,7 +684,7 @@ ast_visitor_tmpl_module_inst::visit_module (AST_Module *node) added_module->from_inst (this->tmi_); AST_Module *m = - AST_Module::narrow_from_scope (idl_global->scopes ().top ()); + dynamic_cast<AST_Module*> (idl_global->scopes ().top ()); m->fe_add_module (added_module); @@ -752,7 +752,7 @@ ast_visitor_tmpl_module_inst::visit_template_module_inst ( // Add the new module to the scope containing the template // module instantiation. AST_Module *m = - AST_Module::narrow_from_scope (idl_global->scopes ().top ()); + dynamic_cast<AST_Module*> (idl_global->scopes ().top ()); m->fe_add_module (instance); @@ -959,7 +959,7 @@ int ast_visitor_tmpl_module_inst::visit_attribute (AST_Attribute *node) { AST_Type *ft = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->field_type ())); AST_Attribute *added_attr = @@ -988,7 +988,7 @@ int ast_visitor_tmpl_module_inst::visit_operation (AST_Operation *node) { AST_Type *rt = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->return_type ())); Identifier id (node->local_name ()->get_string ()); @@ -1030,7 +1030,7 @@ int ast_visitor_tmpl_module_inst::visit_argument (AST_Argument *node) { AST_Type *t = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->field_type ())); if (t == 0) @@ -1056,7 +1056,7 @@ int ast_visitor_tmpl_module_inst::visit_typedef (AST_Typedef *node) { AST_Type *bt = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->base_type ())); UTL_ScopedName sn (node->local_name (), 0); @@ -1096,7 +1096,7 @@ ast_visitor_tmpl_module_inst::visit_constant (AST_Constant *node) } AST_Constant *c = - AST_Constant::narrow_from_decl (rv.reified_node ()); + dynamic_cast<AST_Constant*> (rv.reified_node ()); /// We don't use the reified node's ExprType here, since /// it was created from a template arg that (for const @@ -1162,7 +1162,7 @@ int ast_visitor_tmpl_module_inst::visit_field (AST_Field *node) { AST_Type *t = - AST_Type::narrow_from_decl ( + dynamic_cast<AST_Type*> ( this->reify_type (node->field_type ())); AST_Field *added_field = @@ -1287,7 +1287,7 @@ ast_visitor_tmpl_module_inst::reify_exception_list ( i.next ()) { AST_Type *ex = - AST_Type::narrow_from_decl (this->reify_type (i.item ())); + dynamic_cast<AST_Type*> (this->reify_type (i.item ())); UTL_ExceptList *ex_list = 0; ACE_NEW_RETURN (ex_list, @@ -1316,7 +1316,7 @@ ast_visitor_tmpl_module_inst::create_name_list (AST_Type **list, for (long i = 0; i < length; ++i) { AST_Type *item = - AST_Type::narrow_from_decl (this->reify_type (list[i])); + dynamic_cast<AST_Type*> (this->reify_type (list[i])); // We copy each name added so we can call destroy() on the // list, which disposes of the contents as well as the diff --git a/TAO/TAO_IDL/be/be_argument.cpp b/TAO/TAO_IDL/be/be_argument.cpp index 9d1ceb84907..5a22098460c 100644 --- a/TAO/TAO_IDL/be/be_argument.cpp +++ b/TAO/TAO_IDL/be/be_argument.cpp @@ -46,7 +46,7 @@ be_argument::be_argument (AST_Argument::Direction d, && !dcl->is_local () && (idl_global->in_main_file () || dcl->is_abstract ())) { - be_type *bt = be_type::narrow_from_decl (ft); + be_type *bt = dynamic_cast<be_type*> (ft); bt->seen_in_operation (true); be_util::set_arg_seen_bit (bt); idl_global->need_skeleton_includes_ = true; @@ -66,5 +66,3 @@ be_argument::destroy (void) this->be_decl::destroy (); this->AST_Argument::destroy (); } - -IMPL_NARROW_FROM_DECL (be_argument) diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp index 5c7ef0972f2..b7013e03ae0 100644 --- a/TAO/TAO_IDL/be/be_array.cpp +++ b/TAO/TAO_IDL/be/be_array.cpp @@ -69,7 +69,7 @@ be_array::create_name (void) NAMEBUFSIZE); // Retrieve the base type. // The name always starts this way. - be_type *bt = be_type::narrow_from_decl (this->base_type ()); + be_type *bt = dynamic_cast<be_type*> (this->base_type ()); if (!bt) { @@ -116,7 +116,7 @@ be_array::create_name (void) } // Now see if we have a fully scoped name and if so, generate one. - scope = be_scope::narrow_from_scope (this->defined_in ())->decl (); + scope = dynamic_cast<be_scope*> (this->defined_in ())->decl (); if (scope) { @@ -239,7 +239,7 @@ void be_array::gen_ostream_operator (TAO_OutStream *os, bool use_underscore) { - be_scope* scope = be_scope::narrow_from_scope (this->defined_in ()); + be_scope* scope = dynamic_cast<be_scope*> (this->defined_in ()); be_decl* parent = scope->decl (); ACE_CString arg_name (ACE_CString (parent->full_name ()) + "::" @@ -288,7 +288,7 @@ be_array::gen_ostream_operator (TAO_OutStream *os, instance_name += "]"; } - be_type *bt = be_type::narrow_from_decl (this->base_type ()); + be_type *bt = dynamic_cast<be_type*> (this->base_type ()); bt->gen_member_ostream_operator (os, instance_name.c_str (), use_underscore, @@ -314,7 +314,7 @@ be_array::gen_member_ostream_operator (TAO_OutStream *os, bool use_underscore, bool accessor) { - be_scope* scope = be_scope::narrow_from_scope (this->defined_in ()); + be_scope* scope = dynamic_cast<be_scope*> (this->defined_in ()); be_decl* parent = scope->decl (); ACE_CString decl_name (ACE_CString (parent->full_name ()) + "::" @@ -346,7 +346,3 @@ be_array::destroy (void) this->be_type::destroy (); this->AST_Array::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_array) diff --git a/TAO/TAO_IDL/be/be_attribute.cpp b/TAO/TAO_IDL/be/be_attribute.cpp index 3e0931ae0bf..95a4fde944e 100644 --- a/TAO/TAO_IDL/be/be_attribute.cpp +++ b/TAO/TAO_IDL/be/be_attribute.cpp @@ -44,7 +44,7 @@ be_attribute::be_attribute (bool ro, { // For the return types of the two operations // generated from this attribute. - be_util::set_arg_seen_bit (be_type::narrow_from_decl (ft)); + be_util::set_arg_seen_bit (dynamic_cast<be_type*> (ft)); } } @@ -52,7 +52,7 @@ be_type * be_attribute::field_type (void) const { return - be_type::narrow_from_decl ( + dynamic_cast<be_type*> ( this->AST_Attribute::field_type ()); } @@ -68,5 +68,3 @@ be_attribute::destroy (void) this->be_decl::destroy (); this->AST_Attribute::destroy (); } - -IMPL_NARROW_FROM_DECL (be_attribute) diff --git a/TAO/TAO_IDL/be/be_component.cpp b/TAO/TAO_IDL/be/be_component.cpp index be0855463bf..17a32bdb146 100644 --- a/TAO/TAO_IDL/be/be_component.cpp +++ b/TAO/TAO_IDL/be/be_component.cpp @@ -81,14 +81,14 @@ be_component * be_component::base_component (void) const { return - be_component::narrow_from_decl ( + dynamic_cast<be_component*> ( this->AST_Component::base_component ()); } void be_component::redefine (AST_Interface *from) { - be_component *bc = be_component::narrow_from_decl (from); + be_component *bc = dynamic_cast<be_component*> (from); this->var_out_seq_decls_gen_ = bc->var_out_seq_decls_gen_; AST_Component::redefine (from); } @@ -168,9 +168,6 @@ be_component::n_emits (void) const return this->n_emits_; } -IMPL_NARROW_FROM_DECL (be_component) -IMPL_NARROW_FROM_SCOPE (be_component) - void be_component::scan (UTL_Scope *s) { @@ -197,7 +194,7 @@ be_component::scan (UTL_Scope *s) { case AST_Decl::NT_provides: ++this->n_provides_; - p = AST_Provides::narrow_from_decl (d); + p = dynamic_cast<AST_Provides*> (d); if (!p->provides_type ()->is_local ()) { @@ -207,7 +204,7 @@ be_component::scan (UTL_Scope *s) continue; case AST_Decl::NT_uses: ++this->n_uses_; - u = AST_Uses::narrow_from_decl (d); + u = dynamic_cast<AST_Uses*> (d); if (u->is_multiple ()) { @@ -230,15 +227,15 @@ be_component::scan (UTL_Scope *s) ++this->n_emits_; continue; case AST_Decl::NT_ext_port: - ep = AST_Extended_Port::narrow_from_decl (d); + ep = dynamic_cast<AST_Extended_Port*> (d); this->scan (ep->port_type ()); continue; case AST_Decl::NT_mirror_port: - mp = AST_Mirror_Port::narrow_from_decl (d); + mp = dynamic_cast<AST_Mirror_Port*> (d); this->mirror_scan (mp->port_type ()); continue; case AST_Decl::NT_attr: - a = AST_Attribute::narrow_from_decl (d);; + a = dynamic_cast<AST_Attribute*> (d);; if (!a->readonly ()) { @@ -263,7 +260,7 @@ be_component::scan (UTL_Scope *s) } } - AST_Component *c = AST_Component::narrow_from_scope (s); + AST_Component *c = dynamic_cast<AST_Component*> (s); AST_Interface *iface = 0; if (c != 0) @@ -280,7 +277,7 @@ be_component::scan (UTL_Scope *s) // will be 0 and the call will return immediately. this->scan (c->base_component ()); } - else if ((iface = AST_Interface::narrow_from_scope (s)) != 0) + else if ((iface = dynamic_cast<AST_Interface*> (s)) != 0) { for (long i = 0; i < iface->n_inherits (); ++i) { @@ -402,7 +399,7 @@ be_component::mirror_scan (AST_PortType *pt) { case AST_Decl::NT_provides: ++this->n_uses_; - p = AST_Provides::narrow_from_decl (d); + p = dynamic_cast<AST_Provides*> (d); if (!p->provides_type ()->is_local ()) { @@ -412,7 +409,7 @@ be_component::mirror_scan (AST_PortType *pt) continue; case AST_Decl::NT_uses: ++this->n_provides_; - u = AST_Uses::narrow_from_decl (d); + u = dynamic_cast<AST_Uses*> (d); if (!u->uses_type ()->is_local ()) { @@ -421,7 +418,7 @@ be_component::mirror_scan (AST_PortType *pt) continue; case AST_Decl::NT_attr: - a = AST_Attribute::narrow_from_decl (d);; + a = dynamic_cast<AST_Attribute*> (d);; if (!a->readonly ()) { diff --git a/TAO/TAO_IDL/be/be_component_fwd.cpp b/TAO/TAO_IDL/be/be_component_fwd.cpp index 7cc6a8f441b..961d969663f 100644 --- a/TAO/TAO_IDL/be/be_component_fwd.cpp +++ b/TAO/TAO_IDL/be/be_component_fwd.cpp @@ -53,7 +53,3 @@ be_component_fwd::accept (be_visitor *visitor) ? 0 : visitor->visit_component_fwd (this)); } - - - -IMPL_NARROW_FROM_DECL (be_component_fwd) diff --git a/TAO/TAO_IDL/be/be_connector.cpp b/TAO/TAO_IDL/be/be_connector.cpp index b1c4c1c68a9..f1dd8ed87d7 100644 --- a/TAO/TAO_IDL/be/be_connector.cpp +++ b/TAO/TAO_IDL/be/be_connector.cpp @@ -112,12 +112,12 @@ be_connector::check_ancestors (void) // If we have a templated module, enable it as dds_connector_ // for the moment AST_Module *m = - AST_Module::narrow_from_scope (this->defined_in ()); + dynamic_cast<AST_Module*> (this->defined_in ()); AST_Template_Module_Inst *t_inst = 0; while (t_inst == 0 && m != 0) { t_inst = m->from_inst (); - m = AST_Module::narrow_from_scope (m->defined_in ()); + m = dynamic_cast<AST_Module*> (m->defined_in ()); } if (t_inst != 0 && t_inst->template_args () != 0) { @@ -132,7 +132,3 @@ be_connector::check_ancestors (void) base = base->base_connector (); } } - -IMPL_NARROW_FROM_DECL (be_connector) -IMPL_NARROW_FROM_SCOPE (be_connector) - diff --git a/TAO/TAO_IDL/be/be_constant.cpp b/TAO/TAO_IDL/be/be_constant.cpp index e1ea76357cf..2e08aa3a757 100644 --- a/TAO/TAO_IDL/be/be_constant.cpp +++ b/TAO/TAO_IDL/be/be_constant.cpp @@ -38,7 +38,3 @@ be_constant::destroy (void) this->be_decl::destroy (); this->AST_Constant::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_constant) diff --git a/TAO/TAO_IDL/be/be_consumes.cpp b/TAO/TAO_IDL/be/be_consumes.cpp index 479ef491ae5..b38cafc0813 100644 --- a/TAO/TAO_IDL/be/be_consumes.cpp +++ b/TAO/TAO_IDL/be/be_consumes.cpp @@ -28,7 +28,7 @@ be_eventtype * be_consumes::consumes_type (void) const { return - be_eventtype::narrow_from_decl ( + dynamic_cast<be_eventtype*> ( this->AST_Consumes::consumes_type ()); } @@ -44,5 +44,3 @@ be_consumes::destroy (void) this->AST_Consumes::destroy (); this->be_field::destroy (); } - -IMPL_NARROW_FROM_DECL (be_consumes) diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index 51b8d05803b..ec9a1396e90 100644 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ b/TAO/TAO_IDL/be/be_decl.cpp @@ -130,7 +130,7 @@ be_decl::compute_full_name (const char *prefix, { // Get scope name. be_decl * const parent = - be_scope::narrow_from_scope (this->defined_in ())->decl (); + dynamic_cast<be_scope*> (this->defined_in ())->decl (); if (parent == 0) { @@ -199,7 +199,7 @@ be_decl::compute_flat_name (const char *prefix, { // Get scope name. be_decl * const parent = - be_scope::narrow_from_scope (this->defined_in ())->decl (); + dynamic_cast<be_scope*> (this->defined_in ())->decl (); if (parent == 0) { ACE_ERROR ((LM_ERROR, @@ -255,42 +255,42 @@ be_decl::scope (void) // Resolve forward declared interface by looking at full_definition() // field and iterating. d = - be_interface::narrow_from_decl ( - (be_interface_fwd::narrow_from_decl (this))->full_definition () + dynamic_cast<be_interface*> ( + (dynamic_cast<be_interface_fwd*> (this))->full_definition () ); // Fall through case AST_Decl::NT_interface: - return be_interface::narrow_from_decl (d); + return dynamic_cast<be_interface*> (d); case AST_Decl::NT_module: - return be_module::narrow_from_decl (d); + return dynamic_cast<be_module*> (d); case AST_Decl::NT_root: - return be_root::narrow_from_decl (d); + return dynamic_cast<be_root*> (d); case AST_Decl::NT_except: - return be_exception::narrow_from_decl (d); + return dynamic_cast<be_exception*> (d); case AST_Decl::NT_union: - return be_union::narrow_from_decl (d); + return dynamic_cast<be_union*> (d); case AST_Decl::NT_struct: - return be_structure::narrow_from_decl (d); + return dynamic_cast<be_structure*> (d); case AST_Decl::NT_enum: - return be_enum::narrow_from_decl (d); + return dynamic_cast<be_enum*> (d); case AST_Decl::NT_op: - return be_operation::narrow_from_decl (d); + return dynamic_cast<be_operation*> (d); case AST_Decl::NT_factory: - return be_factory::narrow_from_decl (d); + return dynamic_cast<be_factory*> (d); case AST_Decl::NT_finder: - return be_finder::narrow_from_decl (d); + return dynamic_cast<be_finder*> (d); case AST_Decl::NT_sequence: - return be_sequence::narrow_from_decl (d); + return dynamic_cast<be_sequence*> (d); case AST_Decl::NT_valuetype: - return be_valuetype::narrow_from_decl (d); + return dynamic_cast<be_valuetype*> (d); case AST_Decl::NT_component: - return be_component::narrow_from_decl (d); + return dynamic_cast<be_component*> (d); case AST_Decl::NT_eventtype: - return be_eventtype::narrow_from_decl (d); + return dynamic_cast<be_eventtype*> (d); case AST_Decl::NT_home: - return be_home::narrow_from_decl (d); + return dynamic_cast<be_home*> (d); default: - return (be_scope *)0; + return 0; } } @@ -838,7 +838,3 @@ be_decl::accept (be_visitor *visitor) { return visitor->visit_decl (this); } - - - -IMPL_NARROW_FROM_DECL (be_decl) diff --git a/TAO/TAO_IDL/be/be_emits.cpp b/TAO/TAO_IDL/be/be_emits.cpp index af1edb18102..acd34dd794d 100644 --- a/TAO/TAO_IDL/be/be_emits.cpp +++ b/TAO/TAO_IDL/be/be_emits.cpp @@ -28,7 +28,7 @@ be_eventtype * be_emits::emits_type (void) const { return - be_eventtype::narrow_from_decl ( + dynamic_cast<be_eventtype*> ( this->AST_Emits::emits_type ()); } @@ -44,5 +44,3 @@ be_emits::destroy (void) this->AST_Emits::destroy (); this->be_field::destroy (); } - -IMPL_NARROW_FROM_DECL (be_emits) diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp index 520c315ef7d..8e47fa45c85 100644 --- a/TAO/TAO_IDL/be/be_enum.cpp +++ b/TAO/TAO_IDL/be/be_enum.cpp @@ -92,8 +92,3 @@ be_enum::accept (be_visitor *visitor) { return visitor->visit_enum (this); } - - - -IMPL_NARROW_FROM_DECL (be_enum) -IMPL_NARROW_FROM_SCOPE (be_enum) diff --git a/TAO/TAO_IDL/be/be_enum_val.cpp b/TAO/TAO_IDL/be/be_enum_val.cpp index 0970f1b2a6e..5f614198e58 100644 --- a/TAO/TAO_IDL/be/be_enum_val.cpp +++ b/TAO/TAO_IDL/be/be_enum_val.cpp @@ -42,6 +42,3 @@ be_enum_val::destroy (void) this->AST_EnumVal::destroy (); this->be_decl::destroy (); } - -IMPL_NARROW_FROM_DECL (be_enum_val) - diff --git a/TAO/TAO_IDL/be/be_eventtype.cpp b/TAO/TAO_IDL/be/be_eventtype.cpp index 96b08a05e19..f2d8fc5ea5f 100644 --- a/TAO/TAO_IDL/be/be_eventtype.cpp +++ b/TAO/TAO_IDL/be/be_eventtype.cpp @@ -111,8 +111,3 @@ be_eventtype::destroy (void) { this->be_valuetype::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_eventtype) -IMPL_NARROW_FROM_SCOPE (be_eventtype) diff --git a/TAO/TAO_IDL/be/be_eventtype_fwd.cpp b/TAO/TAO_IDL/be/be_eventtype_fwd.cpp index cd04d3a931f..b51c7e839b3 100644 --- a/TAO/TAO_IDL/be/be_eventtype_fwd.cpp +++ b/TAO/TAO_IDL/be/be_eventtype_fwd.cpp @@ -59,8 +59,3 @@ be_eventtype_fwd::destroy (void) { this->be_valuetype_fwd::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_eventtype_fwd) - diff --git a/TAO/TAO_IDL/be/be_exception.cpp b/TAO/TAO_IDL/be/be_exception.cpp index 24101456c2d..d6600b1381d 100644 --- a/TAO/TAO_IDL/be/be_exception.cpp +++ b/TAO/TAO_IDL/be/be_exception.cpp @@ -68,8 +68,3 @@ be_exception::accept (be_visitor *visitor) { return visitor->visit_exception (this); } - - - -IMPL_NARROW_FROM_DECL (be_exception) -IMPL_NARROW_FROM_SCOPE (be_exception) diff --git a/TAO/TAO_IDL/be/be_extended_port.cpp b/TAO/TAO_IDL/be/be_extended_port.cpp index bf7be8e98b8..5a6d46b7abd 100644 --- a/TAO/TAO_IDL/be/be_extended_port.cpp +++ b/TAO/TAO_IDL/be/be_extended_port.cpp @@ -30,7 +30,7 @@ be_porttype * be_extended_port::port_type (void) const { return - be_porttype::narrow_from_decl ( + dynamic_cast<be_porttype*> ( this->AST_Extended_Port::port_type ()); } @@ -46,6 +46,3 @@ be_extended_port::accept (be_visitor *visitor) { return visitor->visit_extended_port (this); } - -IMPL_NARROW_FROM_DECL (be_extended_port) - diff --git a/TAO/TAO_IDL/be/be_factory.cpp b/TAO/TAO_IDL/be/be_factory.cpp index d15c489320d..45877366438 100644 --- a/TAO/TAO_IDL/be/be_factory.cpp +++ b/TAO/TAO_IDL/be/be_factory.cpp @@ -64,6 +64,3 @@ be_factory::be_add_argument (AST_Argument *arg) 0); return arg; } - -IMPL_NARROW_FROM_DECL (be_factory) -IMPL_NARROW_FROM_SCOPE (be_factory) diff --git a/TAO/TAO_IDL/be/be_field.cpp b/TAO/TAO_IDL/be/be_field.cpp index fd54c73baf2..07052492f59 100644 --- a/TAO/TAO_IDL/be/be_field.cpp +++ b/TAO/TAO_IDL/be/be_field.cpp @@ -45,7 +45,7 @@ be_type * be_field::field_type (void) const { return - be_type::narrow_from_decl ( + dynamic_cast<be_type*> ( this->AST_Field::field_type ()); } @@ -55,7 +55,7 @@ be_field::gen_member_ostream_operator (TAO_OutStream *os, bool use_underscore, bool accessor) { - be_type *ft = be_type::narrow_from_decl (this->field_type ()); + be_type *ft = dynamic_cast<be_type*> (this->field_type ()); ft->gen_member_ostream_operator (os, instance_name, use_underscore, @@ -86,5 +86,3 @@ be_field::destroy (void) this->be_decl::destroy (); this->AST_Field::destroy (); } - -IMPL_NARROW_FROM_DECL (be_field) diff --git a/TAO/TAO_IDL/be/be_finder.cpp b/TAO/TAO_IDL/be/be_finder.cpp index 794aaedbf2c..80540a5a1db 100644 --- a/TAO/TAO_IDL/be/be_finder.cpp +++ b/TAO/TAO_IDL/be/be_finder.cpp @@ -46,6 +46,3 @@ be_finder::accept (be_visitor *visitor) { return visitor->visit_finder (this); } - -IMPL_NARROW_FROM_DECL (be_finder) -IMPL_NARROW_FROM_SCOPE (be_finder) diff --git a/TAO/TAO_IDL/be/be_fixed.cpp b/TAO/TAO_IDL/be/be_fixed.cpp index e4657b0e038..c6a30eb1037 100644 --- a/TAO/TAO_IDL/be/be_fixed.cpp +++ b/TAO/TAO_IDL/be/be_fixed.cpp @@ -24,5 +24,3 @@ void be_fixed::destroy () be_type::destroy (); AST_Fixed::destroy (); } - -IMPL_NARROW_FROM_DECL (be_fixed) diff --git a/TAO/TAO_IDL/be/be_generator.cpp b/TAO/TAO_IDL/be/be_generator.cpp index c55a98046d6..a49a1800b61 100644 --- a/TAO/TAO_IDL/be/be_generator.cpp +++ b/TAO/TAO_IDL/be/be_generator.cpp @@ -155,7 +155,7 @@ be_generator::create_module (UTL_Scope *s, { // Can't just check node type here, since it could be a // template module or template module instantiation. - AST_Module *m = AST_Module::narrow_from_decl (iter.item ()); + AST_Module *m = dynamic_cast<AST_Module*> (iter.item ()); if (m && m->local_name ()->compare (n->last_component ())) { @@ -172,7 +172,7 @@ be_generator::create_module (UTL_Scope *s, // is itself a module, and has been previously opened, any // of the previous openings may contain a previous opening // of the module we're creating. - AST_Module *prev_module = AST_Module::narrow_from_scope (s); + AST_Module *prev_module = dynamic_cast<AST_Module*> (s); if (prev_module) { while (!!(prev_module = prev_module->previous_opening ())) @@ -181,7 +181,7 @@ be_generator::create_module (UTL_Scope *s, !iter.is_done (); iter.next ()) { - AST_Module *m = AST_Module::narrow_from_decl (iter.item ()); + AST_Module *m = dynamic_cast<AST_Module*> (iter.item ()); if (m && m->local_name ()->compare (n->last_component ())) { // Create this new module with referance to the diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index ac181d2a2cc..54678f6b317 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -2192,7 +2192,7 @@ BE_GlobalData:: void_type (void) idl_global->root ()->lookup_primitive_type ( AST_Expression::EV_void); - this->void_type_ = AST_PredefinedType::narrow_from_decl (d); + this->void_type_ = dynamic_cast<AST_PredefinedType*> (d); } return this->void_type_; @@ -2233,7 +2233,7 @@ BE_GlobalData::ccmobject (void) 0); } - this->ccmobject_ = be_interface::narrow_from_decl (d); + this->ccmobject_ = dynamic_cast<be_interface*> (d); } return this->ccmobject_; diff --git a/TAO/TAO_IDL/be/be_home.cpp b/TAO/TAO_IDL/be/be_home.cpp index c83cd2aa991..9f56f01b0c0 100644 --- a/TAO/TAO_IDL/be/be_home.cpp +++ b/TAO/TAO_IDL/be/be_home.cpp @@ -73,7 +73,7 @@ be_home::be_home (UTL_ScopedName *n, } be_component *bt = - be_component::narrow_from_decl (managed_component); + dynamic_cast<be_component*> (managed_component); bt->seen_in_operation (true); @@ -98,7 +98,7 @@ be_home::scan (UTL_Scope *s) { AST_Decl *d = i.item (); AST_Attribute *attr = - AST_Attribute::narrow_from_decl (d); + dynamic_cast<AST_Attribute*> (d); if (attr != 0 && ! attr->readonly ()) { @@ -107,7 +107,7 @@ be_home::scan (UTL_Scope *s) } } - AST_Home *h = AST_Home::narrow_from_scope (s); + AST_Home *h = dynamic_cast<AST_Home*> (s); if (h != 0) { @@ -162,6 +162,3 @@ be_home::accept (be_visitor *visitor) ? 0 : visitor->visit_home (this)); } - -IMPL_NARROW_FROM_DECL (be_home) -IMPL_NARROW_FROM_SCOPE (be_home) diff --git a/TAO/TAO_IDL/be/be_identifier_helper.cpp b/TAO/TAO_IDL/be/be_identifier_helper.cpp index 9abb24ce0ba..63218c2f7b8 100644 --- a/TAO/TAO_IDL/be/be_identifier_helper.cpp +++ b/TAO/TAO_IDL/be/be_identifier_helper.cpp @@ -22,7 +22,7 @@ IdentifierHelper::type_name (be_type *t, be_visitor *visitor) (void) t->accept (visitor); return ""; case AST_Decl::NT_pre_defined: - pdt = AST_PredefinedType::narrow_from_decl (t); + pdt = dynamic_cast<AST_PredefinedType*> (t); switch (pdt->pt ()) { diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index e1a31fe90ce..edcf8b3d9d4 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -572,7 +572,7 @@ be_interface::has_rw_attributes (void) const void be_interface::redefine (AST_Interface *from) { - be_interface *bi = be_interface::narrow_from_decl (from); + be_interface *bi = dynamic_cast<be_interface*> (from); this->var_out_seq_decls_gen_ = bi->var_out_seq_decls_gen_; this->has_mixed_parentage_ = bi->has_mixed_parentage_; @@ -841,7 +841,7 @@ TAO_IDL_Gen_OpTable_Worker::emit (be_interface *derived_interface, { // Generate entries for the derived class using the properties of its // ancestors. - be_interface *bi = be_interface::narrow_from_decl (base_interface); + be_interface *bi = dynamic_cast<be_interface*> (base_interface); return bi->gen_optable_entries (derived_interface, this->skeleton_name_, os); @@ -896,7 +896,7 @@ Pure_Virtual_Regenerator::emit (be_interface *derived_interface, !si.is_done (); si.next ()) { - d = be_decl::narrow_from_decl (si.item ()); + d = dynamic_cast<be_decl*> (si.item ()); if (d->node_type () == AST_Decl::NT_op) { @@ -1387,7 +1387,7 @@ be_interface::gen_optable_entries (be_interface *derived_interface, if (d->node_type () == AST_Decl::NT_op) { be_operation *op = - be_operation::narrow_from_decl (d); + dynamic_cast<be_operation*> (d); if (op->is_sendc_ami ()) { @@ -1417,7 +1417,7 @@ be_interface::gen_optable_entries (be_interface *derived_interface, else if (d->node_type () == AST_Decl::NT_attr) { AST_Attribute *attr = - AST_Attribute::narrow_from_decl (d); + dynamic_cast<AST_Attribute*> (d); if (attr == 0) return -1; @@ -1488,7 +1488,7 @@ be_interface::gen_optable_entries (be_interface *derived_interface, if (d->node_type () == AST_Decl::NT_op) { be_operation *op = - be_operation::narrow_from_decl (d); + dynamic_cast<be_operation*> (d); if (op->is_sendc_ami ()) { @@ -1570,7 +1570,7 @@ be_interface::gen_optable_entries (be_interface *derived_interface, else if (d->node_type () == AST_Decl::NT_attr) { AST_Attribute *attr = - AST_Attribute::narrow_from_decl (d); + dynamic_cast<AST_Attribute*> (d); if (attr == 0) { @@ -1786,7 +1786,7 @@ be_interface::traverse_inheritance_graph ( if (nt == AST_Decl::NT_home) { this->enqueue_base_home_r ( - AST_Home::narrow_from_decl (intf)); + dynamic_cast<AST_Home*> (intf)); } // If we are doing a component, we check for a parent. @@ -1798,7 +1798,7 @@ be_interface::traverse_inheritance_graph ( } this->enqueue_base_component_r ( - AST_Component::narrow_from_decl (intf)); + dynamic_cast<AST_Component*> (intf)); } (void) this->insert_non_dup (intf, abstract_paths_only); @@ -1831,7 +1831,7 @@ be_interface::traverse_inheritance_graph ( -1); } - be_interface *bi = be_interface::narrow_from_decl (intf); + be_interface *bi = dynamic_cast<be_interface*> (intf); // Use the helper method to generate code for ourself using the // properties of the element dequeued. For the first iteration, the @@ -2341,7 +2341,7 @@ be_interface::copy_ctor_helper (be_interface *derived, else if (base->is_nested ()) { be_decl *scope = 0; - scope = be_scope::narrow_from_scope (base->defined_in ())->decl (); + scope = dynamic_cast<be_scope*> (base->defined_in ())->decl (); *os << "POA_" << scope->name () << "::" << base->local_name () << " (rhs)"; @@ -2428,7 +2428,7 @@ be_interface::op_attr_decl_helper (be_interface * /*derived */, be_interface *ancestor, TAO_OutStream *os) { - if (be_component::narrow_from_decl (ancestor) != 0) + if (dynamic_cast<be_component*> (ancestor) != 0) { return 0; } @@ -2447,7 +2447,7 @@ be_interface::op_attr_decl_helper (be_interface * /*derived */, if (nt == AST_Decl::NT_op) { - be_operation *op = be_operation::narrow_from_decl (d); + be_operation *op = dynamic_cast<be_operation*> (d); /// No sendc_* operations in facet servants. If the /// original interface had these generated as AMI @@ -2471,7 +2471,7 @@ be_interface::op_attr_decl_helper (be_interface * /*derived */, } else if (nt == AST_Decl::NT_attr) { - be_attribute *attr = be_attribute::narrow_from_decl (d); + be_attribute *attr = dynamic_cast<be_attribute*> (d); be_visitor_attribute v (&ctx); if (v.visit_attribute (attr) == -1) @@ -3038,6 +3038,3 @@ be_interface::create_with_prefix_suffix (const char *prefix, return cat_string; } - -IMPL_NARROW_FROM_DECL (be_interface) -IMPL_NARROW_FROM_SCOPE (be_interface) diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp index 79415551ea4..6494d4948c1 100644 --- a/TAO/TAO_IDL/be/be_interface_fwd.cpp +++ b/TAO/TAO_IDL/be/be_interface_fwd.cpp @@ -44,7 +44,7 @@ be_interface_fwd::seen_in_sequence (bool val) { this->be_type::seen_in_sequence (val); be_interface *fd = - be_interface::narrow_from_decl (this->full_definition ()); + dynamic_cast<be_interface*> (this->full_definition ()); fd->seen_in_sequence (val); } @@ -53,7 +53,7 @@ be_interface_fwd::seen_in_operation (bool val) { this->be_type::seen_in_operation (val); be_interface *fd = - be_interface::narrow_from_decl (this->full_definition ()); + dynamic_cast<be_interface*> (this->full_definition ()); fd->seen_in_operation (val); } @@ -69,7 +69,3 @@ be_interface_fwd::accept (be_visitor *visitor) { return visitor->visit_interface_fwd (this); } - - - -IMPL_NARROW_FROM_DECL (be_interface_fwd) diff --git a/TAO/TAO_IDL/be/be_mirror_port.cpp b/TAO/TAO_IDL/be/be_mirror_port.cpp index 8ee81e31128..12d583c5ca9 100644 --- a/TAO/TAO_IDL/be/be_mirror_port.cpp +++ b/TAO/TAO_IDL/be/be_mirror_port.cpp @@ -43,6 +43,3 @@ be_mirror_port::accept (be_visitor *visitor) { return visitor->visit_mirror_port (this); } - -IMPL_NARROW_FROM_DECL (be_mirror_port) - diff --git a/TAO/TAO_IDL/be/be_module.cpp b/TAO/TAO_IDL/be/be_module.cpp index 00c679e588d..c989e4cecee 100644 --- a/TAO/TAO_IDL/be/be_module.cpp +++ b/TAO/TAO_IDL/be/be_module.cpp @@ -37,6 +37,3 @@ be_module::accept (be_visitor *visitor) { return visitor->visit_module (this); } - -IMPL_NARROW_FROM_DECL (be_module) -IMPL_NARROW_FROM_SCOPE (be_module) diff --git a/TAO/TAO_IDL/be/be_native.cpp b/TAO/TAO_IDL/be/be_native.cpp index 6725f29d60d..aee4989e65e 100644 --- a/TAO/TAO_IDL/be/be_native.cpp +++ b/TAO/TAO_IDL/be/be_native.cpp @@ -66,7 +66,3 @@ be_native::accept (be_visitor *visitor) { return visitor->visit_native (this); } - - - -IMPL_NARROW_FROM_DECL(be_native) diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp index 5422f80cd0a..e181ad58fa0 100644 --- a/TAO/TAO_IDL/be/be_operation.cpp +++ b/TAO/TAO_IDL/be/be_operation.cpp @@ -55,7 +55,7 @@ be_operation::be_operation (AST_Type *rt, if (!this->is_local ()) { - be_type *bt = be_type::narrow_from_decl (rt); + be_type *bt = dynamic_cast<be_type*> (rt); bt->seen_in_operation (true); be_util::set_arg_seen_bit (bt); idl_global->non_local_op_seen_ = true; @@ -138,6 +138,3 @@ be_operation::is_attr_op (bool val) { this->is_attr_op_ = val; } - -IMPL_NARROW_FROM_DECL (be_operation) -IMPL_NARROW_FROM_SCOPE (be_operation) diff --git a/TAO/TAO_IDL/be/be_param_holder.cpp b/TAO/TAO_IDL/be/be_param_holder.cpp index d9c6aeed908..c74d051e18e 100644 --- a/TAO/TAO_IDL/be/be_param_holder.cpp +++ b/TAO/TAO_IDL/be/be_param_holder.cpp @@ -47,6 +47,3 @@ be_param_holder::destroy (void) this->AST_Param_Holder::destroy (); this->be_type::destroy (); } - -IMPL_NARROW_FROM_DECL (be_param_holder) - diff --git a/TAO/TAO_IDL/be/be_porttype.cpp b/TAO/TAO_IDL/be/be_porttype.cpp index 9cd5e14a99f..2f3393621ee 100644 --- a/TAO/TAO_IDL/be/be_porttype.cpp +++ b/TAO/TAO_IDL/be/be_porttype.cpp @@ -33,6 +33,3 @@ be_porttype::accept (be_visitor *visitor) { return visitor->visit_porttype (this); } - -IMPL_NARROW_FROM_DECL (be_porttype) -IMPL_NARROW_FROM_SCOPE (be_porttype) diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp index fedc10172dd..b141bd47187 100644 --- a/TAO/TAO_IDL/be/be_predefined_type.cpp +++ b/TAO/TAO_IDL/be/be_predefined_type.cpp @@ -261,7 +261,3 @@ be_predefined_type::destroy (void) this->AST_PredefinedType::destroy (); this->be_type::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_predefined_type) diff --git a/TAO/TAO_IDL/be/be_produce.cpp b/TAO/TAO_IDL/be/be_produce.cpp index 1db60dd8097..b6a02317d79 100644 --- a/TAO/TAO_IDL/be/be_produce.cpp +++ b/TAO/TAO_IDL/be/be_produce.cpp @@ -97,7 +97,7 @@ BE_visit_root (be_visitor_decl &root_visitor, const char *which_pass) { static be_root *root = - be_root::narrow_from_decl (idl_global->root ()); + dynamic_cast<be_root*> (idl_global->root ()); if (-1 == root->accept (&root_visitor)) { diff --git a/TAO/TAO_IDL/be/be_provides.cpp b/TAO/TAO_IDL/be/be_provides.cpp index 5d6fcbcf775..f7100a85ffe 100644 --- a/TAO/TAO_IDL/be/be_provides.cpp +++ b/TAO/TAO_IDL/be/be_provides.cpp @@ -40,12 +40,10 @@ be_type * be_provides::provides_type (void) const { return - be_type::narrow_from_decl ( + dynamic_cast<be_type*> ( this->AST_Provides::provides_type ()); } -IMPL_NARROW_FROM_DECL (be_provides) - int be_provides::accept (be_visitor *visitor) { diff --git a/TAO/TAO_IDL/be/be_publishes.cpp b/TAO/TAO_IDL/be/be_publishes.cpp index 7920c556635..7b5a9c8ce09 100644 --- a/TAO/TAO_IDL/be/be_publishes.cpp +++ b/TAO/TAO_IDL/be/be_publishes.cpp @@ -28,7 +28,7 @@ be_eventtype * be_publishes::publishes_type (void) const { return - be_eventtype::narrow_from_decl ( + dynamic_cast<be_eventtype*> ( this->AST_Publishes::publishes_type ()); } @@ -44,5 +44,3 @@ be_publishes::destroy (void) this->AST_Publishes::destroy (); this->be_field::destroy (); } - -IMPL_NARROW_FROM_DECL (be_publishes) diff --git a/TAO/TAO_IDL/be/be_root.cpp b/TAO/TAO_IDL/be/be_root.cpp index 8c4340f7e1a..1c1fe1638e0 100644 --- a/TAO/TAO_IDL/be/be_root.cpp +++ b/TAO/TAO_IDL/be/be_root.cpp @@ -54,8 +54,3 @@ be_root::accept (be_visitor *visitor) { return visitor->visit_root (this); } - - - -IMPL_NARROW_FROM_DECL (be_root) -IMPL_NARROW_FROM_SCOPE (be_root) diff --git a/TAO/TAO_IDL/be/be_scope.cpp b/TAO/TAO_IDL/be/be_scope.cpp index 90439922ea7..888e48cf825 100644 --- a/TAO/TAO_IDL/be/be_scope.cpp +++ b/TAO/TAO_IDL/be/be_scope.cpp @@ -65,35 +65,35 @@ be_scope::decl (void) switch (this->scope_node_type ()) { case AST_Decl::NT_interface: - return be_interface::narrow_from_scope (this); + return dynamic_cast<be_interface*> (this); case AST_Decl::NT_valuetype: - return be_valuetype::narrow_from_scope (this); + return dynamic_cast<be_valuetype*> (this); case AST_Decl::NT_eventtype: - return be_eventtype::narrow_from_scope (this); + return dynamic_cast<be_eventtype*> (this); case AST_Decl::NT_component: - return be_component::narrow_from_scope (this); + return dynamic_cast<be_component*> (this); case AST_Decl::NT_connector: - return be_connector::narrow_from_scope (this); + return dynamic_cast<be_connector*> (this); case AST_Decl::NT_home: - return be_home::narrow_from_scope (this); + return dynamic_cast<be_home*> (this); case AST_Decl::NT_module: - return be_module::narrow_from_scope (this); + return dynamic_cast<be_module*> (this); case AST_Decl::NT_root: - return be_root::narrow_from_scope (this); + return dynamic_cast<be_root*> (this); case AST_Decl::NT_except: - return be_exception::narrow_from_scope (this); + return dynamic_cast<be_exception*> (this); case AST_Decl::NT_union: - return be_union::narrow_from_scope (this); + return dynamic_cast<be_union*> (this); case AST_Decl::NT_struct: - return be_structure::narrow_from_scope (this); + return dynamic_cast<be_structure*> (this); case AST_Decl::NT_enum: - return be_enum::narrow_from_scope (this); + return dynamic_cast<be_enum*> (this); case AST_Decl::NT_op: - return be_operation::narrow_from_scope (this); + return dynamic_cast<be_operation*> (this); case AST_Decl::NT_factory: - return be_factory::narrow_from_scope (this); + return dynamic_cast<be_factory*> (this); case AST_Decl::NT_finder: - return be_finder::narrow_from_scope (this); + return dynamic_cast<be_finder*> (this); default: return (be_decl *)0; } @@ -109,5 +109,3 @@ be_scope::accept (be_visitor *visitor) { return visitor->visit_scope (this); } - -IMPL_NARROW_FROM_SCOPE (be_scope) diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index 76a067fcad0..e0a16eb6a9a 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -101,7 +101,7 @@ be_sequence::be_sequence (AST_Expression *v, if (nt == AST_Decl::NT_typedef) { - td = AST_Typedef::narrow_from_decl (t); + td = dynamic_cast<AST_Typedef*> (t); pbt = td->primitive_base_type (); nt = pbt->node_type (); } @@ -109,7 +109,7 @@ be_sequence::be_sequence (AST_Expression *v, if (nt == AST_Decl::NT_pre_defined) { AST_PredefinedType *pdt = - AST_PredefinedType::narrow_from_decl (pbt ? pbt : t); + dynamic_cast<AST_PredefinedType*> (pbt ? pbt : t); switch (pdt->pt ()) { @@ -126,7 +126,7 @@ be_type * be_sequence::base_type (void) const { return - be_type::narrow_from_decl ( + dynamic_cast<be_type*> ( this->AST_Sequence::base_type ()); } @@ -143,7 +143,7 @@ be_sequence::gen_name (void) NAMEBUFSIZE); // Retrieve the base type. - bt = be_type::narrow_from_decl (this->base_type ()); + bt = dynamic_cast<be_type*> (this->base_type ()); if (bt == 0) { @@ -161,7 +161,7 @@ be_sequence::gen_name (void) if (bt->node_type () == AST_Decl::NT_sequence) { // Our base type is an anonymous sequence. - be_sequence *seq = be_sequence::narrow_from_decl (bt); + be_sequence *seq = dynamic_cast<be_sequence*> (bt); if (seq == 0) { @@ -236,7 +236,7 @@ be_sequence::create_name (be_typedef *node) // Now see if we have a fully scoped name and if so, generate one. UTL_Scope *us = this->defined_in (); - scope = be_scope::narrow_from_scope (us)->decl (); + scope = dynamic_cast<be_scope*> (us)->decl (); if (scope != 0) { @@ -283,19 +283,19 @@ be_sequence::managed_type (void) be_type *bt = 0; be_type *prim_type = 0; - bt = be_type::narrow_from_decl (this->base_type ()); + bt = dynamic_cast<be_type*> (this->base_type ()); if (!bt) ACE_ERROR_RETURN ((LM_ERROR, "TAO_IDL (%N:%l) " - "be_type::narrow_from_decl " + "dynamic_cast<be_type*> " "failed\n"), be_sequence::MNG_UNKNOWN); if (bt->node_type () == AST_Decl::NT_typedef) { // Get the primitive base type of this typedef node. - be_typedef *t = be_typedef::narrow_from_decl (bt); + be_typedef *t = dynamic_cast<be_typedef*> (bt); prim_type = t->primitive_base_type (); } else @@ -329,7 +329,7 @@ be_sequence::managed_type (void) case AST_Decl::NT_pre_defined: { be_predefined_type * const bpd = - be_predefined_type::narrow_from_decl (prim_type); + dynamic_cast<be_predefined_type*> (prim_type); AST_PredefinedType::PredefinedType pt = bpd->pt (); @@ -427,7 +427,7 @@ be_sequence::instance_name () NAMEBUFSIZE); be_type *bt = 0; - bt = be_type::narrow_from_decl (this->base_type ()); + bt = dynamic_cast<be_type*> (this->base_type ()); if (bt == 0) { @@ -447,7 +447,7 @@ be_sequence::instance_name () if (bt->node_type () == AST_Decl::NT_typedef) { // Get the primitive base type of this typedef node. - be_typedef *t = be_typedef::narrow_from_decl (bt); + be_typedef *t = dynamic_cast<be_typedef*> (bt); prim_type = t->primitive_base_type (); } @@ -523,7 +523,7 @@ be_sequence::instance_name () // TAO provides extensions for octet sequences, first find out // if the base type is an octet (or an alias for octet) be_predefined_type *predef = - be_predefined_type::narrow_from_decl (prim_type); + dynamic_cast<be_predefined_type*> (prim_type); if (predef != 0 && predef->pt() == AST_PredefinedType::PT_octet) @@ -558,7 +558,7 @@ be_sequence::gen_base_class_name (TAO_OutStream *os, const char * linebreak, AST_Decl *ctx_scope) { - be_type *elem = be_type::narrow_from_decl (this->base_type ()); + be_type *elem = dynamic_cast<be_type*> (this->base_type ()); /* if (be_global->alt_mapping () && this->unbounded ()) { @@ -625,7 +625,7 @@ be_sequence::gen_base_class_name (TAO_OutStream *os, if (elem->node_type () == AST_Decl::NT_typedef) { // Get the primitive base type of this typedef node. - be_typedef *t = be_typedef::narrow_from_decl (elem); + be_typedef *t = dynamic_cast<be_typedef*> (elem); prim_type = t->primitive_base_type (); } else @@ -636,7 +636,7 @@ be_sequence::gen_base_class_name (TAO_OutStream *os, if (prim_type->node_type () == AST_Decl::NT_string) { be_string *str = - be_string::narrow_from_decl (prim_type); + dynamic_cast<be_string*> (prim_type); if (!str) { ACE_ERROR_RETURN ((LM_ERROR, @@ -684,7 +684,7 @@ be_sequence::gen_base_class_name (TAO_OutStream *os, if (elem->node_type () == AST_Decl::NT_typedef) { // Get the primitive base type of this typedef node. - be_typedef *t = be_typedef::narrow_from_decl (elem); + be_typedef *t = dynamic_cast<be_typedef*> (elem); prim_type = t->primitive_base_type (); } else @@ -695,7 +695,7 @@ be_sequence::gen_base_class_name (TAO_OutStream *os, if (prim_type->node_type () == AST_Decl::NT_wstring) { be_string *str = - be_string::narrow_from_decl (prim_type); + dynamic_cast<be_string*> (prim_type); if (!str) { ACE_ERROR_RETURN ((LM_ERROR, @@ -877,7 +877,3 @@ be_sequence::destroy (void) this->be_type::destroy (); this->AST_Sequence::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_sequence) diff --git a/TAO/TAO_IDL/be/be_string.cpp b/TAO/TAO_IDL/be/be_string.cpp index 4219440c874..cad20654cb6 100644 --- a/TAO/TAO_IDL/be/be_string.cpp +++ b/TAO/TAO_IDL/be/be_string.cpp @@ -174,5 +174,3 @@ be_string::destroy (void) this->be_type::destroy (); this->AST_String::destroy (); } - -IMPL_NARROW_FROM_DECL (be_string) diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp index 75224d09216..2b9009a2388 100644 --- a/TAO/TAO_IDL/be/be_structure.cpp +++ b/TAO/TAO_IDL/be/be_structure.cpp @@ -81,7 +81,7 @@ be_structure::be_structure (AST_Decl::NodeType nt, void be_structure::redefine (AST_Structure *from) { - be_structure *bs = be_structure::narrow_from_decl (from); + be_structure *bs = dynamic_cast<be_structure*> (from); this->common_varout_gen_ = bs->common_varout_gen_; this->AST_Structure::redefine (from); } @@ -111,7 +111,7 @@ be_structure::gen_ostream_operator (TAO_OutStream *os, for (long i = 0; i < n; ++i) { - be_field *f = be_field::narrow_from_decl (this->pd_decls[i]); + be_field *f = dynamic_cast<be_field*> (this->pd_decls[i]); // We don't want any decls, just members. if (f == 0) @@ -158,6 +158,3 @@ be_structure::accept (be_visitor *visitor) { return visitor->visit_structure (this); } - -IMPL_NARROW_FROM_DECL (be_structure) -IMPL_NARROW_FROM_SCOPE (be_structure) diff --git a/TAO/TAO_IDL/be/be_structure_fwd.cpp b/TAO/TAO_IDL/be/be_structure_fwd.cpp index 40df470d4aa..df1e2da1ee8 100644 --- a/TAO/TAO_IDL/be/be_structure_fwd.cpp +++ b/TAO/TAO_IDL/be/be_structure_fwd.cpp @@ -45,7 +45,3 @@ be_structure_fwd::accept (be_visitor *visitor) { return visitor->visit_structure_fwd (this); } - - - -IMPL_NARROW_FROM_DECL (be_structure_fwd) diff --git a/TAO/TAO_IDL/be/be_template_module.cpp b/TAO/TAO_IDL/be/be_template_module.cpp index 14fe8190139..de9cfca408d 100644 --- a/TAO/TAO_IDL/be/be_template_module.cpp +++ b/TAO/TAO_IDL/be/be_template_module.cpp @@ -42,6 +42,3 @@ be_template_module::accept (be_visitor *) // to generate implied IDL. return 0; } - -IMPL_NARROW_FROM_DECL (be_template_module) -IMPL_NARROW_FROM_SCOPE (be_template_module) diff --git a/TAO/TAO_IDL/be/be_template_module_inst.cpp b/TAO/TAO_IDL/be/be_template_module_inst.cpp index 3380ad2f6c7..a3c2973dc4d 100644 --- a/TAO/TAO_IDL/be/be_template_module_inst.cpp +++ b/TAO/TAO_IDL/be/be_template_module_inst.cpp @@ -39,6 +39,3 @@ be_template_module_inst::accept (be_visitor *visitor) { return visitor->visit_template_module_inst (this); } - -IMPL_NARROW_FROM_DECL (be_template_module_inst) - diff --git a/TAO/TAO_IDL/be/be_template_module_ref.cpp b/TAO/TAO_IDL/be/be_template_module_ref.cpp index 20f30788315..ae93fe72cea 100644 --- a/TAO/TAO_IDL/be/be_template_module_ref.cpp +++ b/TAO/TAO_IDL/be/be_template_module_ref.cpp @@ -40,6 +40,3 @@ be_template_module_ref::accept (be_visitor *visitor) { return visitor->visit_template_module_ref (this); } - -IMPL_NARROW_FROM_DECL (be_template_module_ref) - diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp index 5a429a23a46..b3af3ac3626 100644 --- a/TAO/TAO_IDL/be/be_type.cpp +++ b/TAO/TAO_IDL/be/be_type.cpp @@ -159,7 +159,7 @@ be_type::nested_sp_type_name (be_decl *use_scope, NAMEBUFSIZE); fu_scope = this->defined_in () - ? be_scope::narrow_from_scope (this->defined_in ())->decl () + ? dynamic_cast<be_scope*> (this->defined_in ())->decl () : 0; ACE_OS::strcat (fu_name, @@ -303,8 +303,8 @@ be_type::gen_stub_decls (TAO_OutStream *os) << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; - AST_Interface *i = AST_Interface::narrow_from_decl (this); - AST_ValueType *v = AST_ValueType::narrow_from_decl (this); + AST_Interface *i = dynamic_cast<AST_Interface*> (this); + AST_ValueType *v = dynamic_cast<AST_ValueType*> (this); if (i != 0) { @@ -313,7 +313,7 @@ be_type::gen_stub_decls (TAO_OutStream *os) } bool skip_varout = false; - AST_Sequence *s = AST_Sequence::narrow_from_decl (this); + AST_Sequence *s = dynamic_cast<AST_Sequence*> (this); if (s != 0) { @@ -394,7 +394,3 @@ be_type::accept (be_visitor *visitor) { return visitor->visit_type (this); } - - - -IMPL_NARROW_FROM_DECL (be_type) diff --git a/TAO/TAO_IDL/be/be_typedef.cpp b/TAO/TAO_IDL/be/be_typedef.cpp index 2763137e85d..c49917167f2 100644 --- a/TAO/TAO_IDL/be/be_typedef.cpp +++ b/TAO/TAO_IDL/be/be_typedef.cpp @@ -77,8 +77,8 @@ be_typedef::primitive_base_type (void) while (d && d->node_type () == AST_Decl::NT_typedef) { - temp = be_typedef::narrow_from_decl (d); - d = be_type::narrow_from_decl (temp->base_type ()); + temp = dynamic_cast<be_typedef*> (d); + d = dynamic_cast<be_type*> (temp->base_type ()); } return d; @@ -89,7 +89,7 @@ be_typedef::base_node_type (void) const { be_typedef *td = const_cast<be_typedef *> (this); - be_type *base = be_type::narrow_from_decl (td->base_type ()); + be_type *base = dynamic_cast<be_type*> (td->base_type ()); return base->base_node_type (); } @@ -118,5 +118,3 @@ be_typedef::accept (be_visitor *visitor) { return visitor->visit_typedef (this); } - -IMPL_NARROW_FROM_DECL (be_typedef) diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp index 2493aed1c23..30d69ca70e2 100644 --- a/TAO/TAO_IDL/be/be_union.cpp +++ b/TAO/TAO_IDL/be/be_union.cpp @@ -66,7 +66,7 @@ be_union::be_union (AST_ConcreteType *dt, void be_union::redefine (AST_Structure *from) { - be_union *bu = be_union::narrow_from_decl (from); + be_union *bu = dynamic_cast<be_union*> (from); this->common_varout_gen_ = bu->common_varout_gen_; AST_Union::redefine (from); } @@ -80,7 +80,7 @@ be_union::has_duplicate_case_labels (void) { AST_Decl *d = si.item (); AST_UnionBranch *ub = - AST_UnionBranch::narrow_from_decl (d); + dynamic_cast<AST_UnionBranch*> (d); if (ub->label_list_length () > 1) { @@ -108,7 +108,7 @@ be_union::gen_ostream_operator (TAO_OutStream *os, for (long i = 0; i < this->pd_decls_used; ++i) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->pd_decls[i]); + dynamic_cast<be_union_branch*> (this->pd_decls[i]); // We don't want any decls, just members. if (ub == 0) @@ -151,7 +151,7 @@ be_union::gen_ostream_operator (TAO_OutStream *os, *os << "strm << "; - be_type *ub_ft = be_type::narrow_from_decl (ub->field_type ()); + be_type *ub_ft = dynamic_cast<be_type*> (ub->field_type ()); AST_Decl::NodeType ub_nt = ub_ft->node_type (); // catch anonymous Array member types bool ub_use_underscore = ub_nt == AST_Decl::NT_array; @@ -223,7 +223,7 @@ be_union::gen_empty_default_label (void) return (n_labels <= ACE_UINT32_MAX); } - AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (disc); + AST_PredefinedType *pdt = dynamic_cast<AST_PredefinedType*> (disc); if (pdt == 0) { return true; // In reality this is an error. @@ -276,7 +276,7 @@ be_union::nlabels (void) { AST_Decl *d = si.item (); AST_UnionBranch *ub = - AST_UnionBranch::narrow_from_decl (d); + dynamic_cast<AST_UnionBranch*> (d); if (ub != 0) { @@ -286,8 +286,3 @@ be_union::nlabels (void) return retval; } - - - -IMPL_NARROW_FROM_DECL (be_union) -IMPL_NARROW_FROM_SCOPE (be_union) diff --git a/TAO/TAO_IDL/be/be_union_branch.cpp b/TAO/TAO_IDL/be/be_union_branch.cpp index 17dd1156d16..70d4bb34e7b 100644 --- a/TAO/TAO_IDL/be/be_union_branch.cpp +++ b/TAO/TAO_IDL/be/be_union_branch.cpp @@ -54,7 +54,7 @@ be_union_branch::gen_label_value (TAO_OutStream *os, unsigned long index) // If the enum is not in the global scope we have to prefix it. be_union *u = - be_union::narrow_from_scope (this->defined_in ()); + dynamic_cast<be_union*> (this->defined_in ()); if (u == 0) { @@ -62,7 +62,7 @@ be_union_branch::gen_label_value (TAO_OutStream *os, unsigned long index) } be_type* dt = - be_type::narrow_from_decl (u->disc_type ()); + dynamic_cast<be_type*> (u->disc_type ()); if (dt == 0) { @@ -83,7 +83,7 @@ be_union_branch::gen_label_value (TAO_OutStream *os, unsigned long index) // Find where was the enum defined, if it was defined in the globa // scope, then it is easy to generate the enum values.... be_scope* scope = - be_scope::narrow_from_scope (dt->defined_in ()); + dynamic_cast<be_scope*> (dt->defined_in ()); if (scope == 0) { @@ -141,7 +141,7 @@ be_union_branch::gen_default_label_value (TAO_OutStream *os, // discriminant, so we must generate the string name. { AST_ConcreteType *act = bu->disc_type (); - be_enum *be = be_enum::narrow_from_decl (act); + be_enum *be = dynamic_cast<be_enum*> (act); UTL_ScopedName *sn = be->value_to_name (dv.u.enum_val); if (sn) @@ -188,7 +188,3 @@ be_union_branch::destroy (void) this->be_decl::destroy (); this->AST_UnionBranch::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_union_branch) diff --git a/TAO/TAO_IDL/be/be_union_fwd.cpp b/TAO/TAO_IDL/be/be_union_fwd.cpp index 064cbece771..5ffcca78e35 100644 --- a/TAO/TAO_IDL/be/be_union_fwd.cpp +++ b/TAO/TAO_IDL/be/be_union_fwd.cpp @@ -49,7 +49,3 @@ be_union_fwd::accept (be_visitor *visitor) { return visitor->visit_union_fwd (this); } - - - -IMPL_NARROW_FROM_DECL (be_union_fwd) diff --git a/TAO/TAO_IDL/be/be_uses.cpp b/TAO/TAO_IDL/be/be_uses.cpp index 1837fb30a19..739e7865011 100644 --- a/TAO/TAO_IDL/be/be_uses.cpp +++ b/TAO/TAO_IDL/be/be_uses.cpp @@ -31,7 +31,7 @@ be_type * be_uses::uses_type (void) const { return - be_type::narrow_from_decl ( + dynamic_cast<be_type*> ( this->AST_Uses::uses_type ()); } @@ -59,5 +59,3 @@ be_uses::original_uses (void) { return this->original_uses_; } - -IMPL_NARROW_FROM_DECL (be_uses) diff --git a/TAO/TAO_IDL/be/be_util.cpp b/TAO/TAO_IDL/be/be_util.cpp index 14813ba4f6b..5b7d379ad4a 100644 --- a/TAO/TAO_IDL/be/be_util.cpp +++ b/TAO/TAO_IDL/be/be_util.cpp @@ -1017,9 +1017,9 @@ be_util::set_arg_seen_bit (be_type *bt) { case AST_Decl::NT_typedef: { - AST_Typedef *td = AST_Typedef::narrow_from_decl (bt); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (bt); be_util::set_arg_seen_bit ( - be_type::narrow_from_decl (td->primitive_base_type ()) + dynamic_cast<be_type*> (td->primitive_base_type ()) ); break; } @@ -1049,8 +1049,8 @@ be_util::set_arg_seen_bit (be_type *bt) case AST_Decl::NT_struct_fwd: case AST_Decl::NT_union_fwd: { - AST_StructureFwd *fwd = AST_StructureFwd::narrow_from_decl (bt); - be_type *fd = be_type::narrow_from_decl (fwd->full_definition ()); + AST_StructureFwd *fwd = dynamic_cast<AST_StructureFwd*> (bt); + be_type *fd = dynamic_cast<be_type*> (fwd->full_definition ()); be_util::set_arg_seen_bit (fd); break; } @@ -1061,7 +1061,7 @@ be_util::set_arg_seen_bit (be_type *bt) case AST_Decl::NT_string: case AST_Decl::NT_wstring: { - AST_String *str = AST_String::narrow_from_decl (bt); + AST_String *str = dynamic_cast<AST_String*> (bt); if (str->max_size ()->ev ()->u.ulval == 0) { @@ -1090,7 +1090,7 @@ be_util::set_arg_seen_bit (be_type *bt) break; case AST_Decl::NT_pre_defined: { - AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (bt); + AST_PredefinedType *pdt = dynamic_cast<AST_PredefinedType*> (bt); switch (pdt->pt ()) { diff --git a/TAO/TAO_IDL/be/be_valuebox.cpp b/TAO/TAO_IDL/be/be_valuebox.cpp index 21d00fd2972..e9ec804ac2e 100644 --- a/TAO/TAO_IDL/be/be_valuebox.cpp +++ b/TAO/TAO_IDL/be/be_valuebox.cpp @@ -63,7 +63,3 @@ be_valuebox::destroy (void) this->AST_ValueBox::destroy (); this->be_type::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_valuebox) diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp index eeb9d21a15f..c33d72cf256 100644 --- a/TAO/TAO_IDL/be/be_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_valuetype.cpp @@ -85,7 +85,7 @@ be_valuetype::be_valuetype (UTL_ScopedName *n, // Always the case. this->size_type (AST_Type::VARIABLE); - AST_Module *m = AST_Module::narrow_from_scope (this->defined_in ()); + AST_Module *m = dynamic_cast<AST_Module*> (this->defined_in ()); if (m != 0) { @@ -98,7 +98,7 @@ be_valuetype::be_valuetype (UTL_ScopedName *n, for (long i = 0; i < this->pd_n_supports; ++i) { be_interface *intf = - be_interface::narrow_from_decl (this->pd_supports[i]); + dynamic_cast<be_interface*> (this->pd_supports[i]); if (intf == 0) { @@ -138,7 +138,7 @@ be_valuetype::~be_valuetype (void) void be_valuetype::redefine (AST_Interface *from) { - be_valuetype *bv = be_valuetype::narrow_from_decl (from); + be_valuetype *bv = dynamic_cast<be_valuetype*> (from); // This should always be TRUE, but our signature is inherited, so // the narrow is necessary and should always be checked. @@ -301,7 +301,7 @@ be_valuetype::have_operation (void) for (i = 0; i < n_inherits; ++i) { - be_valuetype *vt = be_valuetype::narrow_from_decl (inherits[i]); + be_valuetype *vt = dynamic_cast<be_valuetype*> (inherits[i]); if (vt != 0 && vt->have_operation ()) { @@ -319,7 +319,7 @@ be_valuetype::have_operation (void) if (supported != 0) { be_interface *intf = - be_interface::narrow_from_decl (supported); + dynamic_cast<be_interface*> (supported); if (intf != 0) { @@ -378,7 +378,7 @@ be_valuetype::have_supported_op (be_interface * node) for (i = 0; i < n_inherits; ++i) { be_interface * intf = - be_interface::narrow_from_decl (inherits[i]); + dynamic_cast<be_interface*> (inherits[i]); if (intf != 0) { @@ -413,7 +413,7 @@ be_valuetype::has_member (void) if (parent != 0) { be_valuetype *be_parent = - be_valuetype::narrow_from_decl (parent); + dynamic_cast<be_valuetype*> (parent); if (be_parent->has_member ()) { @@ -606,7 +606,7 @@ be_valuetype::statefull_inherit (void) if (this->pd_inherits_concrete != 0) { return - be_valuetype::narrow_from_decl ( + dynamic_cast<be_valuetype*> ( this->pd_inherits_concrete); } else @@ -651,8 +651,8 @@ be_valuetype::data_members_count (AST_Field::Visibility vis) 0); } - AST_Field *field = AST_Field::narrow_from_decl (d); - AST_Attribute *attr = AST_Attribute::narrow_from_decl (d); + AST_Field *field = dynamic_cast<AST_Field*> (d); + AST_Attribute *attr = dynamic_cast<AST_Attribute*> (d); if (field == 0 || attr != 0) { @@ -718,7 +718,7 @@ be_valuetype::traverse_supports_list_graphs ( } supported_interface = - be_interface::narrow_from_decl (this->pd_supports[i]); + dynamic_cast<be_interface*> (this->pd_supports[i]); // Insert a supported interface in the queue. if (this->insert_queue.enqueue_tail (supported_interface) == -1) @@ -750,7 +750,7 @@ be_valuetype::traverse_concrete_inheritance_graph (tao_code_emitter gen, } be_interface *concrete = - be_interface::narrow_from_decl (supported); + dynamic_cast<be_interface*> (supported); // Make sure the queues are empty. this->insert_queue.reset (); @@ -783,6 +783,3 @@ be_valuetype::abstract_supports_helper (be_interface *, return 0; } - -IMPL_NARROW_FROM_DECL (be_valuetype) -IMPL_NARROW_FROM_SCOPE (be_valuetype) diff --git a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp index a10a3874255..56fc75defc9 100644 --- a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp +++ b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp @@ -51,8 +51,3 @@ be_valuetype_fwd::destroy (void) { this->be_interface_fwd::destroy (); } - - - -IMPL_NARROW_FROM_DECL (be_valuetype_fwd) - diff --git a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp index bf34b126a16..a694dbc036f 100644 --- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp @@ -106,7 +106,7 @@ be_visitor_amh_pre_proc::visit_interface (be_interface *node) excep_holder->is_amh_excep_holder (true); AST_Module *module = - AST_Module::narrow_from_scope (node->defined_in ()); + dynamic_cast<AST_Module*> (node->defined_in ()); module->set_has_nested_valuetype (); // Create the ResponseHandler class @@ -229,7 +229,7 @@ be_visitor_amh_pre_proc::add_rh_node_members ( be_interface *node, if (nt == AST_Decl::NT_attr) { - be_attribute *attr = be_attribute::narrow_from_decl (d); + be_attribute *attr = dynamic_cast<be_attribute*> (d); if (attr != 0) { @@ -250,7 +250,7 @@ be_visitor_amh_pre_proc::add_rh_node_members ( be_interface *node, } else if (nt == AST_Decl::NT_op) { - be_operation* operation = be_operation::narrow_from_decl (d); + be_operation* operation = dynamic_cast<be_operation*> (d); if (operation != 0) { @@ -491,8 +491,8 @@ be_visitor_amh_pre_proc::add_normal_reply (be_operation *node, } - //be_decl *arg = be_decl::narrow_from_decl (d); - AST_Argument *original_arg = AST_Argument::narrow_from_decl (d); + //be_decl *arg = dynamic_cast<be_decl*> (d); + AST_Argument *original_arg = dynamic_cast<AST_Argument*> (d); if (original_arg->direction () == AST_Argument::dir_INOUT || original_arg->direction () == AST_Argument::dir_OUT) @@ -606,12 +606,12 @@ be_visitor_amh_pre_proc::create_exception_holder (be_interface *node) 0); } - be_decl *op = be_decl::narrow_from_decl (d); + be_decl *op = dynamic_cast<be_decl*> (d); AST_Decl::NodeType nt = d->node_type (); if (nt == AST_Decl::NT_attr) { - AST_Attribute *attribute = AST_Attribute::narrow_from_decl (d); + AST_Attribute *attribute = dynamic_cast<AST_Attribute*> (d); if (attribute == 0) { @@ -657,7 +657,7 @@ be_visitor_amh_pre_proc::create_raise_operation ( if (operation_kind == NORMAL) { - orig_op = be_operation::narrow_from_decl (node); + orig_op = dynamic_cast<be_operation*> (node); } // Name the operation properly diff --git a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp index d9b13eba963..c1903159456 100644 --- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp @@ -144,7 +144,7 @@ be_visitor_ami_pre_proc::visit_interface (be_interface *node) } AST_Module *module = - AST_Module::narrow_from_scope (node->defined_in ()); + dynamic_cast<AST_Module*> (node->defined_in ()); if (!module) { @@ -203,7 +203,7 @@ be_visitor_ami_pre_proc::visit_operation (be_operation *node) } be_interface *parent = - be_interface::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_interface*> (node->defined_in ()); // If we're here, we're sure that the arg traits specialization // for this will be needed. @@ -340,7 +340,7 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node) if (d->node_type () == AST_Decl::NT_attr) { - be_attribute *attribute = be_attribute::narrow_from_decl (d); + be_attribute *attribute = dynamic_cast<be_attribute*> (d); if (attribute) { @@ -376,7 +376,7 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node) } else { - be_operation* operation = be_operation::narrow_from_decl (d); + be_operation* operation = dynamic_cast<be_operation*> (d); if (operation) { @@ -439,7 +439,7 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node) // Look up the field type. UTL_Scope *s = node->defined_in (); - be_interface *parent = be_interface::narrow_from_scope (s); + be_interface *parent = dynamic_cast<be_interface*> (s); // Add the pre- and suffix ACE_CString handler_local_name; @@ -467,7 +467,7 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node) } be_interface *field_type = - be_interface::narrow_from_decl (handler); + dynamic_cast<be_interface*> (handler); ACE_NEW_RETURN (id, Identifier ("ami_handler"), @@ -522,7 +522,7 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node) } - AST_Argument *original_arg = AST_Argument::narrow_from_decl (d); + AST_Argument *original_arg = dynamic_cast<AST_Argument*> (d); if (original_arg->direction () == AST_Argument::dir_IN || original_arg->direction () == AST_Argument::dir_INOUT) @@ -656,7 +656,7 @@ be_visitor_ami_pre_proc::create_reply_handler_operation ( } - AST_Argument *original_arg = AST_Argument::narrow_from_decl (d); + AST_Argument *original_arg = dynamic_cast<AST_Argument*> (d); if (original_arg->direction () == AST_Argument::dir_INOUT || original_arg->direction () == AST_Argument::dir_OUT) @@ -855,7 +855,7 @@ be_visitor_ami_pre_proc::visit_scope (be_scope *node) continue; } - be_decl *bd = be_decl::narrow_from_decl (d); + be_decl *bd = dynamic_cast<be_decl*> (d); // Set the scope node as "node" in which the code is being // generated so that elements in the node's scope can use it @@ -1053,7 +1053,7 @@ be_visitor_ami_pre_proc::create_inheritance_list (be_interface *node, if (d != 0) { - retval[index] = AST_Interface::narrow_from_decl (d); + retval[index] = dynamic_cast<AST_Interface*> (d); retval[index++]->set_prefix_with_typeprefix (parent->prefix () ? const_cast<char*> (parent->prefix()) : const_cast<char*> ("")); @@ -1142,7 +1142,7 @@ be_visitor_ami_pre_proc::generate_ami4ccm_idl (void) sn = 0; be_interface *iface = - be_interface::narrow_from_decl (d); + dynamic_cast<be_interface*> (d); if (iface == 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp index c8de4b12d65..b1528b48f1c 100644 --- a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp @@ -209,7 +209,7 @@ be_visitor_arg_traits::visit_interface_fwd (be_interface_fwd *node) } be_interface *fd = - be_interface::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_interface*> (node->full_definition ()); // The logic in visit_interface() should handle what gets generated // and what doesn't. @@ -368,7 +368,7 @@ be_visitor_arg_traits::visit_valuetype_fwd (be_valuetype_fwd *node) } be_valuetype *fd = - be_valuetype::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_valuetype*> (node->full_definition ()); // The logic in visit_valuetype() should handle what gets generated // and what doesn't. @@ -418,7 +418,7 @@ be_visitor_arg_traits::visit_operation (be_operation *node) // Arg_Traits<> template parameter. if (nt == AST_Decl::NT_string || nt == AST_Decl::NT_wstring) { - AST_String *str = AST_String::narrow_from_decl (rt); + AST_String *str = dynamic_cast<AST_String*> (rt); ACE_CDR::ULong bound = str->max_size ()->ev ()->u.ulval; if (bound > 0) @@ -489,7 +489,7 @@ be_visitor_arg_traits::visit_attribute (be_attribute *node) return 0; } - AST_String *st = AST_String::narrow_from_decl (node->field_type ()); + AST_String *st = dynamic_cast<AST_String*> (node->field_type ()); if (st == 0) { @@ -575,7 +575,7 @@ be_visitor_arg_traits::visit_argument (be_argument *node) return 0; } - be_string *st = be_string::narrow_from_decl (bt); + be_string *st = dynamic_cast<be_string*> (bt); ACE_CDR::ULong bound = st->max_size ()->ev ()->u.ulval; if (bound == 0) @@ -992,7 +992,7 @@ be_visitor_arg_traits::visit_structure (be_structure *node) int be_visitor_arg_traits::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -1106,7 +1106,7 @@ be_visitor_arg_traits::visit_union (be_union *node) int be_visitor_arg_traits::visit_union_branch (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp index da6cfa447e6..2815a5a50c9 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp @@ -32,7 +32,7 @@ int be_visitor_args_arglist::visit_argument (be_argument *node) this->ctx_->node (node); // Retrieve the type. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp index f345289f030..6162775336a 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp @@ -77,7 +77,7 @@ be_visitor_args::direction (void) // Grab the argument node. We know that our context has stored the right // argument node. be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); return arg->direction (); } @@ -146,7 +146,7 @@ be_visitor_args::gen_pd_arg (be_predefined_type *node, const char *to_from = to_from_str.c_str (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); const char *lname = arg->local_name ()->get_string (); switch (pt) diff --git a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp index 891adb52b07..c5944774095 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp @@ -30,7 +30,7 @@ int be_visitor_args_invoke_cs::visit_argument (be_argument *node) { this->ctx_->node (node); be_type *bt = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -128,7 +128,7 @@ int be_visitor_args_invoke_cs::visit_array (be_array *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -175,7 +175,7 @@ int be_visitor_args_invoke_cs::visit_enum (be_enum *) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -254,7 +254,7 @@ int be_visitor_args_invoke_cs::visit_sequence (be_sequence *) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -298,7 +298,7 @@ int be_visitor_args_invoke_cs::visit_string (be_string *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -451,7 +451,7 @@ int be_visitor_args_invoke_cs::emit_common (void) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -495,7 +495,7 @@ int be_visitor_args_invoke_cs::emit_common2 (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { diff --git a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp index 2c2f2fd09e3..4c6294b0ad1 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp @@ -32,7 +32,7 @@ int be_visitor_args_marshal_ss::visit_argument ( be_argument *node) { this->ctx_->node (node); - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -130,7 +130,7 @@ int be_visitor_args_marshal_ss::visit_array (be_array *) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); const char *lname = arg->local_name ()->get_string (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -173,7 +173,7 @@ int be_visitor_args_marshal_ss::visit_enum (be_enum *) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); const char *lname = arg->local_name ()->get_string (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -252,7 +252,7 @@ int be_visitor_args_marshal_ss::visit_sequence (be_sequence *) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); const char *lname = arg->local_name ()->get_string (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -297,7 +297,7 @@ int be_visitor_args_marshal_ss::visit_string (be_string *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); const char *lname = arg->local_name ()->get_string (); ACE_CDR::ULong bound = node->max_size ()->ev ()->u.ulval; bool wide = @@ -443,7 +443,7 @@ be_visitor_args_marshal_ss::emit_common (void) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); const char *lname = arg->local_name ()->get_string (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -488,7 +488,7 @@ be_visitor_args_marshal_ss::emit_common2 (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); const char *lname = arg->local_name ()->get_string (); AST_Type::SIZE_TYPE st = node->size_type (); diff --git a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp index deb129f256b..bf59b624591 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp @@ -28,7 +28,7 @@ be_visitor_args_upcall_ss::~be_visitor_args_upcall_ss (void) int be_visitor_args_upcall_ss::visit_argument (be_argument *node) { this->ctx_->node (node); - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -61,7 +61,7 @@ int be_visitor_args_upcall_ss::visit_array (be_array *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); switch (this->direction ()) { @@ -108,7 +108,7 @@ int be_visitor_args_upcall_ss::visit_enum (be_enum *) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); switch (this->direction ()) { @@ -158,7 +158,7 @@ int be_visitor_args_upcall_ss::visit_predefined_type ( { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); AST_PredefinedType::PredefinedType pt = node->pt (); if (pt == AST_PredefinedType::PT_any) @@ -248,7 +248,7 @@ int be_visitor_args_upcall_ss::visit_sequence ( { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); switch (this->direction ()) { @@ -347,7 +347,7 @@ int be_visitor_args_upcall_ss::emit_common (void) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); switch (this->direction ()) { @@ -397,7 +397,7 @@ int be_visitor_args_upcall_ss::emit_common2 ( { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); switch (this->direction ()) { diff --git a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp index 0bf36459e38..c6326c6afcd 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp @@ -31,7 +31,7 @@ int be_visitor_args_vardecl_ss::visit_argument ( be_argument *node) { this->ctx_->node (node); - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -65,7 +65,7 @@ int be_visitor_args_vardecl_ss::visit_array ( { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); be_type *bt = 0; if (this->ctx_->alias ()) @@ -113,7 +113,7 @@ int be_visitor_args_vardecl_ss::visit_enum (be_enum *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); be_type *bt = 0; if (this->ctx_->alias ()) @@ -175,7 +175,7 @@ int be_visitor_args_vardecl_ss::visit_predefined_type ( { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); be_type *bt = 0; if (this->ctx_->alias ()) @@ -260,7 +260,7 @@ int be_visitor_args_vardecl_ss::visit_sequence ( { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); be_type *bt = 0; if (this->ctx_->alias ()) @@ -295,7 +295,7 @@ int be_visitor_args_vardecl_ss::visit_string ( { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); switch (this->direction ()) { @@ -401,7 +401,7 @@ be_visitor_args_vardecl_ss::emit_common ( { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); be_type *bt = 0; if (this->ctx_->alias ()) @@ -438,7 +438,7 @@ be_visitor_args_vardecl_ss::emit_common2 (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); be_type *bt = 0; if (this->ctx_->alias ()) diff --git a/TAO/TAO_IDL/be/be_visitor_array/array.cpp b/TAO/TAO_IDL/be/be_visitor_array/array.cpp index 7bb40c6e001..28ab78b534d 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array.cpp @@ -147,7 +147,7 @@ be_visitor_array::visit_typedef (be_typedef *node) if (nt == AST_Decl::NT_pre_defined) { - AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (pbt); + AST_PredefinedType *pdt = dynamic_cast<AST_PredefinedType*> (pbt); pt = pdt->pt (); } diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp index 50e9e8facf1..affd9b6e14d 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp @@ -35,7 +35,7 @@ int be_visitor_array_ch::visit_array (be_array *node) this->ctx_->node (node); // Retrieve the type. - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp index 11d7cccbaac..a57454afa0f 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp @@ -31,7 +31,7 @@ int be_visitor_array_ci::visit_array (be_array *node) this->ctx_->node (node); // save the array node // If we contain an anonymous sequence, generate code for it here. - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { @@ -121,7 +121,7 @@ int be_visitor_array_ci::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), @@ -153,7 +153,7 @@ int be_visitor_array_ci::visit_array (be_array *node) if (nt == AST_Decl::NT_typedef) { - be_typedef *td = be_typedef::narrow_from_decl (bt); + be_typedef *td = dynamic_cast<be_typedef*> (bt); unique = td->primitive_base_type ()->flat_name (); } else @@ -234,11 +234,11 @@ int be_visitor_array_ci::visit_array (be_array *node) while (tmp->node_type () == AST_Decl::NT_typedef) { - be_typedef *tdef = be_typedef::narrow_from_decl (tmp); - tmp = be_type::narrow_from_decl (tdef->base_type ()); + be_typedef *tdef = dynamic_cast<be_typedef*> (tmp); + tmp = dynamic_cast<be_type*> (tdef->base_type ()); } - primitive_type = be_array::narrow_from_decl (tmp); + primitive_type = dynamic_cast<be_array*> (tmp); } *os << "// Zero each individual element." << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp index edfd9e18351..310c641cb70 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp @@ -33,7 +33,7 @@ int be_visitor_array_cs::visit_array (be_array *node) this->ctx_->node (node); // Retrieve the type. - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { @@ -70,7 +70,7 @@ int be_visitor_array_cs::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), @@ -206,11 +206,11 @@ int be_visitor_array_cs::visit_array (be_array *node) while (tmp->node_type () == AST_Decl::NT_typedef) { - be_typedef *tdef = be_typedef::narrow_from_decl (tmp); - tmp = be_type::narrow_from_decl (tdef->base_type ()); + be_typedef *tdef = dynamic_cast<be_typedef*> (tmp); + tmp = dynamic_cast<be_type*> (tdef->base_type ()); } - primitive_type = be_array::narrow_from_decl (tmp); + primitive_type = dynamic_cast<be_array*> (tmp); } if (primitive_type != 0) diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp index e4f4bda808b..2f57e164eee 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp @@ -33,7 +33,7 @@ be_visitor_array_cdr_op_ch::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); AST_Decl::NodeType nt = bt->node_type (); // If the node is an array of anonymous sequence, we need to @@ -100,7 +100,7 @@ be_visitor_array_cdr_op_ch::visit_array (be_array *node) *os << be_global->core_versioning_begin () << be_nl; - be_scope* scope = be_scope::narrow_from_scope (node->defined_in ()); + be_scope* scope = dynamic_cast<be_scope*> (node->defined_in ()); be_decl* parent = scope->decl (); be_typedef *td = this->ctx_->tdef (); ACE_CString arg_name (ACE_CString (parent->full_name ()) diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp index 1f8d4590b74..9fb7f847b38 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp @@ -41,7 +41,7 @@ be_visitor_array_cdr_op_cs::visit_array (be_array *node) } // Retrieve the base type. - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { @@ -140,7 +140,7 @@ be_visitor_array_cdr_op_cs::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), @@ -286,7 +286,7 @@ be_visitor_array_cdr_op_cs::visit_predefined_type ( // Grab the array node. be_array *array = - be_array::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_array*> (this->ctx_->node ()); if (array == 0) { @@ -553,7 +553,7 @@ be_visitor_array_cdr_op_cs::visit_node (be_type *bt) TAO_OutStream *os = this->ctx_->stream (); ACE_CDR::ULong i; be_array *node = - be_array::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_array*> (this->ctx_->node ()); AST_Decl::NodeType nt = bt->node_type (); if (node == 0) @@ -637,7 +637,7 @@ be_visitor_array_cdr_op_cs::visit_node (be_type *bt) if (bt->node_type () == AST_Decl::NT_string || bt->node_type () == AST_Decl::NT_wstring) { - str = be_string::narrow_from_decl (bt); + str = dynamic_cast<be_string*> (bt); if (!str) { ACE_ERROR_RETURN ((LM_ERROR, @@ -698,7 +698,7 @@ be_visitor_array_cdr_op_cs::visit_node (be_type *bt) // We need to separately handle this case of pseudo // objects because they have a _var type. be_predefined_type *pt = - be_predefined_type::narrow_from_decl (bt); + dynamic_cast<be_predefined_type*> (bt); if (!pt) { @@ -764,7 +764,7 @@ be_visitor_array_cdr_op_cs::visit_node (be_type *bt) if (bt->node_type () == AST_Decl::NT_string || bt->node_type () == AST_Decl::NT_wstring) { - str = be_string::narrow_from_decl (bt); + str = dynamic_cast<be_string*> (bt); if (!str) { ACE_ERROR_RETURN ((LM_ERROR, @@ -825,7 +825,7 @@ be_visitor_array_cdr_op_cs::visit_node (be_type *bt) // We need to separately handle this case of pseudo // objects because they have a _var type. be_predefined_type *pt = - be_predefined_type::narrow_from_decl (bt); + dynamic_cast<be_predefined_type*> (bt); if (!pt) { diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/ccm_init.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/ccm_init.cpp index 68056b645bb..0c37a02e21a 100644 --- a/TAO/TAO_IDL/be/be_visitor_attribute/ccm_init.cpp +++ b/TAO/TAO_IDL/be/be_visitor_attribute/ccm_init.cpp @@ -49,7 +49,7 @@ be_visitor_attribute_ccm_init::visit_attribute ( } attr_ = node; - be_type *ft = be_type::narrow_from_decl (node->field_type ()); + be_type *ft = dynamic_cast<be_type*> (node->field_type ()); return ft->accept (this); } @@ -170,7 +170,7 @@ be_visitor_attribute_ccm_init::emit_init_block (void) this->open_if_block (); be_visitor_any_extracted_type_decl decl_emitter (this->ctx_); - be_type *ft = be_type::narrow_from_decl (attr_->field_type ()); + be_type *ft = dynamic_cast<be_type*> (attr_->field_type ()); if (ft->accept (&decl_emitter) == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/set_from_extracted.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/set_from_extracted.cpp index 4de6e726456..38e66df8bb6 100644 --- a/TAO/TAO_IDL/be/be_visitor_attribute/set_from_extracted.cpp +++ b/TAO/TAO_IDL/be/be_visitor_attribute/set_from_extracted.cpp @@ -137,7 +137,7 @@ be_visitor_attribute_set_from_extracted::visit_typedef ( be_typedef *node) { be_type *pbt = - be_type::narrow_from_decl (node->primitive_base_type ()); + dynamic_cast<be_type*> (node->primitive_base_type ()); return (pbt->accept (this)); } diff --git a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp index f54de26ad5d..87bdac3da60 100644 --- a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp @@ -460,7 +460,7 @@ int be_visitor_ccm_pre_proc::visit_eventtype_fwd (be_eventtype_fwd *node) { be_eventtype *fd = - be_eventtype::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_eventtype*> (node->full_definition ()); return this->visit_eventtype (fd); } @@ -783,7 +783,7 @@ be_visitor_ccm_pre_proc::gen_get_connection_multiple (be_uses *node) 0); AST_Decl *d = comp_->lookup_by_name (&connections_name, true); - be_typedef *td = be_typedef::narrow_from_decl (d); + be_typedef *td = dynamic_cast<be_typedef*> (d); connections_id.destroy (); be_operation *op = 0; @@ -1397,7 +1397,7 @@ be_visitor_ccm_pre_proc::lookup_cookie (void) return -1; } - this->cookie_ = be_valuetype::narrow_from_decl (d); + this->cookie_ = dynamic_cast<be_valuetype*> (d); if (this->cookie_ == 0) { @@ -1474,7 +1474,7 @@ be_visitor_ccm_pre_proc::lookup_one_exception (const char *name, return -1; } - result = be_exception::narrow_from_decl (d); + result = dynamic_cast<be_exception*> (d); if (result == 0) { @@ -1506,7 +1506,7 @@ be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) } AST_Interface *event_consumer = 0; - AST_Module *m = AST_Module::narrow_from_scope (s); + AST_Module *m = dynamic_cast<AST_Module*> (s); // We're at global scope here so we need to fool the scope stack // for a minute so the correct repo id can be calculated at @@ -1543,7 +1543,7 @@ be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) event_consumer->set_imported (node->imported ()); event_consumer->set_name (consumer_name); be_interface *bec = - be_interface::narrow_from_decl (event_consumer); + dynamic_cast<be_interface*> (event_consumer); bec->original_interface (node); // Set repo id to 0, so it will be recomputed on the next access, @@ -1554,7 +1554,7 @@ be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) event_consumer->repoID (0); event_consumer->prefix (const_cast<char*> (node->prefix ())); - be_type::narrow_from_decl (event_consumer)->gen_fwd_helper_name (); + dynamic_cast<be_type*> (event_consumer)->gen_fwd_helper_name (); m->be_add_interface (event_consumer); return this->gen_push_op (node, event_consumer); @@ -1576,7 +1576,7 @@ be_visitor_ccm_pre_proc::lookup_consumer (be_field *node) return 0; } - AST_Interface *i = AST_Interface::narrow_from_decl (d); + AST_Interface *i = dynamic_cast<AST_Interface*> (d); if (i == 0) { @@ -1675,7 +1675,7 @@ be_visitor_ccm_pre_proc::create_implicit (be_home *node) i->gen_fwd_helper_name (); i->original_interface (node); - AST_Module *m = AST_Module::narrow_from_scope (node->defined_in ()); + AST_Module *m = dynamic_cast<AST_Module*> (node->defined_in ()); m->be_add_interface (i); return i; @@ -1738,7 +1738,7 @@ be_visitor_ccm_pre_proc::create_equivalent (be_home *node, "_tao_home_name_extension", ScopeAsDecl (s)); node->set_name (mangled_name); - AST_Module *m = AST_Module::narrow_from_scope (s); + AST_Module *m = dynamic_cast<AST_Module*> (s); /// Calling be_add_interface() here calls add_to_referenced(), /// which will give a redef error. @@ -1883,7 +1883,7 @@ be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) delete sn; sn = 0; - be_uses *u = be_uses::narrow_from_decl (d); + be_uses *u = dynamic_cast<be_uses*> (d); if (u == 0) { @@ -1896,7 +1896,7 @@ be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) } be_interface *iface = - be_interface::narrow_from_decl (u->uses_type ()); + dynamic_cast<be_interface*> (u->uses_type ()); /// The real AMI_xxx exists only in the *A.idl file, so /// we create a dummy as the uses type for the implied @@ -1904,7 +1904,7 @@ be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) /// already been created for this uses type. be_interface *ami_iface = - be_interface::narrow_from_decl (iface->ami4ccm_uses ()); + dynamic_cast<be_interface*> (iface->ami4ccm_uses ()); if (ami_iface == 0) { @@ -1970,7 +1970,7 @@ be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) */ // Grammar ensures this narrowing will never be 0. AST_Component *c = - AST_Component::narrow_from_scope (s); + dynamic_cast<AST_Component*> (s); FE_Utils::create_uses_multiple_stuff (c, ami_uses); } } diff --git a/TAO/TAO_IDL/be/be_visitor_component/component.cpp b/TAO/TAO_IDL/be/be_visitor_component/component.cpp index 5bf1836db45..4df9fdbecd2 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component.cpp @@ -316,7 +316,7 @@ be_visitor_component::visit_extended_port ( /// original porttype, this is a way for visitors down the /// line to tell what scope we are actually in. this->ctx_->interface ( - be_interface::narrow_from_scope (node->defined_in ())); + dynamic_cast<be_interface*> (node->defined_in ())); be_porttype *pt = node->port_type (); @@ -345,7 +345,7 @@ be_visitor_component::visit_mirror_port (be_mirror_port *node) /// original porttype, this is a way for visitors down the /// line to tell what scope we are actually in. this->ctx_->interface ( - be_interface::narrow_from_scope (node->defined_in ())); + dynamic_cast<be_interface*> (node->defined_in ())); be_porttype *pt = node->port_type (); diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_ex_base.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_ex_base.cpp index 50ba087ec5a..1c19733f9b8 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_ex_base.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_ex_base.cpp @@ -33,7 +33,7 @@ be_visitor_component_ami_rh_ex_base::post_process (be_decl *bd) if (bd->node_type () == AST_Decl::NT_argument) { AST_Argument *arg = - AST_Argument::narrow_from_decl (bd); + dynamic_cast<AST_Argument*> (bd); if (arg->direction () != AST_Argument::dir_IN && ! this->last_inout_or_out_node (bd)) diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_exh.cpp index 56c89bfd64c..ba504ea5f33 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_exh.cpp @@ -28,7 +28,7 @@ be_visitor_component_ami_rh_exh::visit_uses (be_uses *node) this->port_ = node; this->iface_ = - be_interface::narrow_from_decl (node->uses_type ()); + dynamic_cast<be_interface*> (node->uses_type ()); this->init (); diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_exs.cpp index cf8df9cddea..1618e44d94a 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ami_rh_exs.cpp @@ -29,7 +29,7 @@ be_visitor_component_ami_rh_exs::visit_uses (be_uses *node) this->port_ = node; this->iface_ = - be_interface::narrow_from_decl (node->uses_type ()); + dynamic_cast<be_interface*> (node->uses_type ()); this->init (); diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp index 55b941d8a80..5924ed810b1 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp @@ -100,7 +100,7 @@ be_visitor_component_exh::visit_component (be_component *node) delete sn; sn = 0; - be_uses *u = be_uses::narrow_from_decl (d); + be_uses *u = dynamic_cast<be_uses*> (d); if (u == 0) { @@ -113,7 +113,7 @@ be_visitor_component_exh::visit_component (be_component *node) } be_component *c = - be_component::narrow_from_decl ( + dynamic_cast<be_component*> ( ScopeAsDecl (u->defined_in ())); if (c == node) diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp index e95463cf1bc..b742c1713fe 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp @@ -101,7 +101,7 @@ be_visitor_component_exs::visit_component (be_component *node) delete sn; sn = 0; - be_uses *u = be_uses::narrow_from_decl (d); + be_uses *u = dynamic_cast<be_uses*> (d); if (u == 0) { @@ -114,7 +114,7 @@ be_visitor_component_exs::visit_component (be_component *node) } be_component *c = - be_component::narrow_from_decl ( + dynamic_cast<be_component*> ( ScopeAsDecl (u->defined_in ())); if (c == node) diff --git a/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp index 0503c92c7dc..1a16a9fe7c2 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp @@ -74,7 +74,7 @@ be_visitor_facet_exh::visit_provides (be_provides *node) if (impl->node_type () == AST_Decl::NT_interface) { be_interface *intf = - be_interface::narrow_from_decl (impl); + dynamic_cast<be_interface*> (impl); os_ << be_nl_2 << "/** @name Operations and attributes from " diff --git a/TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp index 6501c49524b..5b1abe4c53b 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp @@ -55,7 +55,7 @@ be_visitor_facet_exs::visit_attribute (be_attribute *node) } be_decl *attr_scope = - be_decl::narrow_from_decl (ScopeAsDecl (node->defined_in ())); + dynamic_cast<be_decl*> (ScopeAsDecl (node->defined_in ())); nt = attr_scope->node_type (); @@ -115,7 +115,7 @@ be_visitor_facet_exs::visit_provides (be_provides *node) if (impl->node_type () == AST_Decl::NT_interface) { be_interface *intf = - be_interface::narrow_from_decl (impl); + dynamic_cast<be_interface*> (impl); os_ << be_nl_2 << "// Operations from ::" << intf->full_name (); diff --git a/TAO/TAO_IDL/be/be_visitor_component_scope.cpp b/TAO/TAO_IDL/be/be_visitor_component_scope.cpp index 750de044bd6..2dd90e0b89f 100644 --- a/TAO/TAO_IDL/be/be_visitor_component_scope.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component_scope.cpp @@ -154,14 +154,14 @@ be_visitor_component_scope::visit_porttype_scope_mirror ( !si.is_done (); si.next ()) { - be_decl *d = be_decl::narrow_from_decl (si.item ()); + be_decl *d = dynamic_cast<be_decl*> (si.item ()); switch (d->node_type ()) { case AST_Decl::NT_provides: { be_provides *p = - be_provides::narrow_from_decl (d); + dynamic_cast<be_provides*> (d); be_uses mirror_node (p->name (), p->provides_type (), @@ -182,7 +182,7 @@ be_visitor_component_scope::visit_porttype_scope_mirror ( case AST_Decl::NT_uses: { be_uses *u = - be_uses::narrow_from_decl (d); + dynamic_cast<be_uses*> (d); be_provides mirror_node (u->name (), u->uses_type ()); diff --git a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_ex_base.cpp b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_ex_base.cpp index 7343204497f..1a88e28bf65 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_ex_base.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_ex_base.cpp @@ -88,15 +88,15 @@ be_visitor_connector_dds_ex_base::is_dds_type ( if (ACE_OS::strcmp (lname, "DDS_Base") == 0) { - AST_Structure *s = AST_Structure::narrow_from_decl (d); + AST_Structure *s = dynamic_cast<AST_Structure*> (d); if (s == 0) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (d); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (d); if (td != 0) { - s = AST_Structure::narrow_from_decl (td->primitive_base_type ()); + s = dynamic_cast<AST_Structure*> (td->primitive_base_type ()); } } @@ -115,7 +115,7 @@ be_visitor_connector_dds_ex_base::process_template_args ( AST_Connector *node) { AST_Module *m = - AST_Module::narrow_from_scope (node->defined_in ()); + dynamic_cast<AST_Module*> (node->defined_in ()); /// If this is non-zero, we use this to limit our template /// args list to those used in the alias. If it is zero, we @@ -130,7 +130,7 @@ be_visitor_connector_dds_ex_base::process_template_args ( while (this->t_inst_ == 0 && m != 0) { this->t_inst_ = m->from_inst (); - m = AST_Module::narrow_from_scope (m->defined_in ()); + m = dynamic_cast<AST_Module*> (m->defined_in ()); } if (this->t_inst_ == 0) diff --git a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp index 37275aabd0d..2437fd24809 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp @@ -117,13 +117,13 @@ be_visitor_connector_dds_exh::visit_connector (be_connector *node) if (d->node_type () == AST_Decl::NT_typedef) { /// Strip away all layers of typedef before narrowing. - AST_Typedef *td = AST_Typedef::narrow_from_decl (d); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (d); d = td->primitive_base_type (); } /// No need to check if this is 0, but must narrow /// to call virtual function size_type() below. - AST_Type *t = AST_Type::narrow_from_decl (d); + AST_Type *t = dynamic_cast<AST_Type*> (d); switch (param->type_) { @@ -231,7 +231,7 @@ int be_visitor_connector_dds_exh::visit_provides (be_provides *node) { be_interface *iface = - be_interface::narrow_from_decl (node->provides_type ()); + dynamic_cast<be_interface*> (node->provides_type ()); this->gen_interface_connector_trait (iface, node, true); @@ -242,7 +242,7 @@ int be_visitor_connector_dds_exh::visit_uses (be_uses *node) { be_interface *iface = - be_interface::narrow_from_decl (node->uses_type ()); + dynamic_cast<be_interface*> (node->uses_type ()); this->gen_interface_connector_trait (iface, node, false); diff --git a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exs.cpp b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exs.cpp index 45424fa074d..11f787f370f 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exs.cpp @@ -91,13 +91,13 @@ be_visitor_connector_dds_exs::visit_connector (be_connector *node) if (d->node_type () == AST_Decl::NT_typedef) { /// Strip away all layers of typedef before narrowing. - AST_Typedef *td = AST_Typedef::narrow_from_decl (d); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (d); d = td->primitive_base_type (); } /// No need to check if this is 0, but must narrow /// to call virtual function size_type() below. - AST_Type *t = AST_Type::narrow_from_decl (d); + AST_Type *t = dynamic_cast<AST_Type*> (d); switch (param->type_) { diff --git a/TAO/TAO_IDL/be/be_visitor_connector/executor_ami_exs.cpp b/TAO/TAO_IDL/be/be_visitor_connector/executor_ami_exs.cpp index 3f8265af4d2..6cc3e71c274 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/executor_ami_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/executor_ami_exs.cpp @@ -40,7 +40,7 @@ be_visitor_executor_ami_exs::visit_connector (be_connector *node) /// The port is the only item in the connector's scope. UTL_ScopeActiveIterator j (node, UTL_Scope::IK_decls); AST_Extended_Port *p = - AST_Extended_Port::narrow_from_decl (j.item ()); + dynamic_cast<AST_Extended_Port*> (j.item ()); bool first = true; int port_nr = 0; @@ -49,7 +49,7 @@ be_visitor_executor_ami_exs::visit_connector (be_connector *node) i.next ()) { AST_Decl *d = i.item (); - AST_Provides *p = AST_Provides::narrow_from_decl (d); + AST_Provides *p = dynamic_cast<AST_Provides*> (d); if (p != 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exh.cpp b/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exh.cpp index dbe687392dc..0651e27403d 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exh.cpp @@ -51,7 +51,7 @@ int be_visitor_facet_ami_exh::visit_provides (be_provides *node) { this->iface_ = - be_interface::narrow_from_decl (node->provides_type ()); + dynamic_cast<be_interface*> (node->provides_type ()); if (this->gen_reply_handler_class () == -1) { @@ -206,7 +206,7 @@ be_visitor_facet_ami_exh::init (bool for_impl) UTL_ScopedName *sn = FE_Utils::string_to_scoped_name (this->handler_str_.c_str ()); AST_Decl *d = s->lookup_by_name (sn, true, false); - this->callback_iface_ = be_interface::narrow_from_decl (d); + this->callback_iface_ = dynamic_cast<be_interface*> (d); if (this->callback_iface_ == 0) this->sync_ = true; @@ -315,7 +315,7 @@ be_visitor_facet_ami_exh::gen_facet_executor_class (void) sn = 0; be_interface *sync_iface = - be_interface::narrow_from_decl (d); + dynamic_cast<be_interface*> (d); /// The overload of traverse_inheritance_graph() used here /// doesn't automatically prime the queues. diff --git a/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp b/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp index c711169ad5e..b7a17e47f4e 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp @@ -43,7 +43,7 @@ be_visitor_facet_ami_exs::visit_provides (be_provides *node) { this->iface_ = - be_interface::narrow_from_decl (node->provides_type ()); + dynamic_cast<be_interface*> (node->provides_type ()); if (this->gen_reply_handler_class () == -1) { @@ -223,7 +223,7 @@ be_visitor_facet_ami_exs::init (void) be_interface *callback_iface = - be_interface::narrow_from_decl (d); + dynamic_cast<be_interface*> (d); if (callback_iface == 0) this->sync_ = true; @@ -295,7 +295,7 @@ be_visitor_facet_ami_exs::gen_reply_handler_class (void) be_interface *callback_iface = - be_interface::narrow_from_decl (d); + dynamic_cast<be_interface*> (d); /// The overload of traverse_inheritance_graph() used here /// doesn't automatically prime the queues. @@ -363,7 +363,7 @@ be_visitor_facet_ami_exs::gen_facet_executor_class (void) sn = 0; be_interface *sync_iface = - be_interface::narrow_from_decl (d); + dynamic_cast<be_interface*> (d); /// The overload of traverse_inheritance_graph() used here /// doesn't automatically prime the queues. @@ -477,7 +477,7 @@ be_visitor_facet_ami_exs::gen_reply_hander_op (be_operation *node) UTL_ScopeActiveIterator i (node, UTL_Scope::IK_decls); AST_Decl *d = i.item (); AST_Argument *arg = - AST_Argument::narrow_from_decl (d); + dynamic_cast<AST_Argument*> (d); AST_Type *t = arg->field_type (); ACE_CString type_name = t->full_name (); @@ -653,7 +653,7 @@ be_visitor_facet_ami_exs::gen_facet_executor_sync_op (be_operation *node) os_ << be_nl_2; // generate the return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -702,7 +702,7 @@ be_visitor_facet_ami_exs::gen_facet_executor_sync_op (be_operation *node) << "{" << be_idt_nl; AST_PredefinedType *pdt = 0; - pdt = AST_PredefinedType::narrow_from_decl (bt); + pdt = dynamic_cast<AST_PredefinedType*> (bt); bool ret = true; if ((pdt != 0) && (pdt->pt () == AST_PredefinedType::PT_void)) ret =false; diff --git a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp index a8100df3ba0..7f682732403 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp @@ -46,7 +46,7 @@ be_visitor_constant_ch::visit_constant (be_constant *node) if (tdef != 0) { nt = tdef->node_type (); - be_typedef *td = be_typedef:: narrow_from_decl (tdef); + be_typedef *td = dynamic_cast<be_typedef*> (tdef); bnt = td->base_node_type (); } diff --git a/TAO/TAO_IDL/be/be_visitor_decl.cpp b/TAO/TAO_IDL/be/be_visitor_decl.cpp index 14ec839436f..5d3b2f24af9 100644 --- a/TAO/TAO_IDL/be/be_visitor_decl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_decl.cpp @@ -37,7 +37,7 @@ int be_visitor_decl::gen_anonymous_base_type (be_type *bt, TAO_CodeGen::CG_STATE cg_state) { - be_typedef *tdef = be_typedef::narrow_from_decl (bt); + be_typedef *tdef = dynamic_cast<be_typedef*> (bt); if (!tdef) { diff --git a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp index 52fd1b3fc7b..7bae6e9a7f1 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp @@ -46,7 +46,7 @@ be_visitor_enum_any_op_ch::visit_enum (be_enum *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else diff --git a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp index 62be2400733..c8f9a89a2ea 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp @@ -78,7 +78,7 @@ be_visitor_enum_any_op_cs::visit_enum (be_enum *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else diff --git a/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp index 220bbc8daf3..735c673ff54 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp @@ -46,7 +46,7 @@ be_visitor_exception_any_op_ch::visit_exception (be_exception *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else @@ -114,7 +114,7 @@ int be_visitor_exception_any_op_ch::visit_field (be_field *node) { // First generate the type information. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp index 3f6ef5dea96..088ef2615bb 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp @@ -113,7 +113,7 @@ be_visitor_exception_any_op_cs::visit_exception (be_exception *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else @@ -266,7 +266,7 @@ int be_visitor_exception_any_op_cs::visit_field (be_field *node) { // First generate the type information. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp index eb6d879e173..824b682934c 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp @@ -48,7 +48,7 @@ be_visitor_exception_ctor_assign::visit_field (be_field *node) this->ctx_->node (node); // Retrieve the type. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -344,7 +344,7 @@ be_visitor_exception_ctor_assign::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -375,7 +375,7 @@ int be_visitor_exception_ctor_assign::visit_union_fwd (be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } 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 27fd2e6206f..dcee5ccd560 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp @@ -90,7 +90,7 @@ be_visitor_exception_ctor::visit_field (be_field *node) TAO_OutStream *os = this->ctx_->stream (); // get output stream // Retrieve the type. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -132,7 +132,7 @@ be_visitor_exception_ctor::visit_array (be_array *node) *os << "const "; - be_typedef *tdef = be_typedef::narrow_from_decl (bt); + be_typedef *tdef = dynamic_cast<be_typedef*> (bt); if (this->ctx_->state () != TAO_CodeGen::TAO_EXCEPTION_CTOR_CH && !tdef) @@ -391,7 +391,7 @@ be_visitor_exception_ctor::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -429,7 +429,7 @@ int be_visitor_exception_ctor::visit_union_fwd (be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } 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 be1477f0b21..95770253aea 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 @@ -33,7 +33,7 @@ be_visitor_field_cdr_op_ch::~be_visitor_field_cdr_op_ch (void) int be_visitor_field_cdr_op_ch::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -182,7 +182,7 @@ be_visitor_field_cdr_op_ch::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -244,7 +244,7 @@ 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 ()); + dynamic_cast<be_union*> (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 9c336055a34..751a5c1ddc9 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 @@ -28,7 +28,7 @@ be_visitor_field_cdr_op_cs::~be_visitor_field_cdr_op_cs (void) int be_visitor_field_cdr_op_cs::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -81,7 +81,7 @@ be_visitor_field_cdr_op_cs::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -112,7 +112,7 @@ be_visitor_field_cdr_op_cs::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), @@ -188,7 +188,7 @@ be_visitor_field_cdr_op_cs::visit_enum (be_enum *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -231,7 +231,7 @@ be_visitor_field_cdr_op_cs::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -305,7 +305,7 @@ be_visitor_field_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -408,7 +408,7 @@ be_visitor_field_cdr_op_cs::emit_valuetype_common (void) { TAO_OutStream *os = this->ctx_->stream (); be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -456,7 +456,7 @@ be_visitor_field_cdr_op_cs::visit_predefined_type (be_predefined_type *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -579,7 +579,7 @@ be_visitor_field_cdr_op_cs::visit_sequence (be_sequence *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -624,7 +624,7 @@ be_visitor_field_cdr_op_cs::visit_string (be_string *str) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -726,7 +726,7 @@ be_visitor_field_cdr_op_cs::visit_structure (be_structure *node) // retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -769,7 +769,7 @@ be_visitor_field_cdr_op_cs::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -821,7 +821,7 @@ be_visitor_field_cdr_op_cs::visit_union (be_union *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -863,7 +863,7 @@ 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 ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } @@ -887,7 +887,7 @@ be_visitor_cdr_op_field_decl::be_visitor_cdr_op_field_decl ( int be_visitor_cdr_op_field_decl::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (bt == 0) { @@ -920,7 +920,7 @@ be_visitor_cdr_op_field_decl::visit_array (be_array *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -949,7 +949,7 @@ be_visitor_cdr_op_field_decl::visit_array (be_array *node) if (node->is_nested ()) { - be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); + be_decl *parent = dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), 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 105c71840dc..c70562afcc6 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp @@ -31,7 +31,7 @@ int be_visitor_field_ch::visit_field (be_field *node) { TAO_OutStream *os = this->ctx_->stream (); - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -313,7 +313,7 @@ be_visitor_field_ch::visit_sequence (be_sequence *node) // Put the field node into the (anonymous) sequence node, to be // used later for unique name generation. be_field *member_node = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); node->field_node (member_node); // This was already generated in the corresponding valuetype class. @@ -357,7 +357,7 @@ be_visitor_field_ch::visit_sequence (be_sequence *node) // ACE_NESTED_CLASS macro generated by nested_type_name // is not necessary in all cases. - be_typedef *tdef = be_typedef::narrow_from_decl (bt); + be_typedef *tdef = dynamic_cast<be_typedef*> (bt); // This was a typedefed array. // ACE_NESTED_CLASS macro generated by nested_type_name @@ -456,7 +456,7 @@ int be_visitor_field_ch::visit_structure_fwd (be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -543,7 +543,7 @@ int be_visitor_field_ch::visit_union_fwd (be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } 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 eae1db16f16..5f00fc3b481 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp @@ -27,7 +27,7 @@ int be_visitor_field_ci::visit_field (be_field *node) { be_type *bt = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -111,7 +111,7 @@ be_visitor_field_ci::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -162,7 +162,7 @@ int be_visitor_field_ci::visit_union_fwd (be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (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 93bfe7181fb..6c9a95ffc55 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp @@ -32,7 +32,7 @@ be_visitor_field_cs::~be_visitor_field_cs (void) int be_visitor_field_cs::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -154,7 +154,7 @@ be_visitor_field_cs::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -205,7 +205,7 @@ int be_visitor_field_cs::visit_union_fwd (be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp index 6aef08a239e..896e24430af 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp @@ -62,7 +62,7 @@ be_visitor_home_ex_idl::visit_attribute (be_attribute *node) os_ << be_nl << (rd_only ? "readonly " : "") << "attribute "; - be_type *ft = be_type::narrow_from_decl (node->field_type ()); + be_type *ft = dynamic_cast<be_type*> (node->field_type ()); os_ << IdentifierHelper::type_name (ft, this); os_ << " " @@ -89,7 +89,7 @@ be_visitor_home_ex_idl::visit_operation (be_operation *node) os_ << "oneway "; } - be_type *rt = be_type::narrow_from_decl (node->return_type ()); + be_type *rt = dynamic_cast<be_type*> (node->return_type ()); os_ << IdentifierHelper::type_name (rt, this); @@ -136,7 +136,7 @@ be_visitor_home_ex_idl::visit_argument (be_argument *node) return -1; } - be_type *ft = be_type::narrow_from_decl (node->field_type ()); + be_type *ft = dynamic_cast<be_type*> (node->field_type ()); os_ << IdentifierHelper::type_name (ft, this) << " " @@ -178,7 +178,7 @@ be_visitor_home_ex_idl::visit_sequence (be_sequence *node) // Keep output statements separate because of side effects. os_ << "sequence<"; - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); os_ << IdentifierHelper::type_name (bt, this); diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_exh.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_exh.cpp index 7214009bfca..19afc807c32 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_exh.cpp @@ -144,7 +144,7 @@ be_visitor_home_exh::gen_exec_class (void) // A closure of all the supported interfaces is stored // in the base class 'pd_inherits_flat' member. be_interface *bi = - be_interface::narrow_from_decl (h->inherits ()[i]); + dynamic_cast<be_interface*> (h->inherits ()[i]); int status = bi->traverse_inheritance_graph ( @@ -163,7 +163,7 @@ be_visitor_home_exh::gen_exec_class (void) } } - h = be_home::narrow_from_decl (h->base_home ()); + h = dynamic_cast<be_home*> (h->base_home ()); } os_ << be_nl_2 diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_exs.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_exs.cpp index 4d85b77fe57..640d8428717 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_exs.cpp @@ -155,7 +155,7 @@ be_visitor_home_exs::gen_exec_class (void) // A closure of all the supported interfaces is stored // in the base class 'pd_inherits_flat' member. be_interface *bi = - be_interface::narrow_from_decl (h->inherits ()[i]); + dynamic_cast<be_interface*> (h->inherits ()[i]); bi->get_insert_queue ().reset (); bi->get_del_queue ().reset (); @@ -181,7 +181,7 @@ be_visitor_home_exs::gen_exec_class (void) } } - h = be_home::narrow_from_decl (h->base_home ()); + h = dynamic_cast<be_home*> (h->base_home ()); } os_ << be_nl_2 diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp index cc21257c2b8..0fe8dbfe3af 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp @@ -87,7 +87,7 @@ be_visitor_home_svh::visit_factory (be_factory *node) // An inherited factory/finder needs to return the managed // component of the home where it is defined. be_home *h = - be_home::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_home*> (node->defined_in ()); AST_Component *c = h->managed_component (); @@ -216,7 +216,7 @@ AST_Type *pk = node_->primary_key (); // A closure of all the supported interfaces is stored // in the base class 'pd_inherits_flat' member. be_interface *bi = - be_interface::narrow_from_decl (h->inherits ()[i]); + dynamic_cast<be_interface*> (h->inherits ()[i]); int status = bi->traverse_inheritance_graph ( @@ -235,7 +235,7 @@ AST_Type *pk = node_->primary_key (); } } - h = be_home::narrow_from_decl (h->base_home ()); + h = dynamic_cast<be_home*> (h->base_home ()); } os_ << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp index 12d36a276ef..8d428b3555a 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp @@ -102,7 +102,7 @@ be_visitor_home_svs::visit_factory (be_factory *node) // An inherited factory/finder needs to return the managed // component of the home where it is defined. be_home *h = - be_home::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_home*> (node->defined_in ()); AST_Component *c = h->managed_component (); @@ -346,7 +346,7 @@ be_visitor_home_svs::gen_servant_class (void) // A closure of all the supported interfaces is stored // in the base class 'pd_inherits_flat' member. be_interface *bi = - be_interface::narrow_from_decl (h->inherits ()[i]); + dynamic_cast<be_interface*> (h->inherits ()[i]); bi->get_insert_queue ().reset (); bi->get_del_queue ().reset (); @@ -373,7 +373,7 @@ be_visitor_home_svs::gen_servant_class (void) } - h = be_home::narrow_from_decl (h->base_home ()); + h = dynamic_cast<be_home*> (h->base_home ()); } return 0; @@ -459,7 +459,7 @@ be_visitor_home_attr_set::visit_home (be_home *node) !i.is_done (); i.next ()) { - be_decl *d = be_decl::narrow_from_decl (i.item ()); + be_decl *d = dynamic_cast<be_decl*> (i.item ()); if (d->accept (this) == -1) { @@ -471,7 +471,7 @@ be_visitor_home_attr_set::visit_home (be_home *node) } } - be_home *h = be_home::narrow_from_decl (node->base_home ()); + be_home *h = dynamic_cast<be_home*> (node->base_home ()); return this->visit_home (h); } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp index a4945489238..51de355c8ff 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp @@ -80,7 +80,7 @@ be_visitor_amh_interface_sh::visit_interface (be_interface *node) // @@ The following code is *NOT* exception-safe. char *buf = 0; be_interface *base = - be_interface::narrow_from_decl (node->inherits ()[i]); + dynamic_cast<be_interface*> (node->inherits ()[i]); base->compute_full_name ("AMH_", "", buf); amh_name += buf; // buf was allocated by ACE_OS::strdup, so we need to use free @@ -189,7 +189,7 @@ be_visitor_amh_interface_sh::add_original_members (be_interface *node, if (d->node_type () == AST_Decl::NT_attr) { - be_attribute *attribute = be_attribute::narrow_from_decl (d); + be_attribute *attribute = dynamic_cast<be_attribute*> (d); if (!attribute) { @@ -198,7 +198,7 @@ be_visitor_amh_interface_sh::add_original_members (be_interface *node, } else { - be_operation* operation = be_operation::narrow_from_decl (d); + be_operation* operation = dynamic_cast<be_operation*> (d); if (operation) { @@ -301,7 +301,7 @@ be_visitor_amh_interface_sh::add_amh_operation (be_operation *node, } AST_Argument *original_arg = - AST_Argument::narrow_from_decl (d); + dynamic_cast<AST_Argument*> (d); if (original_arg->direction () == AST_Argument::dir_INOUT || original_arg->direction () == AST_Argument::dir_IN) diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp index 766f8e5a6f2..2097910dd48 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp @@ -220,7 +220,7 @@ TAO_IDL_Copy_Ctor_Worker::emit (be_interface *derived, if (base->is_nested ()) { be_decl *scope = 0; - scope = be_scope::narrow_from_scope (base->defined_in ())->decl (); + scope = dynamic_cast<be_scope*> (base->defined_in ())->decl (); *os << "POA_" << scope->name () << "::AMH_" << base->local_name () << " (rhs)"; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami4ccm_rh_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami4ccm_rh_ex_idl.cpp index 2eeb3cb4307..6f010faf6a4 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami4ccm_rh_ex_idl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami4ccm_rh_ex_idl.cpp @@ -106,7 +106,7 @@ be_visitor_ami4ccm_rh_ex_idl::visit_operation (be_operation *node) if (!node->void_return_type ()) { be_type *t = - be_type::narrow_from_decl (node->return_type ()); + dynamic_cast<be_type*> (node->return_type ()); os_ << be_nl << "in " @@ -158,7 +158,7 @@ be_visitor_ami4ccm_rh_ex_idl::visit_argument (be_argument *node) } be_type *t = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); os_ << be_nl << "in "; @@ -206,7 +206,7 @@ int be_visitor_ami4ccm_rh_ex_idl::pre_process (be_decl *node) { be_operation *op = - be_operation::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_operation*> (this->ctx_->scope ()); if (op == 0) { @@ -215,7 +215,7 @@ be_visitor_ami4ccm_rh_ex_idl::pre_process (be_decl *node) bool void_ret_type = op->void_return_type (); - be_argument *arg = be_argument::narrow_from_decl (node); + be_argument *arg = dynamic_cast<be_argument*> (node); if (arg == 0) { @@ -258,7 +258,7 @@ be_visitor_ami4ccm_rh_ex_idl::gen_attr_rh_ops (bool is_set_op, if (!is_set_op) { be_type *t = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); os_ << be_idt_nl << "in "; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami4ccm_sendc_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami4ccm_sendc_ex_idl.cpp index 1cbc59cd559..c3c8e849f63 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami4ccm_sendc_ex_idl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami4ccm_sendc_ex_idl.cpp @@ -51,7 +51,7 @@ be_visitor_ami4ccm_sendc_ex_idl::visit_interface (be_interface *node) for (long i = 0; i < node->n_inherits_flat (); ++i) { be_interface *ancestor = - be_interface::narrow_from_decl (inh_flat[i]); + dynamic_cast<be_interface*> (inh_flat[i]); if (this->visit_scope (ancestor) == -1) { @@ -121,7 +121,7 @@ be_visitor_ami4ccm_sendc_ex_idl::visit_argument (be_argument *node) else { be_type *t = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); os_ << be_nl << "in "; @@ -169,7 +169,7 @@ be_visitor_ami4ccm_sendc_ex_idl::visit_sequence (be_sequence *node) int be_visitor_ami4ccm_sendc_ex_idl::pre_process (be_decl *node) { - be_argument *arg = be_argument::narrow_from_decl (node); + be_argument *arg = dynamic_cast<be_argument*> (node); if (arg == 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp index 13df2b47da4..e567aee863d 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp @@ -53,7 +53,7 @@ be_visitor_interface_any_op_ch::visit_interface (be_interface *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp index 6cb026e9f28..19ef2555e0e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp @@ -123,7 +123,7 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp index d7114306b98..3e8f278a6a2 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp @@ -50,7 +50,7 @@ be_visitor_interface_direct_proxy_impl_sh::visit_interface ( } be_interface *inherited = - be_interface::narrow_from_decl (parent); + dynamic_cast<be_interface*> (parent); if (first_concrete) { @@ -140,13 +140,13 @@ be_visitor_interface_direct_proxy_impl_sh::gen_abstract_ops_helper ( // abstract interface in a concrete interface or component. if (d->node_type () == AST_Decl::NT_op) { - be_operation *op = be_operation::narrow_from_decl (d); + be_operation *op = dynamic_cast<be_operation*> (d); be_visitor_operation_proxy_impl_xh op_visitor (&ctx); op_visitor.visit_operation (op); } else if (d->node_type () == AST_Decl::NT_attr) { - AST_Attribute *attr = AST_Attribute::narrow_from_decl (d); + AST_Attribute *attr = dynamic_cast<AST_Attribute*> (d); be_attribute new_attr (attr->readonly (), attr->field_type (), &item_new_name, diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp index e54120f1e10..913e526c3f4 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp @@ -107,7 +107,7 @@ be_visitor_interface_direct_proxy_impl_ss::gen_abstract_ops_helper ( // abstract interface in a concrete interface or component. if (d->node_type () == AST_Decl::NT_op) { - be_operation *op = be_operation::narrow_from_decl (d); + be_operation *op = dynamic_cast<be_operation*> (d); UTL_ScopedName *old_name = (UTL_ScopedName *) op->name ()->copy (); op->set_name (new_name); @@ -123,7 +123,7 @@ be_visitor_interface_direct_proxy_impl_ss::gen_abstract_ops_helper ( } else if (d->node_type () == AST_Decl::NT_attr) { - AST_Attribute *attr = AST_Attribute::narrow_from_decl (d); + AST_Attribute *attr = dynamic_cast<AST_Attribute*> (d); be_attribute new_attr (attr->readonly (), attr->field_type (), 0, diff --git a/TAO/TAO_IDL/be/be_visitor_interface/facet_svth.cpp b/TAO/TAO_IDL/be/be_visitor_interface/facet_svth.cpp index a022fdd2d52..ab009e6b112 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/facet_svth.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/facet_svth.cpp @@ -37,7 +37,7 @@ be_visitor_facet_svth::visit_interface (be_interface *node) const char *lname = node->local_name (); be_decl *scope = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_CString suffix (scope->flat_name ()); if (suffix != "") @@ -69,7 +69,7 @@ be_visitor_facet_svth::visit_interface (be_interface *node) if (is_intf) { be_interface *intf = - be_interface::narrow_from_decl (node); + dynamic_cast<be_interface*> (node); be_global->in_facet_servant (true); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/facet_svts.cpp b/TAO/TAO_IDL/be/be_visitor_interface/facet_svts.cpp index fae40ad6ef1..85780cf58c6 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/facet_svts.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/facet_svts.cpp @@ -36,7 +36,7 @@ be_visitor_facet_svts::visit_interface (be_interface *node) const char *lname = node->local_name (); be_decl *scope = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_CString sname_str (scope->full_name ()); @@ -75,7 +75,7 @@ be_visitor_facet_svts::visit_interface (be_interface *node) if (is_intf) { be_interface *op_scope = - be_interface::narrow_from_decl (node); + dynamic_cast<be_interface*> (node); os_ << be_nl_2 << "// All facet operations and attributes."; @@ -147,7 +147,7 @@ be_facet_op_attr_defn_helper::emit (be_interface * /* derived_interface */, case AST_Decl::NT_op: { be_operation *op = - be_operation::narrow_from_decl (d); + dynamic_cast<be_operation*> (d); /// If AMI implied IDL was generated for the /// original interface, we don't want those @@ -174,7 +174,7 @@ be_facet_op_attr_defn_helper::emit (be_interface * /* derived_interface */, case AST_Decl::NT_attr: { be_attribute *attr = - be_attribute::narrow_from_decl (d); + dynamic_cast<be_attribute*> (d); be_visitor_attribute v (&ctx); v.op_scope (op_scope_); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp index 81171e0d3e3..f6d04fb0484 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp @@ -35,7 +35,7 @@ be_visitor_interface::visit_scope (be_scope *node) return -1; } - be_interface *intf = be_interface::narrow_from_scope (node); + be_interface *intf = dynamic_cast<be_interface*> (node); if (intf == 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp index ffa18935c51..07ae0b2d891 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp @@ -39,7 +39,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node) *os << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; - AST_Component *c = AST_Component::narrow_from_decl (node); + AST_Component *c = dynamic_cast<AST_Component*> (node); // Now generate the class definition. *os << be_nl_2 @@ -335,7 +335,7 @@ be_visitor_interface_ch::visit_extended_port (be_extended_port *node) /// original porttype, this is a way for visitors down the /// line to tell what scope we are actually in. this->ctx_->interface ( - be_interface::narrow_from_scope (node->defined_in ())); + dynamic_cast<be_interface*> (node->defined_in ())); /// Will ignore everything but porttype attributes. int status = this->visit_scope (node->port_type ()); @@ -364,7 +364,7 @@ be_visitor_interface_ch::visit_mirror_port (be_mirror_port *node) /// original porttype, this is a way for visitors down the /// line to tell what scope we are actually in. this->ctx_->interface ( - be_interface::narrow_from_scope (node->defined_in ())); + dynamic_cast<be_interface*> (node->defined_in ())); /// Will ignore everything but porttype attributes. int status = this->visit_scope (node->port_type ()); @@ -415,7 +415,7 @@ be_visitor_interface_ch::gen_abstract_ops_helper (be_interface *node, if (d->node_type () == AST_Decl::NT_op) { - be_operation *op = be_operation::narrow_from_decl (d); + be_operation *op = dynamic_cast<be_operation*> (d); op->set_local (node->is_local ()); ctx.state (TAO_CodeGen::TAO_OPERATION_CH); be_visitor_operation_ch op_visitor (&ctx); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp index ec2e9924172..ecbea914119 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -39,7 +39,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) bt = node; } - AST_Component *c = AST_Component::narrow_from_decl (node); + AST_Component *c = dynamic_cast<AST_Component*> (node); TAO_OutStream *os = this->ctx_->stream (); if (node->is_defined () && be_global->gen_arg_traits ()) @@ -524,7 +524,7 @@ be_visitor_interface_cs::visit_extended_port (be_extended_port *node) /// original porttype, this is a way for visitors down the /// line to tell what scope we are actually in. this->ctx_->interface ( - be_interface::narrow_from_scope (node->defined_in ())); + dynamic_cast<be_interface*> (node->defined_in ())); /// Will ignore everything but porttype attributes. int status = this->visit_scope (node->port_type ()); @@ -553,7 +553,7 @@ be_visitor_interface_cs::visit_mirror_port (be_mirror_port *node) /// original porttype, this is a way for visitors down the /// line to tell what scope we are actually in. this->ctx_->interface ( - be_interface::narrow_from_scope (node->defined_in ())); + dynamic_cast<be_interface*> (node->defined_in ())); /// Will ignore everything but porttype attributes. int status = this->visit_scope (node->port_type ()); @@ -615,7 +615,7 @@ be_visitor_interface_cs::gen_abstract_ops_helper (be_interface *node, (UTL_ScopedName *)node->name ()->copy (); new_op_name->nconc (item_new_name); - be_operation *op = be_operation::narrow_from_decl (d); + be_operation *op = dynamic_cast<be_operation*> (d); UTL_ScopedName *old_op_name = (UTL_ScopedName *) op->name ()->copy (); op->set_name (new_op_name); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp index 1bf00f89aa9..7c6f8a65d19 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp @@ -93,7 +93,7 @@ be_visitor_interface_is::visit_interface (be_interface *node) if (node->is_nested ()) { be_decl *scope = 0; - scope = be_scope::narrow_from_scope (node->defined_in ())->decl (); + scope = dynamic_cast<be_scope*> (node->defined_in ())->decl (); *os << " POA_" << scope->name () << "::" << node->local_name () << " (rhs)"; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp index a0c021c1a9e..cda960e90ef 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -219,13 +219,13 @@ be_visitor_interface_sh::gen_abstract_ops_helper ( if (d->node_type () == AST_Decl::NT_op) { - be_operation *op = be_operation::narrow_from_decl (d); + be_operation *op = dynamic_cast<be_operation*> (d); be_visitor_operation_sh op_visitor (&ctx); op_visitor.visit_operation (op); } else if (d->node_type () == AST_Decl::NT_attr) { - AST_Attribute *attr = AST_Attribute::narrow_from_decl (d); + AST_Attribute *attr = dynamic_cast<AST_Attribute*> (d); be_attribute new_attr (attr->readonly (), attr->field_type (), &item_new_name, diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index fa3e691ebc8..7dd0ce2818c 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -307,7 +307,7 @@ be_visitor_interface_ss::gen_abstract_ops_helper ( // abstract interface in a concrete interface or component. if (AST_Decl::NT_op == nt) { - be_operation *op = be_operation::narrow_from_decl (d); + be_operation *op = dynamic_cast<be_operation*> (d); UTL_ScopedName *old_name = (UTL_ScopedName *) op->name ()->copy (); op->set_name (new_name); @@ -324,7 +324,7 @@ be_visitor_interface_ss::gen_abstract_ops_helper ( else if (AST_Decl::NT_attr == nt) { AST_Attribute *attr = - AST_Attribute::narrow_from_decl (d); + dynamic_cast<AST_Attribute*> (d); be_attribute new_attr (attr->readonly (), attr->field_type (), 0, diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_svts.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_svts.cpp index 0f764a2b801..eb5303cc51e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_svts.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_svts.cpp @@ -42,7 +42,7 @@ int be_visitor_interface_svts::visit_operation (be_operation *node) { be_visitor_operation_svs v (this->ctx_); - v.scope (be_interface::narrow_from_decl ( + v.scope (dynamic_cast<be_interface*> ( this->ctx_->scope ()->decl ())); return v.visit_operation (node); @@ -54,7 +54,7 @@ be_visitor_interface_svts::visit_attribute (be_attribute *node) be_visitor_attribute v (this->ctx_); v.for_facets (true); - v.op_scope (be_interface::narrow_from_decl ( + v.op_scope (dynamic_cast<be_interface*> ( this->ctx_->scope ()->decl ())); return v.visit_attribute (node); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp index eb0620e67a7..aad105b595a 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp @@ -114,14 +114,14 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) for (i = 0; i < node->n_inherits (); i++) { be_interface *inherited = - be_interface::narrow_from_decl (node->inherits ()[i]); + dynamic_cast<be_interface*> (node->inherits ()[i]); be_decl *scope = 0; if (inherited->is_nested ()) { // Inherited node is used in the scope of "node" node. scope = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); } *os << "," << be_nl << " public virtual "; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp index 1149f0384f0..ee84d6982c4 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp @@ -36,7 +36,7 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) // Its necessary to take care of the nested case. The smart proxy classes // are in the same scope as the proxy. - be_decl* scope = be_scope::narrow_from_scope (node->defined_in ())->decl (); + be_decl* scope = dynamic_cast<be_scope*> (node->defined_in ())->decl (); *os << be_nl_2 << scope->full_name (); diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp index 6589e9f170c..9c1a935c8fd 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp @@ -53,7 +53,7 @@ be_visitor_interface_fwd_any_op_ch::visit_interface_fwd ( if (node->is_nested () && node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (node->defined_in ()); + module = dynamic_cast<be_module*> (node->defined_in ()); if (0 == module) { diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp index 352675c9189..8c93752c3f4 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp @@ -31,7 +31,7 @@ be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node) } AST_Interface *fd = node->full_definition (); - be_interface *bfd = be_interface::narrow_from_decl (fd); + be_interface *bfd = dynamic_cast<be_interface*> (fd); // This will be a no-op if it has already been done for this node. bfd->gen_var_out_seq_decls (); diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp index 9e934d95725..18a6805b3c1 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp @@ -46,8 +46,8 @@ be_visitor_amh_rh_operation_sh::visit_operation (be_operation *node) : node->defined_in (); // Needs to be one or the other. - if (be_interface::narrow_from_scope (s) == 0 - && be_porttype::narrow_from_scope (s) == 0) + if (dynamic_cast<be_interface*> (s) == 0 + && dynamic_cast<be_porttype*> (s) == 0) { ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("be_visitor_amh_rh_operation_sh::") diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp index c16e63c9736..c4efea27089 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp @@ -43,11 +43,11 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node) ? this->ctx_->attribute ()->defined_in () : node->defined_in (); - be_interface *intf = be_interface::narrow_from_scope (s); + be_interface *intf = dynamic_cast<be_interface*> (s); if (intf == 0) { - be_porttype *pt = be_porttype::narrow_from_scope (s); + be_porttype *pt = dynamic_cast<be_porttype*> (s); if (pt == 0) { @@ -136,9 +136,9 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node) if (!i.is_done ()) { be_argument *argument = - be_argument::narrow_from_decl (i.item ()); + dynamic_cast<be_argument*> (i.item ()); be_valuetype *vt = - be_valuetype::narrow_from_decl (argument->field_type ()); + dynamic_cast<be_valuetype*> (argument->field_type ()); if (vt != 0 && vt->original_interface () == intf->original_interface ()) diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp index 45a289e6fe5..f3a5022521a 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp @@ -53,7 +53,7 @@ be_visitor_amh_operation_sh::visit_operation (be_operation *node) i.next ()) { be_argument *argument = - be_argument::narrow_from_decl (i.item ()); + dynamic_cast<be_argument*> (i.item ()); if (argument == 0 || argument->direction () == AST_Argument::dir_OUT) @@ -139,11 +139,11 @@ be_visitor_amh_operation_sh::generate_shared_prologue ( // if this operation node was an attribute node in disguise, we get this // information from the context be_interface *intf = - be_interface::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_interface*> (node->defined_in ()); if (this->ctx_->attribute () != 0) { - intf = be_interface::narrow_from_scope ( + intf = dynamic_cast<be_interface*> ( this->ctx_->attribute()->defined_in () ); } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp index 459e253fb1c..9fd0fdbc8d6 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp @@ -62,7 +62,7 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) si.next ()) { be_argument *argument = - be_argument::narrow_from_decl (si.item ()); + dynamic_cast<be_argument*> (si.item ()); if (argument == 0 || argument->direction () == AST_Argument::dir_OUT) @@ -99,7 +99,7 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) sj.next ()) { be_argument *argument = - be_argument::narrow_from_decl (sj.item ()); + dynamic_cast<be_argument*> (sj.item ()); if (argument == 0 || argument->direction () == AST_Argument::dir_OUT) @@ -151,7 +151,7 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) !i.is_done ();) { be_argument *argument = - be_argument::narrow_from_decl (i.item ()); + dynamic_cast<be_argument*> (i.item ()); i.next (); @@ -308,7 +308,7 @@ be_visitor_amh_operation_ss::generate_shared_prologue (be_decl *node, // if this operation node was an attribute node in disguise, we get this // information from the context be_interface *intf = - be_interface::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_interface*> (node->defined_in ()); if (intf == 0) { @@ -359,7 +359,7 @@ be_visitor_amh_operation_ss::generate_shared_section (be_decl *node, TAO_OutStream *os) { be_interface *intf = - be_interface::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_interface*> (node->defined_in ()); if (!intf) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp index 359af9aab39..474624f6d01 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp @@ -62,7 +62,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node) // Grab the scope name. be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); if (parent == 0) { @@ -165,7 +165,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node) for (; ! arg_list_iter.is_done (); arg_list_iter.next ()) { - arg = AST_Argument::narrow_from_decl (arg_list_iter.item ()); + arg = dynamic_cast<AST_Argument*> (arg_list_iter.item ()); *os << "," << be_nl << "&_tao_" << arg->local_name (); @@ -225,7 +225,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node) if (parent->is_nested ()) { be_decl *gparent = - be_scope::narrow_from_scope (parent->defined_in ())->decl (); + dynamic_cast<be_scope*> (parent->defined_in ())->decl (); *os << gparent->name () << "::"; } @@ -248,7 +248,7 @@ be_visitor_operation_ami_cs::visit_argument (be_argument *node) be_type *bt = 0; // argument type // Retrieve the type for this argument. - bt = be_type::narrow_from_decl (node->field_type ()); + bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp index 1e4c533a705..574b8ab2c4b 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp @@ -51,7 +51,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation ( this->ctx_->node (node); // Initialize the return type variable. - bt = be_type::narrow_from_decl (node->return_type ()); + bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -74,7 +74,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation ( // Get the scope name. be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); if (!parent) { @@ -163,7 +163,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation ( for (UTL_ExceptlistActiveIterator ei (node->exceptions ()); !ei.is_done ();) { - ex = be_exception::narrow_from_decl (ei.item ()); + ex = dynamic_cast<be_exception*> (ei.item ()); *os << "{" << be_idt_nl << "\"" << ex->repoID () << "\"," << be_nl; @@ -249,7 +249,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_argument ( be_type *bt = 0; // Retrieve the type for this argument. - bt = be_type::narrow_from_decl (node->field_type ()); + bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp index aeb7d0d0ca9..76b455fc588 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp @@ -148,7 +148,7 @@ be_visitor_operation_arglist::visit_argument (be_argument *node) // inside the scope of the interface node. In such cases, we would like to // generate the appropriate relative scoped names. be_operation *op = - be_operation::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_operation*> (this->ctx_->scope ()); be_interface *intf = 0; // We need the interface node in which this operation was defined. However, @@ -157,15 +157,15 @@ be_visitor_operation_arglist::visit_argument (be_argument *node) if (op == 0) { be_factory *f = - be_factory::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_factory*> (this->ctx_->scope ()); - intf = be_interface::narrow_from_scope (f->defined_in ()); + intf = dynamic_cast<be_interface*> (f->defined_in ()); } else { intf = this->ctx_->attribute () - ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) - : be_interface::narrow_from_scope (op->defined_in ()); + ? dynamic_cast<be_interface*> (this->ctx_->attribute ()->defined_in ()) + : dynamic_cast<be_interface*> (op->defined_in ()); } // Set new scope. diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp index ca8756a0886..bb0675176a2 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp @@ -87,7 +87,7 @@ be_visitor_operation_argument::visit_argument (be_argument *node) // inside the scope of the interface node. In such cases, we would like to // generate the appropriate relative scoped names. be_operation *op = - be_operation::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_operation*> (this->ctx_->scope ()); if (op == 0) { @@ -103,8 +103,8 @@ be_visitor_operation_argument::visit_argument (be_argument *node) // information from the context. be_interface *intf; intf = this->ctx_->attribute () - ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) - : be_interface::narrow_from_scope (op->defined_in ()); + ? dynamic_cast<be_interface*> (this->ctx_->attribute ()->defined_in ()) + : dynamic_cast<be_interface*> (op->defined_in ()); if (!intf) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp index d86ea3ee5b8..c69cfa6637e 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp @@ -37,7 +37,7 @@ be_visitor_operation_argument_invoke::pre_process (be_decl *bd) { TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = be_argument::narrow_from_decl (bd); + be_argument *arg = dynamic_cast<be_argument*> (bd); if (!arg) { @@ -97,7 +97,7 @@ be_visitor_operation_argument_invoke::pre_process (be_decl *bd) int be_visitor_operation_argument_invoke::post_process (be_decl *bd) { - be_argument *arg = be_argument::narrow_from_decl (bd); + be_argument *arg = dynamic_cast<be_argument*> (bd); if (!arg) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp index 45a51afde58..3a44607cc82 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp @@ -37,7 +37,7 @@ be_visitor_operation_argument_marshal::pre_process (be_decl *bd) { TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = be_argument::narrow_from_decl (bd); + be_argument *arg = dynamic_cast<be_argument*> (bd); if (!arg) { @@ -97,7 +97,7 @@ be_visitor_operation_argument_marshal::pre_process (be_decl *bd) int be_visitor_operation_argument_marshal::post_process (be_decl *bd) { - be_argument *arg = be_argument::narrow_from_decl (bd); + be_argument *arg = dynamic_cast<be_argument*> (bd); if (!arg) { @@ -178,7 +178,7 @@ be_visitor_args_decl::visit_argument (be_argument *node) this->ctx_->node (node); // save the argument node // retrieve the type of the argument - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); return bt->accept (this); } @@ -191,7 +191,7 @@ be_visitor_args_decl::visit_array (be_array *node) // retrieve the field node be_argument *f = - be_argument::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_argument*> (this->ctx_->node ()); if (f == 0) { @@ -221,7 +221,7 @@ be_visitor_args_decl::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", diff --git a/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp index 714bcfa1e3b..7dda3e5b466 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp @@ -32,11 +32,11 @@ be_visitor_operation_direct_proxy_impl_ss::visit_operation ( ? this->ctx_->attribute ()->defined_in () : node->defined_in (); - be_interface *intf = be_interface::narrow_from_scope (s); + be_interface *intf = dynamic_cast<be_interface*> (s); if (intf == 0) { - be_porttype *pt = be_porttype::narrow_from_scope (s); + be_porttype *pt = dynamic_cast<be_porttype*> (s); if (pt == 0) { @@ -158,7 +158,7 @@ be_visitor_operation_direct_proxy_impl_ss::gen_invoke ( for (; !si.is_done (); si.next (), ++index) { - arg = AST_Argument::narrow_from_decl (si.item ()); + arg = dynamic_cast<AST_Argument*> (si.item ()); *os << (index == 1 ? "" : ",") << be_nl << "((TAO::Arg_Traits< "; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp index e234183eda7..0c1f75cf3d3 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp @@ -50,7 +50,7 @@ be_visitor_operation_exceptlist_cs::visit_operation (be_operation *node) !ei.is_done ();) { AST_Decl *d = ei.item (); - ex = be_exception::narrow_from_decl (d); + ex = dynamic_cast<be_exception*> (d); *os << "{" << be_idt_nl << "\"" << ex->repoID () << "\"," << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_ss.cpp index 9b8db063795..b36da92ccb5 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_ss.cpp @@ -47,7 +47,7 @@ be_visitor_operation_exceptlist_ss::visit_operation (be_operation * node) for (UTL_ExceptlistActiveIterator ei (node->exceptions ()); !ei.is_done ();) { - be_exception * ex = be_exception::narrow_from_decl (ei.item ()); + be_exception * ex = dynamic_cast<be_exception*> (ei.item ()); *os << ex->tc_name (); diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp index 479ee59a5a6..87714104cf1 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp @@ -31,12 +31,12 @@ be_visitor_operation::void_return_type (be_type *bt) if (bt->node_type () == AST_Decl::NT_pre_defined) { be_predefined_type * const bpd = - be_predefined_type::narrow_from_decl (bt); + dynamic_cast<be_predefined_type*> (bt); if (!bpd) ACE_ERROR_RETURN ((LM_ERROR, "TAO_IDL (%N:%l) " - "be_predefined_type::narrow_from_decl " + "dynamic_cast<be_predefined_type*> " "failed\n"), 0); @@ -75,12 +75,12 @@ be_visitor_operation::count_non_out_parameters (be_operation *node) si.next ()) { be_argument *bd = - be_argument::narrow_from_decl (si.item ()); + dynamic_cast<be_argument*> (si.item ()); // We do not generate insertion operators for valuetypes // yet. Do not include them in the count. be_valuetype *vt = - be_valuetype::narrow_from_decl (bd->field_type ()); + dynamic_cast<be_valuetype*> (bd->field_type ()); if ((bd->direction () != AST_Argument::dir_OUT) && vt == 0) { @@ -140,11 +140,11 @@ be_visitor_operation::gen_stub_operation_body ( ? this->ctx_->attribute ()->defined_in () : node->defined_in (); - be_interface *intf = be_interface::narrow_from_scope (s); + be_interface *intf = dynamic_cast<be_interface*> (s); if (intf == 0) { - be_porttype *pt = be_porttype::narrow_from_scope (s); + be_porttype *pt = dynamic_cast<be_porttype*> (s); if (pt == 0) { @@ -221,7 +221,7 @@ be_visitor_operation::gen_stub_operation_body ( ! arg_list_iter.is_done (); arg_list_iter.next ()) { - arg = AST_Argument::narrow_from_decl (arg_list_iter.item ()); + arg = dynamic_cast<AST_Argument*> (arg_list_iter.item ()); *os << "," << be_nl << "&_tao_" << arg->local_name (); @@ -419,7 +419,7 @@ be_visitor_operation::gen_stub_body_arglist (be_operation *node, for (; ! arg_decl_iter.is_done (); arg_decl_iter.next ()) { - arg = AST_Argument::narrow_from_decl (arg_decl_iter.item ()); + arg = dynamic_cast<AST_Argument*> (arg_decl_iter.item ()); *os << be_nl << "TAO::Arg_Traits< "; @@ -463,7 +463,7 @@ be_visitor_operation::gen_arg_template_param_name (AST_Decl *scope, if (bt->node_type () == AST_Decl::NT_typedef) { - alias = AST_Typedef::narrow_from_decl (bt); + alias = dynamic_cast<AST_Typedef*> (bt); } AST_Decl::NodeType nt = bt->unaliased_type ()->node_type (); @@ -472,7 +472,7 @@ be_visitor_operation::gen_arg_template_param_name (AST_Decl *scope, if (nt == AST_Decl::NT_string || nt == AST_Decl::NT_wstring) { AST_String *s = - AST_String::narrow_from_decl (bt->unaliased_type ()); + dynamic_cast<AST_String*> (bt->unaliased_type ()); bound = s->max_size ()->ev ()->u.ulval; // If the (w)string is unbounded, code is generated below by the @@ -513,7 +513,7 @@ be_visitor_operation::gen_arg_template_param_name (AST_Decl *scope, if (nt == AST_Decl::NT_pre_defined) { AST_PredefinedType *pdt = - AST_PredefinedType::narrow_from_decl (ut); + dynamic_cast<AST_PredefinedType*> (ut); switch (pdt->pt ()) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp index 736845088ba..e25ce6210a4 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp @@ -34,7 +34,7 @@ be_visitor_operation_ch::visit_operation (be_operation *node) *os << be_nl_2; // STEP I: generate the return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -97,7 +97,7 @@ be_visitor_operation_ch::visit_operation (be_operation *node) } be_interface *intf = - be_interface::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_interface*> (node->defined_in ()); /// If we are in a reply handler, are not an excep_* operation, /// and have no native args, then generate the AMI static diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp index 4177101bb59..f6e027b2ade 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp @@ -47,11 +47,11 @@ be_visitor_operation_cs::visit_operation (be_operation *node) ? this->ctx_->attribute ()->defined_in () : node->defined_in (); - be_interface *intf = be_interface::narrow_from_scope (s); + be_interface *intf = dynamic_cast<be_interface*> (s); if (intf == 0) { - be_porttype *pt = be_porttype::narrow_from_scope (s); + be_porttype *pt = dynamic_cast<be_porttype*> (s); if (pt == 0) { @@ -88,7 +88,7 @@ be_visitor_operation_cs::visit_operation (be_operation *node) << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; // Retrieve the operation return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -171,7 +171,7 @@ be_visitor_operation_cs::visit_argument (be_argument *node) // This method is used to generate the ParamData table entry. TAO_OutStream *os = this->ctx_->stream (); - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp index 5e52b120d66..ee50ef97f01 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp @@ -38,7 +38,7 @@ be_visitor_operation_exs::visit_operation (be_operation *node) os_ << be_nl_2; // Retrieve the operation return type. - be_type *rt = be_type::narrow_from_decl (node->return_type ()); + be_type *rt = dynamic_cast<be_type*> (node->return_type ()); if (rt == 0) { @@ -111,7 +111,7 @@ be_visitor_operation_exs::gen_op_body (be_type *return_type) << your_code_here_; be_operation *op = - be_operation::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_operation*> (this->ctx_->node ()); if (! op->void_return_type ()) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp index 67c4ad7bf65..83d86dc542f 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp @@ -44,7 +44,7 @@ be_visitor_operation_ih::visit_operation (be_operation *node) *os << "virtual" << be_nl; // STEP I: generate the return type - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp index 7a3a3893e98..18019fe4fd9 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp @@ -35,7 +35,7 @@ be_visitor_operation_is::visit_operation (be_operation *node) this->ctx_->node (node); // save the node // STEP I: generate the return type - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp index d0aa64d2023..158b03e5ca4 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp @@ -38,7 +38,7 @@ be_visitor_operation_sh::visit_operation (be_operation *node) *os << "virtual "; // STEP I: generate the return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp index 1c04abc57a8..aad01312713 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp @@ -43,7 +43,7 @@ be_visitor_operation_ss::visit_operation (be_operation * node) } // Retrieve the operation return type. - bt = be_type::narrow_from_decl (node->return_type ()); + bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -65,7 +65,7 @@ be_visitor_operation_ss::visit_argument (be_argument *node) TAO_OutStream *os = this->ctx_->stream (); // Retrieve the type for this argument. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -127,7 +127,7 @@ be_visitor_operation_ss::gen_skel_operation_body (be_operation * node, ? this->ctx_->attribute ()->defined_in () : node->defined_in (); - be_interface *intf = be_interface::narrow_from_scope (s); + be_interface *intf = dynamic_cast<be_interface*> (s); if (intf == 0) { @@ -227,7 +227,7 @@ be_visitor_operation_ss::gen_skel_operation_body (be_operation * node, arg_list_iter.next ()) { AST_Argument * const arg = - AST_Argument::narrow_from_decl (arg_list_iter.item ()); + dynamic_cast<AST_Argument*> (arg_list_iter.item ()); *os << "," << be_nl << "&_tao_" << arg->local_name (); @@ -300,7 +300,7 @@ be_visitor_operation_ss::gen_skel_body_arglist (be_operation * node, arg_decl_iter.next ()) { AST_Argument * const arg = - AST_Argument::narrow_from_decl (arg_decl_iter.item ()); + dynamic_cast<AST_Argument*> (arg_decl_iter.item ()); *os << be_nl << "TAO::SArg_Traits< "; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp index 0a7f41b866c..49633e611a3 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp @@ -37,7 +37,7 @@ be_visitor_operation_svs::visit_operation (be_operation *node) << be_nl; } // Retrieve the operation return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (bt == 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp index 41520dce0f7..f2b8b51aed9 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp @@ -41,7 +41,7 @@ be_visitor_operation_smart_proxy_ch::visit_operation (be_operation *node) *os << "virtual "; // STEP I: generate the return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp index 0ca7300e45b..6f39ed187ba 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp @@ -37,11 +37,11 @@ int be_visitor_operation_smart_proxy_cs::visit_operation (be_operation *node) ? this->ctx_->attribute ()->defined_in () : node->defined_in (); - be_interface *intf = be_interface::narrow_from_scope (s); + be_interface *intf = dynamic_cast<be_interface*> (s); if (intf == 0) { - be_porttype *pt = be_porttype::narrow_from_scope (s); + be_porttype *pt = dynamic_cast<be_porttype*> (s); if (pt == 0) { @@ -58,7 +58,7 @@ int be_visitor_operation_smart_proxy_cs::visit_operation (be_operation *node) } } - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -87,7 +87,7 @@ int be_visitor_operation_smart_proxy_cs::visit_operation (be_operation *node) // node (i.e the operation) is already in a scope lower than intf // (i.e. be_interface), so for deciding the exact scope use intf. - be_decl* scope = be_scope::narrow_from_scope (intf->defined_in ())->decl (); + be_decl* scope = dynamic_cast<be_scope*> (intf->defined_in ())->decl (); *os << " "; *os << scope->full_name (); diff --git a/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp index 2448df4c6cc..98cb3e6a7e6 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp @@ -36,7 +36,7 @@ be_visitor_operation_tie_sh::visit_operation (be_operation *node) this->ctx_->node (node); // STEP I: generate the return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/tie_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/tie_ss.cpp index 9450b60e1e3..df342b6eb2d 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/tie_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/tie_ss.cpp @@ -44,7 +44,7 @@ int be_visitor_operation_tie_ss::visit_operation (be_operation *node) } // Retrieve the operation return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -71,7 +71,7 @@ int be_visitor_operation_tie_ss::visit_operation (be_operation *node) // Check for conflicts between the arg name and the proposed template // class identifier AST_Argument *arg = - AST_Argument::narrow_from_decl (si.item ()); + dynamic_cast<AST_Argument*> (si.item ()); if (! ACE_OS::strcmp (arg->local_name ()->get_string (), template_name.c_str ())) @@ -127,7 +127,7 @@ int be_visitor_operation_tie_ss::visit_operation (be_operation *node) *os << be_nl << "{" << be_idt_nl; - be_predefined_type *pdt = be_predefined_type::narrow_from_decl (bt); + be_predefined_type *pdt = dynamic_cast<be_predefined_type*> (bt); if (pdt == 0 || pdt->pt () != AST_PredefinedType::PT_void) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp index 2df7ec104ad..6f7c97458de 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp @@ -35,8 +35,8 @@ be_visitor_operation_upcall_command_ss::visit ( } be_interface * const intf = this->ctx_->attribute () - ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) - : be_interface::narrow_from_scope (node->defined_in ()); + ? dynamic_cast<be_interface*> (this->ctx_->attribute ()->defined_in ()) + : dynamic_cast<be_interface*> (node->defined_in ()); if (!intf) { @@ -57,7 +57,7 @@ be_visitor_operation_upcall_command_ss::visit ( if (intf->is_nested () && intf->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (intf->defined_in ()); + module = dynamic_cast<be_module*> (intf->defined_in ()); if (module == 0) { @@ -228,16 +228,16 @@ be_visitor_operation_upcall_command_ss::gen_upcall ( for (; !si.is_done (); si.next (), ++index) { AST_Argument * const arg = - AST_Argument::narrow_from_decl (si.item ()); + dynamic_cast<AST_Argument*> (si.item ()); // Finish the check for the _excep method if (excep_method) { excep_method = false; be_argument *argument = - be_argument::narrow_from_decl (si.item ()); + dynamic_cast<be_argument*> (si.item ()); be_valuetype *value_type = - be_valuetype::narrow_from_decl (argument->field_type ()); + dynamic_cast<be_valuetype*> (argument->field_type ()); if (value_type != 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_scope.cpp b/TAO/TAO_IDL/be/be_visitor_scope.cpp index c2902c45dc5..e14d67a2e85 100644 --- a/TAO/TAO_IDL/be/be_visitor_scope.cpp +++ b/TAO/TAO_IDL/be/be_visitor_scope.cpp @@ -67,7 +67,7 @@ be_visitor_scope::visit_scope (be_scope *node) continue; } - be_decl *bd = be_decl::narrow_from_decl (d); + be_decl *bd = dynamic_cast<be_decl*> (d); // Set the scope node as "node" in which the code is being // generated so that elements in the node's scope can use it @@ -156,7 +156,7 @@ be_visitor_scope::next_elem (be_decl *elem, !si.is_done (); si.next ()) { - be_decl *bd = be_decl::narrow_from_decl (si.item ()); + be_decl *bd = dynamic_cast<be_decl*> (si.item ()); if (bd == 0) { @@ -180,7 +180,7 @@ be_visitor_scope::next_elem (be_decl *elem, return 0; } - successor = be_decl::narrow_from_decl (si.item ()); + successor = dynamic_cast<be_decl*> (si.item ()); if (successor == 0) { @@ -217,7 +217,7 @@ be_visitor_scope::last_inout_or_out_node (be_decl *) while (next != 0) { - be_argument *arg = be_argument::narrow_from_decl (next); + be_argument *arg = dynamic_cast<be_argument*> (next); if (arg->direction () == AST_Argument::dir_INOUT || arg->direction () == AST_Argument::dir_OUT) diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp index 9c927db93be..664ada9f408 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp @@ -55,7 +55,7 @@ be_visitor_sequence_any_op_ch::visit_sequence (be_sequence *node) if (alt) { be_type *bt = - be_type::narrow_from_decl (node->base_type ()); + dynamic_cast<be_type*> (node->base_type ()); name = "std::vector<"; name += bt->full_name (); @@ -76,7 +76,7 @@ be_visitor_sequence_any_op_ch::visit_sequence (be_sequence *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp index ff3efd24709..a8a4e22d44d 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp @@ -50,11 +50,11 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) if (be_global->alt_mapping () && node->max_size ()->ev ()->u.ulval == 0) { be_type *bt = - be_type::narrow_from_decl (node->base_type ()); + dynamic_cast<be_type*> (node->base_type ()); if (bt->node_type () == AST_Decl::NT_typedef) { - be_typedef *td = be_typedef::narrow_from_decl (bt); + be_typedef *td = dynamic_cast<be_typedef*> (bt); bt = td->primitive_base_type (); } @@ -71,8 +71,8 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) { tc = ANY_ARRAY; } - else if (be_interface::narrow_from_decl (bt) != 0 - && be_valuetype::narrow_from_decl (bt) == 0) + else if (dynamic_cast<be_interface*> (bt) != 0 + && dynamic_cast<be_valuetype*> (bt) == 0) { tc = ANY_OBJREF; } @@ -194,7 +194,7 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp index ffe0da6995d..a5dd172bc0f 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp @@ -42,7 +42,7 @@ be_visitor_sequence_cdr_op_ch::visit_sequence (be_sequence *node) return 0; } - be_type *base_type = be_type::narrow_from_decl (node->base_type ()); + be_type *base_type = dynamic_cast<be_type*> (node->base_type ()); // If our base type is an anonymous sequence, generate code for it here. if (base_type->node_type () == AST_Decl::NT_sequence) @@ -58,8 +58,8 @@ be_visitor_sequence_cdr_op_ch::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); - be_type *bt = be_type::narrow_from_decl (node); - be_typedef *tdef = be_typedef::narrow_from_decl (bt); + be_type *bt = dynamic_cast<be_type*> (node); + be_typedef *tdef = dynamic_cast<be_typedef*> (bt); *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp index a5b3d008e81..3dd4a7f06e9 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp @@ -55,7 +55,7 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); be_type *bt = - be_type::narrow_from_decl (node->base_type ()); + dynamic_cast<be_type*> (node->base_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp index 6606887c9f8..ceb9f1e42d3 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp @@ -55,7 +55,7 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) // Retrieve the base type since we may need to do some code // generation for the base type. - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); if (bt == 0) { @@ -268,16 +268,16 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) if (bt->base_node_type () == AST_Type::NT_pre_defined) { be_typedef* alias = - be_typedef::narrow_from_decl (bt); + dynamic_cast<be_typedef*> (bt); if (alias == 0) { - predef = be_predefined_type::narrow_from_decl (bt); + predef = dynamic_cast<be_predefined_type*> (bt); } else { predef = - be_predefined_type::narrow_from_decl ( + dynamic_cast<be_predefined_type*> ( alias->primitive_base_type () ); } diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp index f06f0bf1693..f009869b00c 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp @@ -53,7 +53,7 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) return 0; } - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); if (bt == 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp index bde9bfa0731..b27043e3911 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp @@ -51,7 +51,7 @@ be_visitor_structure_any_op_ch::visit_structure (be_structure *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else @@ -120,7 +120,7 @@ be_visitor_structure_any_op_ch::visit_field (be_field *node) be_type *bt = 0; // First generate the type information. - bt = be_type::narrow_from_decl (node->field_type ()); + bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp index b938d981a43..a73227ce818 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp @@ -87,7 +87,7 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node) { if (nt == AST_Decl::NT_module) { - module = be_module::narrow_from_decl (d); + module = dynamic_cast<be_module*> (d); break; } else @@ -235,7 +235,7 @@ int be_visitor_structure_any_op_cs::visit_field (be_field *node) { // First generate the type information. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp index eef782f6182..5c3cc5ab4c3 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp @@ -33,7 +33,7 @@ be_visitor_structure_fwd_ch::visit_structure_fwd (be_structure_fwd *node) TAO_OutStream *os = this->ctx_->stream (); be_structure *fd = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); // This will be a no-op if it has already been done for this node. fd->gen_common_varout (os); diff --git a/TAO/TAO_IDL/be/be_visitor_template_export.cpp b/TAO/TAO_IDL/be/be_visitor_template_export.cpp index 47205281d4d..f4001260781 100644 --- a/TAO/TAO_IDL/be/be_visitor_template_export.cpp +++ b/TAO/TAO_IDL/be/be_visitor_template_export.cpp @@ -71,7 +71,7 @@ be_visitor_template_export::visit_sequence (be_sequence *node) { TAO_OutStream *os = this->ctx_->stream (); - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); // TAO provides extensions for octet sequences, first find out if // the base type is an octet (or an alias for octet). @@ -80,16 +80,16 @@ be_visitor_template_export::visit_sequence (be_sequence *node) if (bt->base_node_type () == AST_Type::NT_pre_defined) { be_typedef* alias = - be_typedef::narrow_from_decl (bt); + dynamic_cast<be_typedef*> (bt); if (alias == 0) { - predef = be_predefined_type::narrow_from_decl (bt); + predef = dynamic_cast<be_predefined_type*> (bt); } else { predef = - be_predefined_type::narrow_from_decl ( + dynamic_cast<be_predefined_type*> ( alias->primitive_base_type () ); } diff --git a/TAO/TAO_IDL/be/be_visitor_traits.cpp b/TAO/TAO_IDL/be/be_visitor_traits.cpp index cd0c733da33..5e8b8b590d0 100644 --- a/TAO/TAO_IDL/be/be_visitor_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_traits.cpp @@ -161,7 +161,7 @@ be_visitor_traits::visit_interface_fwd (be_interface_fwd *node) } be_interface *fd = - be_interface::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_interface*> (node->full_definition ()); // We want to generate just the declaration of the Arg_Traits<> // specialization if the interface is forward declared but not defined. @@ -234,7 +234,7 @@ be_visitor_traits::visit_valuetype_fwd (be_valuetype_fwd *node) } be_valuetype *fd = - be_valuetype::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_valuetype*> (node->full_definition ()); // The logic in visit_valuetype() should handle what gets generated // and what doesn't. @@ -320,7 +320,7 @@ be_visitor_traits::visit_eventtype_fwd (be_eventtype_fwd *node) int be_visitor_traits::visit_field (be_field *node) { - be_type *ft = be_type::narrow_from_decl (node->field_type ()); + be_type *ft = dynamic_cast<be_type*> (node->field_type ()); if (ft->accept (this) == -1) { @@ -336,7 +336,7 @@ be_visitor_traits::visit_field (be_field *node) int be_visitor_traits::visit_union_branch (be_union_branch *node) { - be_type *ft = be_type::narrow_from_decl (node->field_type ()); + be_type *ft = dynamic_cast<be_type*> (node->field_type ()); AST_Decl::NodeType nt = ft->node_type (); // All we are trying to catch in here are anonymous array members. @@ -411,7 +411,7 @@ be_visitor_traits::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); name_holder = parent->full_name (); name_holder += "::"; diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp index 6e655d80b99..59636667018 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp @@ -21,7 +21,7 @@ TAO::be_visitor_alias_typecode::be_visitor_alias_typecode ( int TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node) { - be_type * const base = be_type::narrow_from_decl (node->base_type ()); + be_type * const base = dynamic_cast<be_type*> (node->base_type ()); return this->common (node, base, "tk_alias"); @@ -32,7 +32,7 @@ TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node) int TAO::be_visitor_alias_typecode::visit_valuebox (be_valuebox * node) { - be_type * const base = be_type::narrow_from_decl (node->boxed_type ()); + be_type * const base = dynamic_cast<be_type*> (node->boxed_type ()); return this->common (node, base, "tk_value_box"); } diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/enum_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/enum_typecode.cpp index 87f980a3a57..1e641558d78 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/enum_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/enum_typecode.cpp @@ -76,7 +76,7 @@ TAO::be_visitor_enum_typecode::visit_members (be_enum * node) i.next ()) { AST_Decl * const d = i.item (); - AST_EnumVal * const item = AST_EnumVal::narrow_from_decl (d); + AST_EnumVal * const item = dynamic_cast<AST_EnumVal*> (d); // os << item->name (); os << "\"" << item->original_local_name () << "\""; diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp index d17c4be7e1b..26fb914ad63 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp @@ -164,7 +164,7 @@ TAO::be_visitor_struct_typecode::visit (AST_Structure * node, << node->nfields () << ");" << be_uidt_nl << be_nl; - if (this->gen_typecode_ptr (be_type::narrow_from_decl (node)) != 0) + if (this->gen_typecode_ptr (dynamic_cast<be_type*> (node)) != 0) { return -1; } @@ -183,7 +183,7 @@ TAO::be_visitor_struct_typecode::gen_member_typecodes (AST_Structure * node) node->field (member_ptr, i); be_type * const member_type = - be_type::narrow_from_decl ((*member_ptr)->field_type ()); + dynamic_cast<be_type*> ((*member_ptr)->field_type ()); if (this->is_typecode_generation_required (member_type) && member_type->accept (this) != 0) @@ -194,7 +194,7 @@ TAO::be_visitor_struct_typecode::gen_member_typecodes (AST_Structure * node) /* MCO@20101020 - this is unnecessary since the check for recursiveness * of *this* typecode has already been done before calling this method - be_structure *bs = be_structure::narrow_from_decl (node); + be_structure *bs = dynamic_cast<be_structure*> (node); if (bs) { be_visitor_typecode_defn::QNode const * const qnode = @@ -226,10 +226,10 @@ TAO::be_visitor_struct_typecode::visit_members (AST_Structure * node) node->field (member_ptr, i); be_decl * const member_decl = - be_decl::narrow_from_decl (*member_ptr); + dynamic_cast<be_decl*> (*member_ptr); be_type * const member_type = - be_type::narrow_from_decl ((*member_ptr)->field_type ()); + dynamic_cast<be_type*> ((*member_ptr)->field_type ()); os << "{ " << "\"" << member_decl->original_local_name () << "\", " diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp index e9dcd3b4ee5..fa9c70aa9b7 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp @@ -98,7 +98,7 @@ be_visitor_typecode_defn::gen_typecode_ptr (be_type * node) node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { be_module * const module = - be_module::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_module*> (node->defined_in ()); if (module == 0) { @@ -188,7 +188,7 @@ be_visitor_typecode_defn::gen_forward_declared_typecode (be_type * node) node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { be_module * const module = - be_module::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_module*> (node->defined_in ()); if (module == 0) { @@ -238,7 +238,7 @@ be_visitor_typecode_defn::is_typecode_generation_required (be_type * node) true); be_interface * const intf = - d != 0 ? be_interface::narrow_from_decl (d) : 0; + d != 0 ? dynamic_cast<be_interface*> (d) : 0; if (intf && intf->is_defined ()) { @@ -251,7 +251,7 @@ be_visitor_typecode_defn::is_typecode_generation_required (be_type * node) // structures and unions AST_Structure * const st = - AST_Structure::narrow_from_decl (node); + dynamic_cast<AST_Structure*> (node); if (st && st->is_defined ()) { @@ -289,7 +289,7 @@ be_visitor_typecode_defn::gen_end_NS_for_anon (void) int be_visitor_typecode_defn::visit_array (be_array *node) { - be_type * const base = be_type::narrow_from_decl (node->base_type ()); + be_type * const base = dynamic_cast<be_type*> (node->base_type ()); TAO_OutStream & os = *this->ctx_->stream (); @@ -452,7 +452,7 @@ be_visitor_typecode_defn::visit_interface_fwd (be_interface_fwd * node) int be_visitor_typecode_defn::visit_sequence (be_sequence * node) { - be_type * const base = be_type::narrow_from_decl (node->base_type ()); + be_type * const base = dynamic_cast<be_type*> (node->base_type ()); TAO_OutStream & os = *this->ctx_->stream (); @@ -615,7 +615,7 @@ be_visitor_typecode_defn::visit_typedef (be_typedef * node) // visited are strings and sequences. All others have their own // full-fledged visitors (e.g. objref_typecode, etc.) - be_type * const base = be_type::narrow_from_decl (node->base_type ()); + be_type * const base = dynamic_cast<be_type*> (node->base_type ()); this->recursion_detect_ = true; diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/union_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/union_typecode.cpp index 8616f9212f5..0e25abc58b3 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/union_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/union_typecode.cpp @@ -65,7 +65,7 @@ TAO::be_visitor_union_typecode::visit_union (be_union * node) << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; be_type * const discriminant_type = - be_type::narrow_from_decl (node->disc_type ()); + dynamic_cast<be_type*> (node->disc_type ()); ACE_ASSERT (discriminant_type != 0); @@ -121,7 +121,7 @@ TAO::be_visitor_union_typecode::visit_union (be_union * node) << node->default_index () << ");" << be_uidt_nl << be_uidt_nl; - if (this->gen_typecode_ptr (be_type::narrow_from_decl (node)) != 0) + if (this->gen_typecode_ptr (dynamic_cast<be_type*> (node)) != 0) { return -1; } @@ -141,7 +141,7 @@ TAO::be_visitor_union_typecode::gen_case_typecodes (be_union * node) node->field (member_ptr, i); be_type * const member_type = - be_type::narrow_from_decl ((*member_ptr)->field_type ()); + dynamic_cast<be_type*> ((*member_ptr)->field_type ()); if (this->is_typecode_generation_required (member_type) && member_type->accept (this) != 0) @@ -175,7 +175,7 @@ TAO::be_visitor_union_typecode::visit_cases (be_union * node) // Generate array containing union case/branch characterstics. be_type * const discriminant_type = - be_type::narrow_from_decl (node->disc_type ()); + dynamic_cast<be_type*> (node->disc_type ()); ACE_CString tao_cases ("_tao_cases_"); ACE_CString const fields_name (tao_cases @@ -193,10 +193,10 @@ TAO::be_visitor_union_typecode::visit_cases (be_union * node) node->field (member_ptr, fieldNumber); be_type * const type = - be_type::narrow_from_decl ((*member_ptr)->field_type ()); + dynamic_cast<be_type*> ((*member_ptr)->field_type ()); be_union_branch * const branch = - be_union_branch::narrow_from_decl (*member_ptr); + dynamic_cast<be_union_branch*> (*member_ptr); ACE_ASSERT (branch != 0); ACE_CDR::ULong numberOfLabels = branch->label_list_length (); diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp index 6103a7de557..a6c42848bb5 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp @@ -155,7 +155,7 @@ TAO::be_visitor_value_typecode::visit_valuetype (be_valuetype * node) if (concrete_base) { be_type * const base_type = - be_type::narrow_from_decl (concrete_base); + dynamic_cast<be_type*> (concrete_base); ACE_ASSERT (base_type); @@ -172,7 +172,7 @@ TAO::be_visitor_value_typecode::visit_valuetype (be_valuetype * node) << count << ");" << be_uidt_nl << be_uidt_nl; - if (this->gen_typecode_ptr (be_type::narrow_from_decl (node)) != 0) + if (this->gen_typecode_ptr (dynamic_cast<be_type*> (node)) != 0) { return -1; } @@ -198,7 +198,7 @@ TAO::be_visitor_value_typecode::gen_member_typecodes (be_valuetype * node) 0); } - AST_Field * const field = AST_Field::narrow_from_decl (d); + AST_Field * const field = dynamic_cast<AST_Field*> (d); if (!field || field->visibility () == AST_Field::vis_NA) @@ -207,7 +207,7 @@ TAO::be_visitor_value_typecode::gen_member_typecodes (be_valuetype * node) } be_type * const member_type = - be_type::narrow_from_decl (field->field_type ()); + dynamic_cast<be_type*> (field->field_type ()); if (this->is_typecode_generation_required (member_type) && member_type->accept (this) != 0) @@ -259,7 +259,7 @@ TAO::be_visitor_value_typecode::visit_members (be_valuetype * node) "bad node in this scope\n"), 0); } - AST_Field * const field = AST_Field::narrow_from_decl (d); + AST_Field * const field = dynamic_cast<AST_Field*> (d); if (!field) { @@ -274,10 +274,10 @@ TAO::be_visitor_value_typecode::visit_members (be_valuetype * node) } be_decl * const member_decl = - be_decl::narrow_from_decl (field); + dynamic_cast<be_decl*> (field); be_type * const member_type = - be_type::narrow_from_decl (field->field_type ()); + dynamic_cast<be_type*> (field->field_type ()); os << "{ " << "\"" << member_decl->original_local_name () << "\", " diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp index 3d3a68e300c..1ce7042fdac 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp @@ -101,7 +101,7 @@ be_visitor_typedef_any_op_cs::visit_typedef (be_typedef *node) this->ctx_->tdef (node); // save the typedef node // Grab the immediate base type node. - bt = be_type::narrow_from_decl (node->base_type ()); + bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp index eb40ff0be2c..272d02c5658 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp @@ -101,7 +101,7 @@ be_visitor_typedef_cdr_op_ch::visit_typedef (be_typedef *node) this->ctx_->tdef (node); // save the typedef node // Grab the immediate base type node. - bt = be_type::narrow_from_decl (node->base_type ()); + bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp index 0afec693394..c7bc2252879 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp @@ -97,7 +97,7 @@ be_visitor_typedef_cdr_op_cs::visit_typedef (be_typedef *node) this->ctx_->tdef (node); // save the typedef node // grab the immediate base type node - bt = be_type::narrow_from_decl (node->base_type ()); + bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp index be22cc09883..59af00701bc 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp @@ -90,7 +90,7 @@ be_visitor_typedef_ch::visit_typedef (be_typedef *node) this->ctx_->tdef (node); // Grab the immediate base type node. - bt = be_type::narrow_from_decl (node->base_type ()); + bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { @@ -203,7 +203,7 @@ be_visitor_typedef_ch::visit_array (be_array *node) // output statement. const char *static_decl = ""; - AST_Module *scope = AST_Module::narrow_from_scope (tdef->defined_in ()); + AST_Module *scope = dynamic_cast<AST_Module*> (tdef->defined_in ()); // If the typedef is not declared globally or in a module, the // associated array memory management function must be static. @@ -343,7 +343,7 @@ int be_visitor_typedef_ch::visit_interface_fwd (be_interface_fwd *) { // be_interface *fd = -// be_interface::narrow_from_decl (node->full_definition ()); +// dynamic_cast<be_interface*> (node->full_definition ()); // return this->visit_interface (fd); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp index 2928526e184..04adf9b3437 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp @@ -90,7 +90,7 @@ be_visitor_typedef_ci::visit_typedef (be_typedef *node) this->ctx_->tdef (node); // save the typedef node // grab the immediate base type node - bt = be_type::narrow_from_decl (node->base_type ()); + bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp index 4068d88b3b3..6586c0cdd74 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp @@ -90,7 +90,7 @@ be_visitor_typedef_cs::visit_typedef (be_typedef *node) this->ctx_->tdef (node); // Grab the immediate base type node. - bt = be_type::narrow_from_decl (node->base_type ()); + bt = dynamic_cast<be_type*> (node->base_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp index d7522094c26..4fe614a3ad9 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp @@ -44,13 +44,13 @@ be_visitor_union_any_op_ch::visit_union (be_union *node) if (node->defined_in ()->scope_node_type () == AST_Decl::NT_interface) { be_interface *intf = 0; - intf = be_interface::narrow_from_scope (node->defined_in ()); + intf = dynamic_cast<be_interface*> (node->defined_in ()); decl = intf; } if (decl->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (decl->defined_in ()); + module = dynamic_cast<be_module*> (decl->defined_in ()); if (!module) { @@ -106,7 +106,7 @@ be_visitor_union_any_op_ch::visit_union (be_union *node) { AST_Decl *d = si.item (); - be_enum *e = be_enum::narrow_from_decl (d); + be_enum *e = dynamic_cast<be_enum*> (d); if (e != 0) { be_visitor_enum_any_op_ch visitor (&ctx); @@ -139,7 +139,7 @@ int be_visitor_union_any_op_ch::visit_union_branch (be_union_branch *node) { // First generate the type information. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp index ed636e42cac..cecfe376499 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp @@ -78,13 +78,13 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) if (node->defined_in ()->scope_node_type () == AST_Decl::NT_interface) { be_interface *intf = 0; - intf = be_interface::narrow_from_scope (node->defined_in ()); + intf = dynamic_cast<be_interface*> (node->defined_in ()); decl = intf; } if (decl->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (decl->defined_in ()); + module = dynamic_cast<be_module*> (decl->defined_in ()); if (!module) { @@ -221,7 +221,7 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) { AST_Decl *d = si.item (); - be_enum *e = be_enum::narrow_from_decl (d); + be_enum *e = dynamic_cast<be_enum*> (d); if (e != 0) { be_visitor_enum_any_op_cs visitor (&ctx); @@ -254,7 +254,7 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) int be_visitor_union_any_op_cs::visit_union_branch (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp index c703262324d..41125edc8cd 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp @@ -65,7 +65,7 @@ be_visitor_union_cdr_op_ch::visit_union (be_union *node) { AST_Decl *d = si.item (); - be_enum *e = be_enum::narrow_from_decl (d); + be_enum *e = dynamic_cast<be_enum*> (d); if (e != 0) { be_visitor_enum_cdr_op_ch visitor (&ctx); diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp index d182f67c0b6..3e4cb98979b 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp @@ -42,7 +42,7 @@ be_visitor_union_cdr_op_cs::visit_union (be_union *node) { AST_Decl *d = si.item (); - be_enum *e = be_enum::narrow_from_decl (d); + be_enum *e = dynamic_cast<be_enum*> (d); if (e != 0) { be_visitor_enum_cdr_op_cs visitor (&ctx); @@ -159,7 +159,7 @@ be_visitor_union_cdr_op_cs::visit_union (be_union *node) << "{" << be_idt_nl; be_type* disc_type = - be_type::narrow_from_decl (node->disc_type ()); + dynamic_cast<be_type*> (node->disc_type ()); // Generate a temporary to store the discriminant *os << disc_type->full_name () diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp index b8d565cf865..6f354a6592a 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp @@ -26,7 +26,7 @@ be_visitor_union_discriminant_ch::visit_enum (be_enum *node) { // Get the enclosing union backend. be_union *bu = - be_union::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union*> (this->ctx_->node ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -81,7 +81,7 @@ be_visitor_union_discriminant_ch::visit_predefined_type (be_predefined_type { // get the enclosing union backend. be_union *bu = - be_union::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union*> (this->ctx_->node ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp index 1d1f5372921..e2f058bf507 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp @@ -25,7 +25,7 @@ int be_visitor_union_discriminant_ci::visit_enum (be_enum *node) { be_union *bu = - be_union::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union*> (this->ctx_->node ()); be_type *bt = 0; if (this->ctx_->alias ()) @@ -114,7 +114,7 @@ be_visitor_union_discriminant_ci::visit_predefined_type ( ) { be_union *bu = - be_union::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union*> (this->ctx_->node ()); be_type *bt = 0; diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp index fcebbea9129..f18af597266 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp @@ -26,7 +26,7 @@ int be_visitor_union_discriminant_cs::visit_enum (be_enum *node) { be_union *bu = - be_union::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union*> (this->ctx_->node ()); be_type *bt = 0; if (this->ctx_->alias ()) diff --git a/TAO/TAO_IDL/be/be_visitor_union/union.cpp b/TAO/TAO_IDL/be/be_visitor_union/union.cpp index 9ed497927ac..0e1fd1a9960 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union.cpp @@ -110,7 +110,7 @@ be_visitor_union::visit_union_branch (be_union_branch *node) be_visitor_union::BoolUnionBranch be_visitor_union::boolean_branch (be_union_branch *b) { - be_union *u = be_union::narrow_from_scope (b->defined_in ()); + be_union *u = dynamic_cast<be_union*> (b->defined_in ()); if (!u || u->udisc_type () != AST_Expression::EV_bool) return BUB_NONE; @@ -131,7 +131,7 @@ be_visitor_union::boolean_branch (be_union_branch *b) u->field (f, i); if (*f != b) { - AST_UnionBranch *other = AST_UnionBranch::narrow_from_decl (*f); + AST_UnionBranch *other = dynamic_cast<AST_UnionBranch*> (*f); for (unsigned long j = 0; j < other->label_list_length (); ++j) { has_other = true; @@ -162,7 +162,7 @@ be_visitor_union_cdr_op_cs::pre_process (be_decl *bd) TAO_OutStream *os = this->ctx_->stream (); be_union_branch* b = - be_union_branch::narrow_from_decl (bd); + dynamic_cast<be_union_branch*> (bd); // Could be a type decl. if (b == 0) diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp index 5c8f1be9fb5..d8e04dd7827 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp @@ -61,7 +61,7 @@ int be_visitor_union_ch::visit_union (be_union *node) << node->local_name () << " &);"; // Retrieve the disriminant type. - be_type *bt = be_type::narrow_from_decl (node->disc_type ()); + be_type *bt = dynamic_cast<be_type*> (node->disc_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp index 873d95becad..a9423333df5 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp @@ -43,7 +43,7 @@ int be_visitor_union_ci::visit_union (be_union *node) // the discriminant type may have to be defined here if it was an enum // declaration inside of the union statement. - be_type *bt = be_type::narrow_from_decl (node->disc_type ()); + be_type *bt = dynamic_cast<be_type*> (node->disc_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp index eb1cbd75784..fdadd8546de 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp @@ -35,7 +35,7 @@ int be_visitor_union_cs::visit_union (be_union *node) // declaration inside of the union statement. We need to generate its // typecode. - be_type *bt = be_type::narrow_from_decl (node->disc_type ()); + be_type *bt = dynamic_cast<be_type*> (node->disc_type ()); if (!bt) { @@ -98,7 +98,7 @@ int be_visitor_union_cs::visit_union (be_union *node) // Just get the union's first member. AST_Decl *d = si.item (); - ub = be_union_branch::narrow_from_decl (d); + ub = dynamic_cast<be_union_branch*> (d); si.next (); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp index 5ff6f661324..442fae3d029 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp @@ -23,7 +23,7 @@ be_visitor_union_branch_cdr_op_ch::~be_visitor_union_branch_cdr_op_ch (void) int be_visitor_union_branch_cdr_op_ch::visit_union_branch (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp index f585aeada96..7d4654d9cd9 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp @@ -35,7 +35,7 @@ be_visitor_union_branch_cdr_op_cs::~be_visitor_union_branch_cdr_op_cs (void) int be_visitor_union_branch_cdr_op_cs::visit_union_branch (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -85,7 +85,7 @@ be_visitor_union_branch_cdr_op_cs::visit_array (be_array *node) // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -116,7 +116,7 @@ be_visitor_union_branch_cdr_op_cs::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), @@ -185,7 +185,7 @@ be_visitor_union_branch_cdr_op_cs::visit_enum (be_enum *node) // Retrieve the union_branch node be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -260,7 +260,7 @@ be_visitor_union_branch_cdr_op_cs::visit_interface (be_interface *node) // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -340,7 +340,7 @@ be_visitor_union_branch_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node) // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -425,7 +425,7 @@ be_visitor_union_branch_cdr_op_cs::emit_valuetype_common (be_type *node) // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -483,7 +483,7 @@ be_visitor_union_branch_cdr_op_cs::visit_predefined_type ( // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -671,7 +671,7 @@ be_visitor_union_branch_cdr_op_cs::visit_sequence (be_sequence *node) // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -741,7 +741,7 @@ be_visitor_union_branch_cdr_op_cs::visit_string (be_string *node) // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -864,7 +864,7 @@ be_visitor_union_branch_cdr_op_cs::visit_structure (be_structure *node) // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -961,7 +961,7 @@ be_visitor_union_branch_cdr_op_cs::visit_union (be_union *node) // Retrieve the union_branch node. be_union_branch *f = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); if (f == 0) { @@ -1013,13 +1013,13 @@ int be_visitor_union_branch_cdr_op_cs::explicit_default (void) { be_union *bu = - be_union::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_union*> (this->ctx_->scope ()->decl ()); int def_index = bu->default_index (); if (def_index != -1) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); int i = 0; @@ -1034,7 +1034,7 @@ be_visitor_union_branch_cdr_op_cs::explicit_default (void) if (!d->imported ()) { - bub = be_union_branch::narrow_from_decl (d); + bub = dynamic_cast<be_union_branch*> (d); } if (bub == ub) diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp index 888f7230521..8eed1cecc00 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp @@ -33,7 +33,7 @@ be_visitor_union_branch_private_ch::~be_visitor_union_branch_private_ch (void) int be_visitor_union_branch_private_ch::visit_union_branch (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -541,7 +541,7 @@ be_visitor_union_branch_private_ch::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -613,7 +613,7 @@ be_visitor_union_branch_private_ch::visit_union_fwd ( be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp index 994f676a660..dff99270805 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp @@ -78,7 +78,7 @@ be_visitor_union_branch_public_assign_cs::visit_union_branch ( } // first generate the type information - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -122,9 +122,9 @@ int be_visitor_union_branch_public_assign_cs::visit_array (be_array *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -165,7 +165,7 @@ be_visitor_union_branch_public_assign_cs::visit_array (be_array *node) if (bt->is_nested ()) { - be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); + be_decl *parent = dynamic_cast<be_scope*> (bt->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), bt->local_name ()->get_string ()); } @@ -194,9 +194,9 @@ int be_visitor_union_branch_public_assign_cs::visit_enum (be_enum *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -222,9 +222,9 @@ int be_visitor_union_branch_public_assign_cs::visit_interface (be_interface *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -319,9 +319,9 @@ be_visitor_union_branch_public_assign_cs::visit_interface_fwd ( ) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -434,9 +434,9 @@ int be_visitor_union_branch_public_assign_cs::emit_valuetype_common (be_type *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -504,9 +504,9 @@ be_visitor_union_branch_public_assign_cs::visit_predefined_type ( ) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -616,9 +616,9 @@ int be_visitor_union_branch_public_assign_cs::visit_sequence (be_sequence *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -681,9 +681,9 @@ int be_visitor_union_branch_public_assign_cs::visit_string (be_string *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -717,9 +717,9 @@ int be_visitor_union_branch_public_assign_cs::visit_structure (be_structure *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -791,7 +791,7 @@ be_visitor_union_branch_public_assign_cs::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -822,9 +822,9 @@ int be_visitor_union_branch_public_assign_cs::visit_union (be_union *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -888,7 +888,7 @@ be_visitor_union_branch_public_assign_cs::visit_union_fwd ( be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (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 7453c27a662..a9e96e188e9 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 @@ -29,7 +29,7 @@ be_visitor_union_branch_public_ch::~be_visitor_union_branch_public_ch (void) int be_visitor_union_branch_public_ch::visit_union_branch (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -672,7 +672,7 @@ be_visitor_union_branch_public_ch::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -764,7 +764,7 @@ 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 ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp index f5ff581f3e3..c6d85ab4ea4 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp @@ -32,7 +32,7 @@ be_visitor_union_branch_public_ci::~be_visitor_union_branch_public_ci (void) int be_visitor_union_branch_public_ci::visit_union_branch (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -63,9 +63,9 @@ int be_visitor_union_branch_public_ci::visit_array (be_array *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -131,7 +131,7 @@ be_visitor_union_branch_public_ci::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (bt->defined_in ())->decl (); + dynamic_cast<be_scope*> (bt->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), @@ -198,9 +198,9 @@ int be_visitor_union_branch_public_ci::visit_enum (be_enum *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // heck if we are visiting this node via a visit to a typedef node. @@ -269,9 +269,9 @@ int be_visitor_union_branch_public_ci::visit_interface (be_interface *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -359,9 +359,9 @@ int be_visitor_union_branch_public_ci::visit_interface_fwd (be_interface_fwd *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -467,9 +467,9 @@ int be_visitor_union_branch_public_ci::emit_valuetype_common (be_type *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -546,9 +546,9 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( ) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -758,9 +758,9 @@ int be_visitor_union_branch_public_ci::visit_sequence (be_sequence *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -840,9 +840,9 @@ int be_visitor_union_branch_public_ci::visit_string (be_string *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -1011,9 +1011,9 @@ int be_visitor_union_branch_public_ci::visit_structure (be_structure *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -1147,7 +1147,7 @@ int be_visitor_union_branch_public_ci::visit_structure_fwd (be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -1178,9 +1178,9 @@ int be_visitor_union_branch_public_ci::visit_union (be_union *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -1284,7 +1284,7 @@ int be_visitor_union_branch_public_ci::visit_union_fwd (be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_constructor_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_constructor_cs.cpp index d705678dc17..75888dd093b 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_constructor_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_constructor_cs.cpp @@ -35,7 +35,7 @@ be_visitor_union_branch_public_constructor_cs::visit_union_branch ( be_union_branch *node) { // first generate the type information - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -66,9 +66,9 @@ int be_visitor_union_branch_public_constructor_cs::visit_array (be_array *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -109,7 +109,7 @@ be_visitor_union_branch_public_constructor_cs::visit_array (be_array *node) if (bt->is_nested ()) { - be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); + be_decl *parent = dynamic_cast<be_scope*> (bt->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), bt->local_name ()->get_string ()); } @@ -138,9 +138,9 @@ be_visitor_union_branch_public_constructor_cs::visit_predefined_type ( ) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -184,9 +184,9 @@ int be_visitor_union_branch_public_constructor_cs::visit_sequence (be_sequence *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -221,9 +221,9 @@ int be_visitor_union_branch_public_constructor_cs::visit_structure (be_structure *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -262,7 +262,7 @@ be_visitor_union_branch_public_constructor_cs::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -293,9 +293,9 @@ int be_visitor_union_branch_public_constructor_cs::visit_union (be_union *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -331,7 +331,7 @@ be_visitor_union_branch_public_constructor_cs::visit_union_fwd ( be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp index 66141aeaa36..2d8975681b1 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp @@ -29,7 +29,7 @@ be_visitor_union_branch_public_cs::~be_visitor_union_branch_public_cs (void) int be_visitor_union_branch_public_cs::visit_union_branch (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -155,7 +155,7 @@ int be_visitor_union_branch_public_cs::visit_structure_fwd (be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -183,7 +183,7 @@ int be_visitor_union_branch_public_cs::visit_union_fwd (be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp index ec3bb50f589..79bf8a03e1d 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp @@ -33,7 +33,7 @@ be_visitor_union_branch_public_reset_cs::visit_union_branch ( be_union_branch *node) { TAO_OutStream *os = this->ctx_->stream (); - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -109,9 +109,9 @@ int be_visitor_union_branch_public_reset_cs::visit_array (be_array *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; if (this->ctx_->alias ()) @@ -151,7 +151,7 @@ be_visitor_union_branch_public_reset_cs::visit_array (be_array *node) if (bt->is_nested ()) { - be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); + be_decl *parent = dynamic_cast<be_scope*> (bt->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), bt->local_name ()->get_string ()); } @@ -178,9 +178,9 @@ int be_visitor_union_branch_public_reset_cs::visit_enum (be_enum *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -198,9 +198,9 @@ int be_visitor_union_branch_public_reset_cs::visit_interface (be_interface *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -225,9 +225,9 @@ int be_visitor_union_branch_public_reset_cs::visit_interface_fwd (be_interface_fwd *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -253,9 +253,9 @@ be_visitor_union_branch_public_reset_cs::visit_valuebox ( be_valuebox *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -281,9 +281,9 @@ be_visitor_union_branch_public_reset_cs::visit_valuetype ( be_valuetype *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -309,9 +309,9 @@ be_visitor_union_branch_public_reset_cs::visit_valuetype_fwd ( be_valuetype_fwd *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -338,9 +338,9 @@ be_visitor_union_branch_public_reset_cs::visit_predefined_type ( ) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -390,9 +390,9 @@ be_visitor_union_branch_public_reset_cs::visit_sequence ( be_sequence *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -419,9 +419,9 @@ be_visitor_union_branch_public_reset_cs::visit_string ( be_string *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -456,9 +456,9 @@ be_visitor_union_branch_public_reset_cs::visit_structure ( be_structure *node) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); be_type *bt = 0; if (this->ctx_->alias ()) @@ -499,7 +499,7 @@ be_visitor_union_branch_public_reset_cs::visit_structure_fwd ( be_structure_fwd *node) { be_structure *s = - be_structure::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_structure*> (node->full_definition ()); return this->visit_structure (s); } @@ -530,9 +530,9 @@ be_visitor_union_branch_public_reset_cs::visit_union ( be_union *) { be_union_branch *ub = - be_union_branch::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_union_branch*> (this->ctx_->node ()); be_union *bu = - be_union::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_union*> (this->ctx_->scope ()); if (ub == 0 || bu == 0) { @@ -558,7 +558,7 @@ be_visitor_union_branch_public_reset_cs::visit_union_fwd ( be_union_fwd *node) { be_union *u = - be_union::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_union*> (node->full_definition ()); return this->visit_union (u); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp index ae6aa99cb26..3ae629bb223 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp @@ -32,7 +32,7 @@ be_visitor_union_fwd_ch::visit_union_fwd (be_union_fwd *node) } TAO_OutStream *os = this->ctx_->stream (); - be_union *fd = be_union::narrow_from_decl (node->full_definition ()); + be_union *fd = dynamic_cast<be_union*> (node->full_definition ()); // This will be a no-op if it has already been done for this node. fd->gen_common_varout (os); diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_ch.cpp index 7e722cc43d7..78aea71a1dc 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_ch.cpp @@ -47,7 +47,7 @@ be_visitor_valuebox_any_op_ch::visit_valuebox (be_valuebox *node) if (node->is_nested () && node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (node->defined_in ()); + module = dynamic_cast<be_module*> (node->defined_in ()); if (!module) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp index ce748c930f4..73a9d99f761 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp @@ -72,7 +72,7 @@ be_visitor_valuebox_any_op_cs::visit_valuebox (be_valuebox *node) if (node->is_nested () && node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (node->defined_in ()); + module = dynamic_cast<be_module*> (node->defined_in ()); if (!module) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/field_ch.cpp index b2e000a6e67..f3f9358ba5d 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/field_ch.cpp @@ -32,7 +32,7 @@ be_visitor_valuebox_field_ch::~be_visitor_valuebox_field_ch (void) int be_visitor_valuebox_field_ch::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -101,7 +101,7 @@ be_visitor_valuebox_field_ch::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (bt->defined_in ())->decl (); + dynamic_cast<be_scope*> (bt->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/field_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/field_ci.cpp index e75c6c8f99b..30d21bb3b2a 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/field_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/field_ci.cpp @@ -28,7 +28,7 @@ be_visitor_valuebox_field_ci::~be_visitor_valuebox_field_ci (void) int be_visitor_valuebox_field_ci::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -42,7 +42,7 @@ be_visitor_valuebox_field_ci::visit_field (be_field *node) // Store the valuebox in the visitor member, then replace the // context value with the field node. this->vb_node_ = - be_valuebox::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_valuebox*> (this->ctx_->node ()); this->ctx_->node (node); if (bt->accept (this) == -1) @@ -99,7 +99,7 @@ be_visitor_valuebox_field_ci::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (bt->defined_in ())->decl (); + dynamic_cast<be_scope*> (bt->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/union_member_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/union_member_ci.cpp index 7e4b1b20af6..a0657150fc7 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/union_member_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/union_member_ci.cpp @@ -28,7 +28,7 @@ be_visitor_valuebox_union_member_ci::~be_visitor_valuebox_union_member_ci (void) int be_visitor_valuebox_union_member_ci::visit_union_member (be_union_branch *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -40,7 +40,7 @@ be_visitor_valuebox_union_member_ci::visit_union_member (be_union_branch *node) } this->vb_node_ = - be_valuebox::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_valuebox*> (this->ctx_->node ()); this->ctx_->node (node); if (bt->accept (this) == -1) @@ -97,7 +97,7 @@ be_visitor_valuebox_union_member_ci::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (bt->defined_in ())->decl (); + dynamic_cast<be_scope*> (bt->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp index 62a5ea3c573..6d64385f51c 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp @@ -96,7 +96,7 @@ be_visitor_valuebox_ch::visit_valuebox (be_valuebox *node) << be_nl_2; } - be_type *bt = be_type::narrow_from_decl (node->boxed_type ()); + be_type *bt = dynamic_cast<be_type*> (node->boxed_type ()); // Emit the type specific elements. The visit_* methods in this // module do that work. @@ -268,7 +268,7 @@ be_visitor_valuebox_ch::visit_sequence (be_sequence *node) // Retrieve the base type since we will need to do some code // generation for it. - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); if (bt == 0) { @@ -518,7 +518,7 @@ be_visitor_valuebox_ch::visit_structure (be_structure *node) { d = si.item (); - if (d == 0 || (field = AST_Field::narrow_from_decl (d)) == 0) + if (d == 0 || (field = dynamic_cast<AST_Field*> (d)) == 0) { ACE_ERROR ((LM_ERROR, "(%N:%l) be_visitor_valuebox_ch::visit_structure -" @@ -526,10 +526,10 @@ be_visitor_valuebox_ch::visit_structure (be_structure *node) break; } - bt = be_type::narrow_from_decl (field->field_type ()); + bt = dynamic_cast<be_type*> (field->field_type ()); // Set the node to be visited - ctx.node (be_decl::narrow_from_decl (d)); + ctx.node (dynamic_cast<be_decl*> (d)); // Create a visitor and use that to process the type. be_visitor_valuebox_field_ch visitor (&ctx); @@ -619,7 +619,7 @@ be_visitor_valuebox_ch::visit_union (be_union *node) { d = si.item (); - if (d == 0 || (field = AST_Field::narrow_from_decl (d)) == 0) + if (d == 0 || (field = dynamic_cast<AST_Field*> (d)) == 0) { ACE_ERROR ((LM_ERROR, "(%N:%l) be_visitor_valuebox_ch::visit_union -" @@ -627,10 +627,10 @@ be_visitor_valuebox_ch::visit_union (be_union *node) break; } - bt = be_type::narrow_from_decl (field->field_type ()); + bt = dynamic_cast<be_type*> (field->field_type ()); // Set the node to be visited - ctx.node (be_decl::narrow_from_decl (d)); + ctx.node (dynamic_cast<be_decl*> (d)); // Create a visitor and use that to process the type. be_visitor_valuebox_field_ch visitor (&ctx); @@ -644,7 +644,7 @@ be_visitor_valuebox_ch::visit_union (be_union *node) } // Retrieve the disriminant type. - bt = be_type::narrow_from_decl (node->disc_type ()); + bt = dynamic_cast<be_type*> (node->disc_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp index 37efd925b18..0df910222b4 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp @@ -33,7 +33,7 @@ be_visitor_valuebox_ci::visit_valuebox (be_valuebox *node) this->ctx_->node (node); // save the node - be_type *bt = be_type::narrow_from_decl (node->boxed_type ()); + be_type *bt = dynamic_cast<be_type*> (node->boxed_type ()); // Emit the type specific elements. The visit_* methods in this // module do that work. @@ -426,7 +426,7 @@ be_visitor_valuebox_ci::visit_structure (be_structure *node) { d = si.item (); - if (d == 0 || (field = be_field::narrow_from_decl (d)) == 0) + if (d == 0 || (field = dynamic_cast<be_field*> (d)) == 0) { ACE_ERROR ((LM_ERROR, "(%N:%l) be_visitor_valuebox_cs::visit_structure -" @@ -485,7 +485,7 @@ be_visitor_valuebox_ci::visit_union (be_union *node) this->emit_accessor_modifier (node); be_valuebox *vb_node = - be_valuebox::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_valuebox*> (this->ctx_->node ()); if (node->size_type() == AST_Type::FIXED) { @@ -508,7 +508,7 @@ be_visitor_valuebox_ci::visit_union (be_union *node) { d = si.item (); - if (d == 0 || (member = be_union_branch::narrow_from_decl (d)) == 0) + if (d == 0 || (member = dynamic_cast<be_union_branch*> (d)) == 0) { ACE_ERROR ((LM_ERROR, "(%N:%l) be_visitor_valuebox_ci::visit_union -" @@ -535,7 +535,7 @@ be_visitor_valuebox_ci::visit_union (be_union *node) // Retrieve the disriminant type. be_type *bt = 0; - bt = be_type::narrow_from_decl (node->disc_type ()); + bt = dynamic_cast<be_type*> (node->disc_type ()); if (!bt) { @@ -657,7 +657,7 @@ be_visitor_valuebox_ci::emit_default_constructor_alloc (be_decl *node) // Retrieve the node being visited by this be_visitor_valuebox_ci be_decl * vb_node = this->ctx_->node (); bool node_not_pod = - be_type::narrow_from_decl (node)->size_type () == AST_Type::VARIABLE; + dynamic_cast<be_type*> (node)->size_type () == AST_Type::VARIABLE; // Public default constructor *os << "ACE_INLINE" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp index b007c1311e2..dd45e8f2e41 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp @@ -165,7 +165,7 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node) os = tao_cg->client_stubs (); AST_Type * at = node->boxed_type()->unaliased_type(); - be_type *bt = be_type::narrow_from_decl (at); + be_type *bt = dynamic_cast<be_type*> (at); if (!bt) { @@ -178,7 +178,7 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node) bool is_array = false; const char * unmarshal_arg; - be_predefined_type *bpt = be_predefined_type::narrow_from_decl (bt); + be_predefined_type *bpt = dynamic_cast<be_predefined_type*> (bt); if (bpt != 0) { @@ -214,7 +214,7 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node) unmarshal_arg = "vb_object->_pd_value"; } } - else if (be_array::narrow_from_decl (bt) != 0) + else if (dynamic_cast<be_array*> (bt) != 0) { is_array = true; unmarshal_arg = "temp"; @@ -270,7 +270,7 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node) *os << "return (strm >> "; - be_string *str = be_string::narrow_from_decl (bt); + be_string *str = dynamic_cast<be_string*> (bt); if (str != 0 && str->max_size ()->ev ()->u.ulval != 0) { @@ -448,7 +448,7 @@ be_visitor_valuebox_cs::visit_sequence (be_sequence *node) // Retrieve the base type since we will need to do some code // generation for it. - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = dynamic_cast<be_type*> (node->base_type ()); if (bt == 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp index 7eca7e52a20..77e138be8ab 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp @@ -47,7 +47,7 @@ be_visitor_valuetype_any_op_ch::visit_valuetype (be_valuetype *node) if (node->is_nested () && node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (node->defined_in ()); + module = dynamic_cast<be_module*> (node->defined_in ()); if (!module) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp index dfb80cfc402..509937c55fa 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp @@ -71,7 +71,7 @@ be_visitor_valuetype_any_op_cs::visit_valuetype (be_valuetype *node) if (node->is_nested () && node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (node->defined_in ()); + module = dynamic_cast<be_module*> (node->defined_in ()); if (!module) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp index a6b3d354ecf..a633699f97d 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp @@ -33,7 +33,7 @@ bool be_visitor_obv_operation_arglist::is_amh_exception_holder (be_operation *node) { UTL_Scope *scope = node->defined_in (); - be_interface *iface = be_interface::narrow_from_scope (scope); + be_interface *iface = dynamic_cast<be_interface*> (scope); if (iface != 0) { @@ -121,13 +121,13 @@ be_visitor_obv_operation_arglist::visit_argument (be_argument *node) // inside the scope of the interface node. In such cases, we would like to // generate the appropriate relative scoped names. be_operation *op = - be_operation::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_operation*> (this->ctx_->node ()); // Sometimes the operation is stored in the context scope instead. if (op == 0) { op = - be_operation::narrow_from_scope (this->ctx_->scope ()); + dynamic_cast<be_operation*> (this->ctx_->scope ()); } if (op == 0) @@ -144,8 +144,8 @@ be_visitor_obv_operation_arglist::visit_argument (be_argument *node) // information from the context. // %! use AST_Interface be_interface *intf = this->ctx_->attribute () - ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) - : be_interface::narrow_from_scope (op->defined_in ()); + ? dynamic_cast<be_interface*> (this->ctx_->attribute ()->defined_in ()) + : dynamic_cast<be_interface*> (op->defined_in ()); if (!intf) { @@ -160,7 +160,7 @@ be_visitor_obv_operation_arglist::visit_argument (be_argument *node) ctx.node (node); // save the argument node // Retrieve the type. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp index 4c2213e6315..f3106b00fe9 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp @@ -127,7 +127,7 @@ be_visitor_valuetype_cdr_op_cs::visit_eventtype (be_eventtype *node) int be_visitor_valuetype_cdr_op_cs::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (bt == 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp index fd41d88450a..4f38613afac 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp @@ -31,7 +31,7 @@ be_visitor_valuetype_field_cdr_ch::~be_visitor_valuetype_field_cdr_ch (void) int be_visitor_valuetype_field_cdr_ch::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp index bfdfe589c3d..9af6e532cc5 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp @@ -31,7 +31,7 @@ be_visitor_valuetype_field_cdr_cs::~be_visitor_valuetype_field_cdr_cs (void) int be_visitor_valuetype_field_cdr_cs::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -63,7 +63,7 @@ be_visitor_valuetype_field_cdr_cs::visit_array (be_array *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -92,7 +92,7 @@ be_visitor_valuetype_field_cdr_cs::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), @@ -168,7 +168,7 @@ be_visitor_valuetype_field_cdr_cs::visit_enum (be_enum *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -230,7 +230,7 @@ be_visitor_valuetype_field_cdr_cs::visit_interface (be_interface *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -280,7 +280,7 @@ be_visitor_valuetype_field_cdr_cs::visit_interface_fwd (be_interface_fwd *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -336,7 +336,7 @@ be_visitor_valuetype_field_cdr_cs::valuetype_common (be_type *) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -388,7 +388,7 @@ be_visitor_valuetype_field_cdr_cs::visit_valuetype_fwd (be_valuetype_fwd *) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -458,7 +458,7 @@ be_visitor_valuetype_field_cdr_cs::visit_predefined_type (be_predefined_type *no // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -563,7 +563,7 @@ be_visitor_valuetype_field_cdr_cs::visit_sequence (be_sequence *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -628,7 +628,7 @@ be_visitor_valuetype_field_cdr_cs::visit_string (be_string *str) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -710,7 +710,7 @@ be_visitor_valuetype_field_cdr_cs::visit_structure ( // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -793,7 +793,7 @@ be_visitor_valuetype_field_cdr_cs::visit_union (be_union *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -869,7 +869,7 @@ be_visitor_valuetype_field_cdr_decl::be_visitor_valuetype_field_cdr_decl ( int be_visitor_valuetype_field_cdr_decl::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -902,7 +902,7 @@ be_visitor_valuetype_field_cdr_decl::visit_array (be_array *node) // Retrieve the field node. be_field *f = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); if (f == 0) { @@ -915,7 +915,7 @@ be_visitor_valuetype_field_cdr_decl::visit_array (be_array *node) // Retrieve the valuetype scope in which the code is generated. be_decl *sc = this->ctx_->scope ()->decl (); - be_valuetype *vt = be_valuetype::narrow_from_decl (sc); + be_valuetype *vt = dynamic_cast<be_valuetype*> (sc); if (!vt) { @@ -944,7 +944,7 @@ be_visitor_valuetype_field_cdr_decl::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp index 443537afbc7..bdd7fdb7cfa 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp @@ -29,7 +29,7 @@ be_visitor_valuetype_field_ch::~be_visitor_valuetype_field_ch (void) int be_visitor_valuetype_field_ch::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -538,7 +538,7 @@ be_visitor_valuetype_field_ch::visit_sequence (be_sequence *node) && this->ctx_->state () != TAO_CodeGen::TAO_VALUETYPE_OBV_CH) { be_field *member_node = - be_field::narrow_from_decl (this->ctx_->node ()); + dynamic_cast<be_field*> (this->ctx_->node ()); node->field_node (member_node); be_visitor_context ctx (*this->ctx_); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp index d4de857f18b..261508bd9ba 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp @@ -29,7 +29,7 @@ be_visitor_valuetype_field_ci::~be_visitor_valuetype_field_ci (void) int be_visitor_valuetype_field_ci::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -61,7 +61,7 @@ be_visitor_valuetype_field_ci::visit_array (be_array *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -108,7 +108,7 @@ be_visitor_valuetype_field_ci::visit_structure (be_structure *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -155,7 +155,7 @@ be_visitor_valuetype_field_ci::visit_union (be_union *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp index 1630607224e..a33196f905d 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp @@ -28,7 +28,7 @@ be_visitor_valuetype_field_cs::~be_visitor_valuetype_field_cs (void) int be_visitor_valuetype_field_cs::visit_field (be_field *node) { - be_type *bt = be_type::narrow_from_decl (node->field_type ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); if (!bt) { @@ -60,7 +60,7 @@ be_visitor_valuetype_field_cs::visit_array (be_array *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -117,7 +117,7 @@ be_visitor_valuetype_field_cs::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = - be_scope::narrow_from_scope (bt->defined_in ())->decl (); + dynamic_cast<be_scope*> (bt->defined_in ())->decl (); ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), @@ -190,7 +190,7 @@ be_visitor_valuetype_field_cs::visit_enum (be_enum *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -259,7 +259,7 @@ be_visitor_valuetype_field_cs::visit_interface (be_interface *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -328,7 +328,7 @@ be_visitor_valuetype_field_cs::visit_interface_fwd (be_interface_fwd *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -402,7 +402,7 @@ be_visitor_valuetype_field_cs::valuetype_common (be_type *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -483,7 +483,7 @@ be_visitor_valuetype_field_cs::visit_valuetype_fwd (be_valuetype_fwd *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -559,7 +559,7 @@ be_visitor_valuetype_field_cs::visit_predefined_type (be_predefined_type *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -717,7 +717,7 @@ be_visitor_valuetype_field_cs::visit_sequence (be_sequence *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -815,7 +815,7 @@ be_visitor_valuetype_field_cs::visit_string (be_string *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); if (!ub || !bu) { @@ -958,7 +958,7 @@ be_visitor_valuetype_field_cs::visit_structure (be_structure *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. @@ -1075,7 +1075,7 @@ be_visitor_valuetype_field_cs::visit_union (be_union *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); be_type *bt = 0; // Check if we are visiting this node via a visit to a typedef node. diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp index 55750694cf7..b9959bce8bd 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp @@ -47,7 +47,7 @@ be_visitor_valuetype_marshal_ch::visit_valuetype (be_valuetype *node) } - be_field *field = be_field::narrow_from_decl (d); + be_field *field = dynamic_cast<be_field*> (d); if (field) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp index 9ada107afd1..e8a0068182c 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp @@ -240,7 +240,7 @@ be_visitor_valuetype_marshal_cs::class_name (be_valuetype *node, if (node->opt_accessor ()) { be_decl *scope = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); *os << scope->name () << "::" << node->local_name (); @@ -277,9 +277,9 @@ be_visitor_valuetype_marshal_cs::gen_fields (be_valuetype *node, // (JP) 2010-10-21 // be_attribute now inherits from be_field, so we need this check. - be_attribute *attr = be_attribute::narrow_from_decl (d); + be_attribute *attr = dynamic_cast<be_attribute*> (d); - be_field *field = be_field::narrow_from_decl (d); + be_field *field = dynamic_cast<be_field*> (d); if (field != 0 && attr == 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp index 473d87baf7c..62f092fc062 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp @@ -39,7 +39,7 @@ be_visitor_valuetype::visit_valuetype_scope (be_valuetype *node) -1); } - be_decl *bd = be_decl::narrow_from_decl (d); + be_decl *bd = dynamic_cast<be_decl*> (d); // Set the scope node as "node" in which the code is being // generated so that elements in the node's scope can use it // for code generation. @@ -48,7 +48,7 @@ be_visitor_valuetype::visit_valuetype_scope (be_valuetype *node) this->ctx_->node (bd); this->elem_number_++; - AST_Field *field = AST_Field::narrow_from_decl (d); + AST_Field *field = dynamic_cast<AST_Field*> (d); if (field != 0 && field->visibility () == AST_Field::vis_PRIVATE) { @@ -681,8 +681,8 @@ be_visitor_valuetype::gen_pd (be_valuetype *node) -1); } - be_field *field = be_field::narrow_from_decl (d); - be_attribute *attr = be_attribute::narrow_from_decl (d); + be_field *field = dynamic_cast<be_field*> (d); + be_attribute *attr = dynamic_cast<be_attribute*> (d); if (field == 0 || attr != 0) { @@ -719,8 +719,8 @@ be_visitor_valuetype::gen_field_pd (be_field *node) TAO_OutStream *os = this->ctx_->stream (); // First generate the type information. - be_type *bt = be_type::narrow_from_decl (node->field_type ()); - be_valuetype *vt = be_valuetype::narrow_from_scope (node->defined_in ()); + be_type *bt = dynamic_cast<be_type*> (node->field_type ()); + be_valuetype *vt = dynamic_cast<be_valuetype*> (node->defined_in ()); if (!bt || !vt) { @@ -767,7 +767,7 @@ be_visitor_valuetype::gen_obv_init_constructor_args (be_valuetype *node, if (parent != 0) { be_valuetype *be_parent = - be_valuetype::narrow_from_decl (parent); + dynamic_cast<be_valuetype*> (parent); this->gen_obv_init_constructor_args (be_parent, index); } @@ -780,9 +780,9 @@ be_visitor_valuetype::gen_obv_init_constructor_args (be_valuetype *node, { // be_attribute inherits from be_field // so we have to also screen out attributes - be_field *f = be_field::narrow_from_decl (si.item ()); + be_field *f = dynamic_cast<be_field*> (si.item ()); be_attribute *attr = - be_attribute::narrow_from_decl (si.item ()); + dynamic_cast<be_attribute*> (si.item ()); if (f == 0 || attr != 0) { @@ -795,7 +795,7 @@ be_visitor_valuetype::gen_obv_init_constructor_args (be_valuetype *node, arg_name += f->local_name ()->get_string (); Identifier id (arg_name.c_str ()); UTL_ScopedName sn (&id, 0); - be_type *ft = be_type::narrow_from_decl (f->field_type ()); + be_type *ft = dynamic_cast<be_type*> (f->field_type ()); bool seen = ft->seen_in_operation (); // This sets ft->seen_in_operation (true), so we have to @@ -900,7 +900,7 @@ be_visitor_valuetype::obv_need_ref_counter (be_valuetype* node) for (int i = 0; i < node->n_inherits (); ++i) { be_valuetype *vt = - be_valuetype::narrow_from_decl (node->inherits ()[i]); + dynamic_cast<be_valuetype*> (node->inherits ()[i]); if (vt != 0) { @@ -947,7 +947,7 @@ be_visitor_valuetype::obv_have_ref_counter (be_valuetype* node) // Now go thru our base VTs. for (int i = 0; i < node->n_inherits (); ++i) { - be_valuetype *vt = be_valuetype::narrow_from_decl (node->inherits ()[i]); + be_valuetype *vt = dynamic_cast<be_valuetype*> (node->inherits ()[i]); if (vt != 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp index 2528d6619ec..4984e3448d9 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp @@ -76,7 +76,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) for (i = 0; i < n_inherits; ++i) { inherited = - be_valuetype::narrow_from_decl (node->inherits ()[i]); + dynamic_cast<be_valuetype*> (node->inherits ()[i]); if (inherited->node_type () == AST_Decl::NT_eventtype) { @@ -94,7 +94,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) { // Inherited node is used in the scope of "node" node. scope = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); } // Dump the scoped name. @@ -398,7 +398,7 @@ be_visitor_valuetype_ch::visit_operation (be_operation *node) // Every operation is declared public and virtual in the client code. *os << be_uidt_nl << "public:" << be_idt_nl << "virtual "; - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -443,7 +443,7 @@ be_visitor_valuetype_ch::visit_operation (be_operation *node) int be_visitor_valuetype_ch::visit_field (be_field *node) { - be_valuetype *vt = be_valuetype::narrow_from_scope (node->defined_in ()); + be_valuetype *vt = dynamic_cast<be_valuetype*> (node->defined_in ()); if (!vt) { @@ -522,7 +522,7 @@ be_visitor_valuetype_ch::gen_supported_ops (be_interface *, if (nt == AST_Decl::NT_op) { - be_operation *op = be_operation::narrow_from_decl (d); + be_operation *op = dynamic_cast<be_operation*> (d); if (visitor.visit_operation (op) == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp index 9426f4f5e19..122540ac6b8 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp @@ -183,7 +183,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) if (node->opt_accessor ()) { be_decl *scope = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); *os << scope->name () << "::" << node->local_name () @@ -210,7 +210,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) if (node->opt_accessor ()) { be_decl *scope = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + dynamic_cast<be_scope*> (node->defined_in ())->decl (); *os << scope->name () << "::" << node->local_name () @@ -407,7 +407,7 @@ be_visitor_valuetype_cs::visit_operation (be_operation *node) } be_valuetype *parent = - be_valuetype::narrow_from_scope (node->defined_in ()); + dynamic_cast<be_valuetype*> (node->defined_in ()); if (parent == 0 || ! this->is_amh_exception_holder (parent)) { @@ -421,7 +421,7 @@ be_visitor_valuetype_cs::visit_operation (be_operation *node) << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; // STEP I: Generate the return type. - be_type *bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = dynamic_cast<be_type*> (node->return_type ()); if (!bt) { @@ -495,7 +495,7 @@ be_visitor_valuetype_cs::gen_ostream_operator_r (be_valuetype *node, // Recurse up the parent chain. if (parent != 0) { - this->gen_ostream_operator_r (be_valuetype::narrow_from_decl (parent), + this->gen_ostream_operator_r (dynamic_cast<be_valuetype*> (parent), index); } @@ -504,9 +504,9 @@ be_visitor_valuetype_cs::gen_ostream_operator_r (be_valuetype *node, !i.is_done (); i.next ()) { - be_field *f = be_field::narrow_from_decl (i.item ()); + be_field *f = dynamic_cast<be_field*> (i.item ()); be_attribute *attr = - be_attribute::narrow_from_decl (i.item ()); + dynamic_cast<be_attribute*> (i.item ()); // No way to access the private members from generated code. if (f == 0 diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp index 5d143a8b52c..8c97368f748 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp @@ -142,7 +142,7 @@ be_visitor_valuetype_init_ch::visit_factory (be_factory *node) TAO_OutStream& os = *(this->ctx_->stream ()); be_valuetype *vt = - be_valuetype::narrow_from_decl (this->ctx_->scope ()->decl ()); + dynamic_cast<be_valuetype*> (this->ctx_->scope ()->decl ()); // STEP I: Generate preambule. diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp index 87ce9741cbb..879f325fb37 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp @@ -253,7 +253,7 @@ be_visitor_valuetype_obv_ch::visit_eventtype (be_eventtype *node) int be_visitor_valuetype_obv_ch::visit_field (be_field *node) { - be_valuetype *vt = be_valuetype::narrow_from_scope (node->defined_in ()); + be_valuetype *vt = dynamic_cast<be_valuetype*> (node->defined_in ()); if (!vt) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp index c904904a95e..14f9a18fead 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp @@ -217,7 +217,7 @@ be_visitor_valuetype_obv_cs::gen_obv_init_base_constructor_args ( if (parent != 0) { be_valuetype *be_parent = - be_valuetype::narrow_from_decl (parent); + dynamic_cast<be_valuetype*> (parent); this->gen_obv_init_base_constructor_args (be_parent, index); } @@ -227,9 +227,9 @@ be_visitor_valuetype_obv_cs::gen_obv_init_base_constructor_args ( { // be_attribute inherits from be_field // so we have to also screen out attributes - be_field *f = be_field::narrow_from_decl (si.item ()); + be_field *f = dynamic_cast<be_field*> (si.item ()); be_attribute *attr = - be_attribute::narrow_from_decl (si.item ()); + dynamic_cast<be_attribute*> (si.item ()); if (f == 0 || attr != 0) { @@ -252,7 +252,7 @@ be_visitor_valuetype_obv_cs::gen_obv_init_constructor_inits ( // Generate for inherited members first. if (parent != 0) { - be_valuetype *be_parent = be_valuetype::narrow_from_decl (parent); + be_valuetype *be_parent = dynamic_cast<be_valuetype*> (parent); this->gen_obv_init_constructor_inits (be_parent); } @@ -262,9 +262,9 @@ be_visitor_valuetype_obv_cs::gen_obv_init_constructor_inits ( { // be_attribute inherits from be_field // so we have to also screen out attributes - be_field *f = be_field::narrow_from_decl (si.item ()); + be_field *f = dynamic_cast<be_field*> (si.item ()); be_attribute *attr = - be_attribute::narrow_from_decl (si.item ()); + dynamic_cast<be_attribute*> (si.item ()); if (f == 0 || attr != 0) { @@ -290,7 +290,7 @@ be_visitor_valuetype_obv_cs::gen_obv_call_base_constructor_args ( if (parent != 0) { be_valuetype *be_parent = - be_valuetype::narrow_from_decl (parent); + dynamic_cast<be_valuetype*> (parent); this->gen_obv_call_base_constructor_args (be_parent, index); } @@ -301,8 +301,8 @@ be_visitor_valuetype_obv_cs::gen_obv_call_base_constructor_args ( { // be_attribute inherits from be_field // so we have to also screen out attributes - be_field *f = be_field::narrow_from_decl (si.item ()); - if (f && !be_attribute::narrow_from_decl (si.item ())) + be_field *f = dynamic_cast<be_field*> (si.item ()); + if (f && !dynamic_cast<be_attribute*> (si.item ())) { if (index++) // comma before 2nd onwards *os << ","; @@ -311,10 +311,10 @@ be_visitor_valuetype_obv_cs::gen_obv_call_base_constructor_args ( *os << be_nl; // Check the member type for nested valuetypes - be_type *t = be_type::narrow_from_decl (f->field_type ()); - if (be_valuetype_fwd::narrow_from_decl (t) || - be_valuetype::narrow_from_decl (t) || - be_valuebox::narrow_from_decl (t) ) + be_type *t = dynamic_cast<be_type*> (f->field_type ()); + if (dynamic_cast<be_valuetype_fwd*> (t) || + dynamic_cast<be_valuetype*> (t) || + dynamic_cast<be_valuebox*> (t) ) { // Nested valuetypes/boxes need to be deep copied also *os << "(" << f->local_name () << " () ?" << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp index 9f83d277dfb..bbfe3041e28 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp @@ -102,7 +102,7 @@ be_visitor_valuetype_ss::visit_valuetype (be_valuetype *node) } else { - be_interface *bd = be_interface::narrow_from_decl (concrete); + be_interface *bd = dynamic_cast<be_interface*> (concrete); *os << bd->full_skel_name () << " (rhs)," << be_nl; } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp index 711bc47368e..e6f07f9dc13 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp @@ -59,7 +59,7 @@ be_visitor_valuetype_fwd_any_op_ch::visit_valuetype_fwd ( if (node->is_nested () && node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - module = be_module::narrow_from_scope (node->defined_in ()); + module = dynamic_cast<be_module*> (node->defined_in ()); if (!module) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp index 6ff9d6fd264..afff31f7271 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp @@ -29,7 +29,7 @@ be_visitor_valuetype_fwd_cdr_op_ch::visit_valuetype_fwd ( ) { AST_Interface *fd = node->full_definition (); - be_valuetype *bfd = be_valuetype::narrow_from_decl (fd); + be_valuetype *bfd = dynamic_cast<be_valuetype*> (fd); // If this forward declared vt is defined later in the file, // the CDR operator declaration (along with the corresponding @@ -49,7 +49,7 @@ be_visitor_valuetype_fwd_cdr_op_ch::visit_valuetype_fwd ( TAO_OutStream *os = this->ctx_->stream (); be_valuetype *fvd = - be_valuetype::narrow_from_decl (node->full_definition ()); + dynamic_cast<be_valuetype*> (node->full_definition ()); if (fvd->gen_helper_header () == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp index 620c1b4ca0e..09efe77af8e 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp @@ -32,7 +32,7 @@ be_visitor_valuetype_fwd_ch::visit_valuetype_fwd (be_valuetype_fwd *node) } AST_Interface *fd = node->full_definition (); - be_valuetype *bfd = be_valuetype::narrow_from_decl (fd); + be_valuetype *bfd = dynamic_cast<be_valuetype*> (fd); // This will be a no-op if it has already been done for this node. bfd->gen_var_out_seq_decls (); 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 27e2839c71b..10e49e6f12a 100644 --- a/TAO/TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_xplicit_pre_proc.cpp @@ -69,7 +69,7 @@ be_visitor_xplicit_pre_proc::visit_home (be_home *node) // for a minute so the correct repo id can be calculated at // interface construction time. AST_Module *m = - AST_Module::narrow_from_scope (node->defined_in ()); + dynamic_cast<AST_Module*> (node->defined_in ()); idl_global->scopes ().push (m); @@ -176,7 +176,7 @@ be_visitor_xplicit_pre_proc::visit_argument (be_argument *node) this->ref_type_ = true; be_type *ft = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); if (ft->accept (this) != 0) { @@ -190,7 +190,7 @@ be_visitor_xplicit_pre_proc::visit_argument (be_argument *node) this->ref_type_ = false; AST_Type *arg_type = - AST_Type::narrow_from_decl (this->type_holder_); + dynamic_cast<AST_Type*> (this->type_holder_); be_argument *added_arg = 0; ACE_NEW_RETURN (added_arg, @@ -210,7 +210,7 @@ be_visitor_xplicit_pre_proc::visit_factory (be_factory *node) UTL_ScopedName sn (node->local_name (), 0); AST_Home *f_home = - AST_Home::narrow_from_scope (node->defined_in ()); + dynamic_cast<AST_Home*> (node->defined_in ()); be_operation *added_factory = 0; ACE_NEW_RETURN (added_factory, @@ -244,7 +244,7 @@ be_visitor_xplicit_pre_proc::visit_finder (be_finder *node) UTL_ScopedName sn (node->local_name (), 0); AST_Home *f_home = - AST_Home::narrow_from_scope (node->defined_in ()); + dynamic_cast<AST_Home*> (node->defined_in ()); be_operation *added_finder = 0; ACE_NEW_RETURN (added_finder, @@ -439,7 +439,7 @@ 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 ()); + dynamic_cast<be_type*> (node->field_type ()); if (ft->accept (this) != 0) { @@ -454,7 +454,7 @@ be_visitor_xplicit_pre_proc::visit_field (be_field *node) UTL_ScopedName sn (node->local_name (), 0); AST_Type *field_type = - AST_Type::narrow_from_decl (this->type_holder_); + dynamic_cast<AST_Type*> (this->type_holder_); be_field *added_field = 0; ACE_NEW_RETURN (added_field, @@ -472,7 +472,7 @@ int be_visitor_xplicit_pre_proc::visit_attribute (be_attribute *node) { be_type *ft = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); this->ref_type_ = true; @@ -488,7 +488,7 @@ be_visitor_xplicit_pre_proc::visit_attribute (be_attribute *node) this->ref_type_ = false; AST_Type *attr_type = - AST_Type::narrow_from_decl (this->type_holder_); + dynamic_cast<AST_Type*> (this->type_holder_); UTL_ScopedName sn (node->local_name (), 0); @@ -516,7 +516,7 @@ be_visitor_xplicit_pre_proc::visit_union (be_union *node) } be_type *ud = - be_type::narrow_from_decl (node->disc_type ()); + dynamic_cast<be_type*> (node->disc_type ()); this->ref_type_ = true; @@ -532,7 +532,7 @@ be_visitor_xplicit_pre_proc::visit_union (be_union *node) this->ref_type_ = false; AST_ConcreteType *disc = - AST_ConcreteType::narrow_from_decl (this->type_holder_); + dynamic_cast<AST_ConcreteType*> (this->type_holder_); UTL_ScopedName sn (node->local_name (), 0); @@ -590,7 +590,7 @@ be_visitor_xplicit_pre_proc::visit_union_branch ( be_union_branch *node) { be_type *ft = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); this->ref_type_ = true; @@ -606,7 +606,7 @@ be_visitor_xplicit_pre_proc::visit_union_branch ( this->ref_type_ = false; AST_Type *bt = - AST_Type::narrow_from_decl (this->type_holder_); + dynamic_cast<AST_Type*> (this->type_holder_); UTL_ScopedName sn (node->local_name (), 0); @@ -622,7 +622,7 @@ be_visitor_xplicit_pre_proc::visit_union_branch ( // add_to_scope() so we need to reuse it. be_union *u = - be_union::narrow_from_scope (idl_global->scopes ().top ()); + dynamic_cast<be_union*> (idl_global->scopes ().top ()); u->be_add_union_branch (added_branch); @@ -690,7 +690,7 @@ int be_visitor_xplicit_pre_proc::visit_array (be_array *node) { be_type *bt = - be_type::narrow_from_decl (node->base_type ()); + dynamic_cast<be_type*> (node->base_type ()); bool tmp = this->ref_type_; this->ref_type_ = true; @@ -753,7 +753,7 @@ be_visitor_xplicit_pre_proc::visit_array (be_array *node) } AST_Type *base_type = - AST_Type::narrow_from_decl (this->type_holder_); + dynamic_cast<AST_Type*> (this->type_holder_); added_array->set_base_type (base_type); @@ -766,7 +766,7 @@ int be_visitor_xplicit_pre_proc::visit_sequence (be_sequence *node) { be_type *bt = - be_type::narrow_from_decl (node->base_type ()); + dynamic_cast<be_type*> (node->base_type ()); bool tmp = this->ref_type_; this->ref_type_ = true; @@ -794,7 +794,7 @@ be_visitor_xplicit_pre_proc::visit_sequence (be_sequence *node) UTL_ScopedName sn (&id, 0); AST_Type *ft = - AST_Type::narrow_from_decl (this->type_holder_); + dynamic_cast<AST_Type*> (this->type_holder_); ACE_NEW_RETURN (this->type_holder_, be_sequence (bound, @@ -856,7 +856,7 @@ be_visitor_xplicit_pre_proc::visit_typedef (be_typedef *node) } be_type *t = - be_type::narrow_from_decl (node->field_type ()); + dynamic_cast<be_type*> (node->field_type ()); this->ref_type_ = true; @@ -873,7 +873,7 @@ be_visitor_xplicit_pre_proc::visit_typedef (be_typedef *node) UTL_ScopedName sn (node->local_name (), 0); AST_Type *bt = - AST_Type::narrow_from_decl (this->type_holder_); + dynamic_cast<AST_Type*> (this->type_holder_); be_typedef *added_typedef = 0; ACE_NEW_RETURN (added_typedef, @@ -957,7 +957,7 @@ be_visitor_xplicit_pre_proc::xplicit_iface_rel_name (AST_Decl *d) while (tmp != 0) { - if (be_home::narrow_from_decl (tmp) != 0) + if (dynamic_cast<be_home*> (tmp) != 0) { ACE_CString head (tmp->local_name ()->get_string ()); diff --git a/TAO/TAO_IDL/be_include/be_argument.h b/TAO/TAO_IDL/be_include/be_argument.h index 1afc70b06a1..d51ffece6c6 100644 --- a/TAO/TAO_IDL/be_include/be_argument.h +++ b/TAO/TAO_IDL/be_include/be_argument.h @@ -33,9 +33,6 @@ public: // Cleanup. virtual void destroy (void); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_argument); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_array.h b/TAO/TAO_IDL/be_include/be_array.h index 1d7e9dc6405..75082a5c844 100644 --- a/TAO/TAO_IDL/be_include/be_array.h +++ b/TAO/TAO_IDL/be_include/be_array.h @@ -52,10 +52,6 @@ public: // Cleanup. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (be_array); - protected: /// Create a name for us. virtual int create_name (void); diff --git a/TAO/TAO_IDL/be_include/be_attribute.h b/TAO/TAO_IDL/be_include/be_attribute.h index 25398533978..fbbcae1ad5a 100644 --- a/TAO/TAO_IDL/be_include/be_attribute.h +++ b/TAO/TAO_IDL/be_include/be_attribute.h @@ -46,10 +46,6 @@ public: /// Returns the original attribute from which this one was created, /// applies only to implied IDL be_attribute *original_attribute (); - - // Narrowing - - DEF_NARROW_FROM_DECL (be_attribute); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_component.h b/TAO/TAO_IDL/be_include/be_component.h index 8871023c2da..94e7ec69dac 100644 --- a/TAO/TAO_IDL/be_include/be_component.h +++ b/TAO/TAO_IDL/be_include/be_component.h @@ -74,11 +74,6 @@ public: /// Generate the string compares for ancestors in _is_a(). virtual int gen_is_a_ancestors (TAO_OutStream *os); - // Narrowing. - - DEF_NARROW_FROM_DECL (be_component); - DEF_NARROW_FROM_SCOPE (be_component); - private: /// Specialized version for mirror ports. void mirror_scan (AST_PortType *p); diff --git a/TAO/TAO_IDL/be_include/be_component_fwd.h b/TAO/TAO_IDL/be_include/be_component_fwd.h index 828b6df2efc..7ba68aee0ae 100644 --- a/TAO/TAO_IDL/be_include/be_component_fwd.h +++ b/TAO/TAO_IDL/be_include/be_component_fwd.h @@ -36,10 +36,6 @@ public: // Visiting. virtual int accept (be_visitor* visitor); - - // Narrowing. - - DEF_NARROW_FROM_DECL (be_component_fwd); }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_connector.h b/TAO/TAO_IDL/be_include/be_connector.h index 07c0370cf72..00d945e6708 100644 --- a/TAO/TAO_IDL/be_include/be_connector.h +++ b/TAO/TAO_IDL/be_include/be_connector.h @@ -18,10 +18,6 @@ public: /// Cleanup function. virtual void destroy (void); - // Narrowing. - DEF_NARROW_FROM_DECL (be_connector); - DEF_NARROW_FROM_SCOPE (be_connector); - /// Visiting. virtual int accept (be_visitor *visitor); diff --git a/TAO/TAO_IDL/be_include/be_constant.h b/TAO/TAO_IDL/be_include/be_constant.h index 7fb2681e0f8..6b460d8289e 100644 --- a/TAO/TAO_IDL/be_include/be_constant.h +++ b/TAO/TAO_IDL/be_include/be_constant.h @@ -33,9 +33,6 @@ public: //Cleanup. virtual void destroy (void); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_constant); }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_consumes.h b/TAO/TAO_IDL/be_include/be_consumes.h index 40b7fbfe713..a71dd3ea407 100644 --- a/TAO/TAO_IDL/be_include/be_consumes.h +++ b/TAO/TAO_IDL/be_include/be_consumes.h @@ -21,9 +21,6 @@ public: // Non-virtual override of frontend method. be_eventtype *consumes_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL (be_consumes); - // Visiting. virtual int accept (be_visitor *visitor); diff --git a/TAO/TAO_IDL/be_include/be_decl.h b/TAO/TAO_IDL/be_include/be_decl.h index dce208816c2..abf5b388052 100644 --- a/TAO/TAO_IDL/be_include/be_decl.h +++ b/TAO/TAO_IDL/be_include/be_decl.h @@ -157,10 +157,6 @@ public: void exec_src_facet_gen (bool); void ami4ccm_ex_idl_gen (bool); - // Narrowing - - DEF_NARROW_FROM_DECL (be_decl); - private: // Variables that indicate if the code generation for that node is already // been done. This way we avoid regenerating same code. diff --git a/TAO/TAO_IDL/be_include/be_emits.h b/TAO/TAO_IDL/be_include/be_emits.h index 96970a433b9..2faf72315b8 100644 --- a/TAO/TAO_IDL/be_include/be_emits.h +++ b/TAO/TAO_IDL/be_include/be_emits.h @@ -21,9 +21,6 @@ public: // Non-virtual override of frontend method. be_eventtype *emits_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL (be_emits); - // Visiting. virtual int accept (be_visitor *visitor); diff --git a/TAO/TAO_IDL/be_include/be_enum.h b/TAO/TAO_IDL/be_include/be_enum.h index 6d78edbb639..0631f7d88d5 100644 --- a/TAO/TAO_IDL/be_include/be_enum.h +++ b/TAO/TAO_IDL/be_include/be_enum.h @@ -39,10 +39,6 @@ public: // Visiting. virtual int accept (be_visitor *visitor); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_enum); - DEF_NARROW_FROM_SCOPE (be_enum); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_enum_val.h b/TAO/TAO_IDL/be_include/be_enum_val.h index 4dfc0305cc1..82c194333a1 100644 --- a/TAO/TAO_IDL/be_include/be_enum_val.h +++ b/TAO/TAO_IDL/be_include/be_enum_val.h @@ -32,9 +32,6 @@ public: //Cleanup. virtual void destroy (void); - - // Narrowing - DEF_NARROW_FROM_DECL (be_enum_val); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_eventtype.h b/TAO/TAO_IDL/be_include/be_eventtype.h index 333f0571ed8..a8817c1ee3b 100644 --- a/TAO/TAO_IDL/be_include/be_eventtype.h +++ b/TAO/TAO_IDL/be_include/be_eventtype.h @@ -44,10 +44,6 @@ public: // Cleanup. virtual void destroy (void); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_eventtype); - DEF_NARROW_FROM_SCOPE (be_eventtype); }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_eventtype_fwd.h b/TAO/TAO_IDL/be_include/be_eventtype_fwd.h index 89b994ffa1b..f56dd68a3f9 100644 --- a/TAO/TAO_IDL/be_include/be_eventtype_fwd.h +++ b/TAO/TAO_IDL/be_include/be_eventtype_fwd.h @@ -36,9 +36,6 @@ public: // Cleanup virtual void destroy (void); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_eventtype_fwd); }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_exception.h b/TAO/TAO_IDL/be_include/be_exception.h index 23b831d80b1..47a829b15ee 100644 --- a/TAO/TAO_IDL/be_include/be_exception.h +++ b/TAO/TAO_IDL/be_include/be_exception.h @@ -20,10 +20,6 @@ public: // Visiting. virtual int accept (be_visitor *visitor); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_exception); - DEF_NARROW_FROM_SCOPE (be_exception); }; #endif // end of if !defined (...) diff --git a/TAO/TAO_IDL/be_include/be_extended_port.h b/TAO/TAO_IDL/be_include/be_extended_port.h index ba6af7aa6c5..bb918ad5855 100644 --- a/TAO/TAO_IDL/be_include/be_extended_port.h +++ b/TAO/TAO_IDL/be_include/be_extended_port.h @@ -39,8 +39,6 @@ public: virtual void destroy (void); virtual int accept (be_visitor *visitor); - - DEF_NARROW_FROM_DECL (be_extended_port); }; #endif // BE_EXTENDED_PORT_H diff --git a/TAO/TAO_IDL/be_include/be_factory.h b/TAO/TAO_IDL/be_include/be_factory.h index 97b8fdabec2..fcea3e23ecc 100644 --- a/TAO/TAO_IDL/be_include/be_factory.h +++ b/TAO/TAO_IDL/be_include/be_factory.h @@ -40,10 +40,6 @@ public: // Add an argument to the scope. virtual AST_Argument *be_add_argument (AST_Argument *arg); - - // Narrowing - DEF_NARROW_FROM_DECL (be_factory); - DEF_NARROW_FROM_SCOPE (be_factory); }; #endif // BE_FACTORY_H diff --git a/TAO/TAO_IDL/be_include/be_field.h b/TAO/TAO_IDL/be_include/be_field.h index 3b860cf7390..523c5db704a 100644 --- a/TAO/TAO_IDL/be_include/be_field.h +++ b/TAO/TAO_IDL/be_include/be_field.h @@ -47,10 +47,6 @@ public: // Cleanup. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (be_field); - private: // If the name of a provides or uses node has already been // prefixed with the (mirror)port name(s), we don't want diff --git a/TAO/TAO_IDL/be_include/be_finder.h b/TAO/TAO_IDL/be_include/be_finder.h index c54090e5e3b..65fc54c8a44 100644 --- a/TAO/TAO_IDL/be_include/be_finder.h +++ b/TAO/TAO_IDL/be_include/be_finder.h @@ -31,10 +31,6 @@ public: // Visiting. virtual int accept (be_visitor *visitor); - - // Narrowing - DEF_NARROW_FROM_DECL (be_finder); - DEF_NARROW_FROM_SCOPE (be_finder); }; #endif // BE_FINDER_H diff --git a/TAO/TAO_IDL/be_include/be_fixed.h b/TAO/TAO_IDL/be_include/be_fixed.h index 7f9936c8b7d..617f5725cb3 100644 --- a/TAO/TAO_IDL/be_include/be_fixed.h +++ b/TAO/TAO_IDL/be_include/be_fixed.h @@ -17,8 +17,6 @@ public: virtual int accept (be_visitor *visitor); virtual void destroy (); - - DEF_NARROW_FROM_DECL (be_fixed); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_home.h b/TAO/TAO_IDL/be_include/be_home.h index 23f86e45805..1161da68920 100644 --- a/TAO/TAO_IDL/be_include/be_home.h +++ b/TAO/TAO_IDL/be_include/be_home.h @@ -44,11 +44,6 @@ public: // Visiting. virtual int accept (be_visitor* visitor); - - // Narrowing. - - DEF_NARROW_FROM_DECL (be_home); - DEF_NARROW_FROM_SCOPE (be_home); }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h index 7edeb963495..999486b78dd 100644 --- a/TAO/TAO_IDL/be_include/be_interface.h +++ b/TAO/TAO_IDL/be_include/be_interface.h @@ -165,11 +165,6 @@ public: // Visiting. virtual int accept (be_visitor *visitor); - // Narrowing. - - DEF_NARROW_FROM_DECL (be_interface); - DEF_NARROW_FROM_SCOPE (be_interface); - /// Helper method passed to the template method that generates code for the /// is_a method. static int is_a_helper (be_interface *, diff --git a/TAO/TAO_IDL/be_include/be_interface_fwd.h b/TAO/TAO_IDL/be_include/be_interface_fwd.h index 912d2868972..683af1090b0 100644 --- a/TAO/TAO_IDL/be_include/be_interface_fwd.h +++ b/TAO/TAO_IDL/be_include/be_interface_fwd.h @@ -45,9 +45,6 @@ public: // Visiting. virtual int accept (be_visitor* visitor); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_interface_fwd); }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_mirror_port.h b/TAO/TAO_IDL/be_include/be_mirror_port.h index 494d1a2676c..1fb3e445b58 100644 --- a/TAO/TAO_IDL/be_include/be_mirror_port.h +++ b/TAO/TAO_IDL/be_include/be_mirror_port.h @@ -36,8 +36,6 @@ public: virtual void destroy (void); virtual int accept (be_visitor *visitor); - - DEF_NARROW_FROM_DECL (be_mirror_port); }; #endif // BE_MIRROR_PORT_H diff --git a/TAO/TAO_IDL/be_include/be_module.h b/TAO/TAO_IDL/be_include/be_module.h index 8eea3b7c2d2..620ffdb5e45 100644 --- a/TAO/TAO_IDL/be_include/be_module.h +++ b/TAO/TAO_IDL/be_include/be_module.h @@ -32,10 +32,6 @@ public: // Visiting virtual int accept (be_visitor *visitor); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_module); - DEF_NARROW_FROM_SCOPE (be_module); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_native.h b/TAO/TAO_IDL/be_include/be_native.h index a39e6238858..341e7eccb4a 100644 --- a/TAO/TAO_IDL/be_include/be_native.h +++ b/TAO/TAO_IDL/be_include/be_native.h @@ -43,9 +43,6 @@ public: // Visiting. virtual int accept (be_visitor *visitor); - - // Narrowing. - DEF_NARROW_FROM_DECL(be_native); }; #endif /* BE_NATIVE_H */ diff --git a/TAO/TAO_IDL/be_include/be_operation.h b/TAO/TAO_IDL/be_include/be_operation.h index 9e0481f35a0..8e08f3350df 100644 --- a/TAO/TAO_IDL/be_include/be_operation.h +++ b/TAO/TAO_IDL/be_include/be_operation.h @@ -58,10 +58,6 @@ public: bool is_attr_op (void) const; void is_attr_op (bool val); - // Narrowing - DEF_NARROW_FROM_DECL (be_operation); - DEF_NARROW_FROM_SCOPE (be_operation); - protected: bool is_sendc_ami_; bool is_excep_ami_; diff --git a/TAO/TAO_IDL/be_include/be_param_holder.h b/TAO/TAO_IDL/be_include/be_param_holder.h index a0817afce82..64a39d8f9ff 100644 --- a/TAO/TAO_IDL/be_include/be_param_holder.h +++ b/TAO/TAO_IDL/be_include/be_param_holder.h @@ -28,9 +28,6 @@ public: virtual ~be_param_holder (void); - // Narrowing. - DEF_NARROW_FROM_DECL (be_param_holder); - // Cleanup function. virtual void destroy (void); diff --git a/TAO/TAO_IDL/be_include/be_porttype.h b/TAO/TAO_IDL/be_include/be_porttype.h index c0a80088b0e..c6a9b607a04 100644 --- a/TAO/TAO_IDL/be_include/be_porttype.h +++ b/TAO/TAO_IDL/be_include/be_porttype.h @@ -36,9 +36,6 @@ public: virtual void destroy (void); virtual int accept (be_visitor *visitor); - - DEF_NARROW_FROM_DECL (be_porttype); - DEF_NARROW_FROM_SCOPE (be_porttype); }; #endif // BE_PORTTYPE_H diff --git a/TAO/TAO_IDL/be_include/be_predefined_type.h b/TAO/TAO_IDL/be_include/be_predefined_type.h index 4695502db95..13dc307c4f5 100644 --- a/TAO/TAO_IDL/be_include/be_predefined_type.h +++ b/TAO/TAO_IDL/be_include/be_predefined_type.h @@ -39,9 +39,6 @@ public: // Cleanup. virtual void destroy (void); - // Narrowing. - DEF_NARROW_FROM_DECL (be_predefined_type); - protected: /// Overridden method. virtual void compute_tc_name (void); diff --git a/TAO/TAO_IDL/be_include/be_provides.h b/TAO/TAO_IDL/be_include/be_provides.h index cb47d6c2d07..085659a1a5c 100644 --- a/TAO/TAO_IDL/be_include/be_provides.h +++ b/TAO/TAO_IDL/be_include/be_provides.h @@ -22,9 +22,6 @@ public: // Non-virtual override of frontend method. be_type *provides_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(be_provides); - // Visiting. virtual int accept (be_visitor *visitor); diff --git a/TAO/TAO_IDL/be_include/be_publishes.h b/TAO/TAO_IDL/be_include/be_publishes.h index ea3a41bff47..56082dbb30b 100644 --- a/TAO/TAO_IDL/be_include/be_publishes.h +++ b/TAO/TAO_IDL/be_include/be_publishes.h @@ -21,9 +21,6 @@ public: // Non-virtual override of frontend method. be_eventtype *publishes_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(be_publishes); - // Visiting. virtual int accept (be_visitor *visitor); diff --git a/TAO/TAO_IDL/be_include/be_root.h b/TAO/TAO_IDL/be_include/be_root.h index d3ad85aaf57..67e6e22076f 100644 --- a/TAO/TAO_IDL/be_include/be_root.h +++ b/TAO/TAO_IDL/be_include/be_root.h @@ -35,10 +35,6 @@ public: // Visiting. virtual int accept (be_visitor *visitor); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_root); - DEF_NARROW_FROM_SCOPE (be_root); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_scope.h b/TAO/TAO_IDL/be_include/be_scope.h index bbec9484162..db945b89d05 100644 --- a/TAO/TAO_IDL/be_include/be_scope.h +++ b/TAO/TAO_IDL/be_include/be_scope.h @@ -62,9 +62,6 @@ public: /// Visiting. virtual int accept (be_visitor *visitor); - // Narrowing. - DEF_NARROW_FROM_SCOPE (be_scope); - private: /// If set, generate a comma after every element is handled. unsigned short comma_; diff --git a/TAO/TAO_IDL/be_include/be_sequence.h b/TAO/TAO_IDL/be_include/be_sequence.h index dcedb4e4155..d7ccb6bd417 100644 --- a/TAO/TAO_IDL/be_include/be_sequence.h +++ b/TAO/TAO_IDL/be_include/be_sequence.h @@ -79,10 +79,6 @@ public: // Visiting. virtual int accept (be_visitor *visitor); - // Narrowing. - - DEF_NARROW_FROM_DECL (be_sequence); - /// Report the instance name for instantiation. const char *instance_name (void); diff --git a/TAO/TAO_IDL/be_include/be_string.h b/TAO/TAO_IDL/be_include/be_string.h index 96db83599b7..828482b47cc 100644 --- a/TAO/TAO_IDL/be_include/be_string.h +++ b/TAO/TAO_IDL/be_include/be_string.h @@ -41,10 +41,6 @@ public: // Cleanup. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (be_string); - protected: /// Overridden method to compute typecode name. virtual void compute_tc_name (void); diff --git a/TAO/TAO_IDL/be_include/be_structure.h b/TAO/TAO_IDL/be_include/be_structure.h index e46236e9b36..fafbbc102d9 100644 --- a/TAO/TAO_IDL/be_include/be_structure.h +++ b/TAO/TAO_IDL/be_include/be_structure.h @@ -48,11 +48,6 @@ public: /// Visiting. virtual int accept (be_visitor *visitor); - - // Narrowing. - - DEF_NARROW_FROM_DECL (be_structure); - DEF_NARROW_FROM_SCOPE (be_structure); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_structure_fwd.h b/TAO/TAO_IDL/be_include/be_structure_fwd.h index 528e6fae368..1660b62f4da 100644 --- a/TAO/TAO_IDL/be_include/be_structure_fwd.h +++ b/TAO/TAO_IDL/be_include/be_structure_fwd.h @@ -39,9 +39,6 @@ public: // Visiting. virtual int accept (be_visitor* visitor); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_structure_fwd); }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_template_module.h b/TAO/TAO_IDL/be_include/be_template_module.h index d797cd62c7b..266fa5e8054 100644 --- a/TAO/TAO_IDL/be_include/be_template_module.h +++ b/TAO/TAO_IDL/be_include/be_template_module.h @@ -37,9 +37,6 @@ public: virtual void destroy (void); virtual int accept (be_visitor *visitor); - - DEF_NARROW_FROM_DECL (be_template_module); - DEF_NARROW_FROM_SCOPE (be_template_module); }; #endif /* TAO_BE_TEMPLATE_MODULE_H */ diff --git a/TAO/TAO_IDL/be_include/be_template_module_inst.h b/TAO/TAO_IDL/be_include/be_template_module_inst.h index d798651700c..688eeb9f6b4 100644 --- a/TAO/TAO_IDL/be_include/be_template_module_inst.h +++ b/TAO/TAO_IDL/be_include/be_template_module_inst.h @@ -16,9 +16,6 @@ public: virtual ~be_template_module_inst (void); - // Narrowing. - DEF_NARROW_FROM_DECL (be_template_module_inst); - // Cleanup function. virtual void destroy (void); diff --git a/TAO/TAO_IDL/be_include/be_template_module_ref.h b/TAO/TAO_IDL/be_include/be_template_module_ref.h index 7046a7082fc..0c7ca861f38 100644 --- a/TAO/TAO_IDL/be_include/be_template_module_ref.h +++ b/TAO/TAO_IDL/be_include/be_template_module_ref.h @@ -17,9 +17,6 @@ public: virtual ~be_template_module_ref (void); - // Narrowing. - DEF_NARROW_FROM_DECL (be_template_module_ref); - // Cleanup function. virtual void destroy (void); diff --git a/TAO/TAO_IDL/be_include/be_type.h b/TAO/TAO_IDL/be_include/be_type.h index 6039fe8f359..66fedcba55d 100644 --- a/TAO/TAO_IDL/be_include/be_type.h +++ b/TAO/TAO_IDL/be_include/be_type.h @@ -88,10 +88,6 @@ public: // Visiting. virtual int accept (be_visitor* visitor); - // Narrowing. - - DEF_NARROW_FROM_DECL (be_type); - protected: /// Computes the fully scoped typecode name. virtual void compute_tc_name (void); diff --git a/TAO/TAO_IDL/be_include/be_typedef.h b/TAO/TAO_IDL/be_include/be_typedef.h index dc5de3bc184..d05f7707a36 100644 --- a/TAO/TAO_IDL/be_include/be_typedef.h +++ b/TAO/TAO_IDL/be_include/be_typedef.h @@ -53,10 +53,6 @@ public: // Visiting. virtual int accept (be_visitor *visitor); - - // Narrowing. - - DEF_NARROW_FROM_DECL (be_typedef); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_union.h b/TAO/TAO_IDL/be_include/be_union.h index 18cc6818480..92083e831d4 100644 --- a/TAO/TAO_IDL/be_include/be_union.h +++ b/TAO/TAO_IDL/be_include/be_union.h @@ -57,11 +57,6 @@ public: /// Returns total number of labels, useful when the union has /// multiple case labels. ACE_UINT64 nlabels (void); - - // Narrowing. - - DEF_NARROW_FROM_DECL(be_union); - DEF_NARROW_FROM_SCOPE(be_union); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_union_branch.h b/TAO/TAO_IDL/be_include/be_union_branch.h index 1eb44df7c8b..9c61769b2bd 100644 --- a/TAO/TAO_IDL/be_include/be_union_branch.h +++ b/TAO/TAO_IDL/be_include/be_union_branch.h @@ -44,9 +44,6 @@ public: // Cleanup. virtual void destroy (void); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_union_branch); }; #endif diff --git a/TAO/TAO_IDL/be_include/be_union_fwd.h b/TAO/TAO_IDL/be_include/be_union_fwd.h index 4ca5bc30936..b9e9c73f542 100644 --- a/TAO/TAO_IDL/be_include/be_union_fwd.h +++ b/TAO/TAO_IDL/be_include/be_union_fwd.h @@ -38,9 +38,6 @@ public: // Visiting. virtual int accept (be_visitor* visitor); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_union_fwd); }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_uses.h b/TAO/TAO_IDL/be_include/be_uses.h index 8384db531dd..80cf76f975a 100644 --- a/TAO/TAO_IDL/be_include/be_uses.h +++ b/TAO/TAO_IDL/be_include/be_uses.h @@ -22,9 +22,6 @@ public: // Non-virtual override of frontend method. be_type *uses_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(be_uses); - // Visiting. virtual int accept (be_visitor *visitor); diff --git a/TAO/TAO_IDL/be_include/be_valuebox.h b/TAO/TAO_IDL/be_include/be_valuebox.h index edad870149e..6a1e4292f48 100644 --- a/TAO/TAO_IDL/be_include/be_valuebox.h +++ b/TAO/TAO_IDL/be_include/be_valuebox.h @@ -31,9 +31,6 @@ public: // Cleanup. virtual void destroy (void); - - // Narrowing - DEF_NARROW_FROM_DECL (be_valuebox); }; #endif /* TAO_BE_VALUEBOX_H */ diff --git a/TAO/TAO_IDL/be_include/be_valuetype.h b/TAO/TAO_IDL/be_include/be_valuetype.h index ce0db7969b1..5dc0e9e5e47 100644 --- a/TAO/TAO_IDL/be_include/be_valuetype.h +++ b/TAO/TAO_IDL/be_include/be_valuetype.h @@ -103,11 +103,6 @@ public: // Cleanup. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (be_valuetype); - DEF_NARROW_FROM_SCOPE (be_valuetype); - /// Compute the fully scoped skel class name. void compute_fullobvskelname (void); diff --git a/TAO/TAO_IDL/be_include/be_valuetype_fwd.h b/TAO/TAO_IDL/be_include/be_valuetype_fwd.h index 355b0998f29..b72174d3a4e 100644 --- a/TAO/TAO_IDL/be_include/be_valuetype_fwd.h +++ b/TAO/TAO_IDL/be_include/be_valuetype_fwd.h @@ -38,9 +38,6 @@ public: // Cleanup virtual void destroy (void); - - // Narrowing. - DEF_NARROW_FROM_DECL (be_valuetype_fwd); }; #endif // if !defined diff --git a/TAO/TAO_IDL/fe/fe_component_header.cpp b/TAO/TAO_IDL/fe/fe_component_header.cpp index 0fc0f6e1355..bf9a73f838e 100644 --- a/TAO/TAO_IDL/fe/fe_component_header.cpp +++ b/TAO/TAO_IDL/fe/fe_component_header.cpp @@ -85,10 +85,10 @@ FE_ComponentHeader::compile_inheritance (UTL_ScopedName *base_component) if (d->node_type () == AST_Decl::NT_typedef) { - d = AST_Typedef::narrow_from_decl (d)->primitive_base_type (); + d = dynamic_cast<AST_Typedef*> (d)->primitive_base_type (); } - this->base_component_ = AST_Component::narrow_from_decl (d); + this->base_component_ = dynamic_cast<AST_Component*> (d); if (this->base_component_ == 0) { @@ -148,7 +148,7 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports) if (sad->node_type () == AST_Decl::NT_module) { - AST_Module *m = AST_Module::narrow_from_decl (sad); + AST_Module *m = dynamic_cast<AST_Module*> (sad); d = m->look_in_prev_mods_local (item->last_component ()); } @@ -167,15 +167,15 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports) // Remove typedefs, if any. if (d->node_type () == AST_Decl::NT_typedef) { - d = AST_Typedef::narrow_from_decl (d)->primitive_base_type (); + d = dynamic_cast<AST_Typedef*> (d)->primitive_base_type (); } AST_Decl::NodeType nt = d->node_type (); - t = AST_Type::narrow_from_decl (d); + t = dynamic_cast<AST_Type*> (d); if (nt == AST_Decl::NT_interface) { - iface = AST_Interface::narrow_from_decl (d); + iface = dynamic_cast<AST_Interface*> (d); // Undefined interface? if (!iface->is_defined ()) @@ -200,7 +200,7 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports) else if (nt == AST_Decl::NT_param_holder) { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (d); + dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; diff --git a/TAO/TAO_IDL/fe/fe_declarator.cpp b/TAO/TAO_IDL/fe/fe_declarator.cpp index d0de342fbb5..69cb53e8fa1 100644 --- a/TAO/TAO_IDL/fe/fe_declarator.cpp +++ b/TAO/TAO_IDL/fe/fe_declarator.cpp @@ -87,7 +87,7 @@ FE_Declarator::FE_Declarator (UTL_ScopedName *n, AST_Type * FE_Declarator::compose (AST_Decl *d) { - AST_Type *ct = AST_Type::narrow_from_decl (d); + AST_Type *ct = dynamic_cast<AST_Type*> (d); if (ct == 0) { @@ -97,7 +97,7 @@ FE_Declarator::compose (AST_Decl *d) else if (ct->node_type () == AST_Decl::NT_param_holder) { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (ct); + dynamic_cast<AST_Param_Holder*> (ct); // Every other template parameter kind is legal. if (ph->info ()->type_ == AST_Decl::NT_const) @@ -178,7 +178,7 @@ FE_Declarator::compose (AST_Decl *d) if (this->pd_complex_part->node_type () == AST_Decl::NT_array) { - arr = AST_Array::narrow_from_decl (this->pd_complex_part); + arr = dynamic_cast<AST_Array*> (this->pd_complex_part); // The base type of an array isn't set until after the array // has been created, so the check below gets done at this point. diff --git a/TAO/TAO_IDL/fe/fe_home_header.cpp b/TAO/TAO_IDL/fe/fe_home_header.cpp index 2fd9f9a1f3c..d7a3118d20e 100644 --- a/TAO/TAO_IDL/fe/fe_home_header.cpp +++ b/TAO/TAO_IDL/fe/fe_home_header.cpp @@ -73,10 +73,10 @@ FE_HomeHeader::compile_inheritance (UTL_ScopedName *base_home) if (d->node_type () == AST_Decl::NT_typedef) { - d = AST_Typedef::narrow_from_decl (d)->primitive_base_type (); + d = dynamic_cast<AST_Typedef*> (d)->primitive_base_type (); } - this->base_home_ = AST_Home::narrow_from_decl (d); + this->base_home_ = dynamic_cast<AST_Home*> (d); if (this->base_home_ == 0) { @@ -108,10 +108,10 @@ FE_HomeHeader::compile_managed_component ( if (d->node_type () == AST_Decl::NT_typedef) { - d = AST_Typedef::narrow_from_decl (d)->primitive_base_type (); + d = dynamic_cast<AST_Typedef*> (d)->primitive_base_type (); } - this->managed_component_ = AST_Component::narrow_from_decl (d); + this->managed_component_ = dynamic_cast<AST_Component*> (d); if (this->managed_component_ == 0) { @@ -145,10 +145,10 @@ FE_HomeHeader::compile_primary_key (UTL_ScopedName *primary_key) if (nt == AST_Decl::NT_typedef) { - d = AST_Typedef::narrow_from_decl (d)->primitive_base_type (); + d = dynamic_cast<AST_Typedef*> (d)->primitive_base_type (); } - this->primary_key_ = AST_Type::narrow_from_decl (d); + this->primary_key_ = dynamic_cast<AST_Type*> (d); if (this->primary_key_ == 0) { @@ -163,7 +163,7 @@ FE_HomeHeader::compile_primary_key (UTL_ScopedName *primary_key) case AST_Decl::NT_param_holder: { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (d); + dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; diff --git a/TAO/TAO_IDL/fe/fe_init.cpp b/TAO/TAO_IDL/fe/fe_init.cpp index ce7b65beb8b..65425c5402a 100644 --- a/TAO/TAO_IDL/fe/fe_init.cpp +++ b/TAO/TAO_IDL/fe/fe_init.cpp @@ -86,7 +86,7 @@ fe_populate_global_scope (void) AST_PredefinedType *pdt = 0; AST_Root *root = - AST_Root::narrow_from_scope (idl_global->root ()); + dynamic_cast<AST_Root*> (idl_global->root ()); Identifier void_id ("void"); UTL_ScopedName void_name (&void_id, 0); diff --git a/TAO/TAO_IDL/fe/fe_interface_header.cpp b/TAO/TAO_IDL/fe/fe_interface_header.cpp index 95c990a523a..56c426d255e 100644 --- a/TAO/TAO_IDL/fe/fe_interface_header.cpp +++ b/TAO/TAO_IDL/fe/fe_interface_header.cpp @@ -209,7 +209,7 @@ FE_InterfaceHeader::compile_one_inheritance (AST_Type *i) this->add_inheritance (i); AST_Interface *iface = - AST_Interface::narrow_from_decl (i); + dynamic_cast<AST_Interface*> (i); if (iface == 0) { @@ -233,7 +233,7 @@ FE_InterfaceHeader::compile_one_inheritance (AST_Type *i) for (long j = 0; j < num_parents; ++j) { AST_Interface *tmp = - AST_Interface::narrow_from_decl (parents[j]); + dynamic_cast<AST_Interface*> (parents[j]); if (tmp == 0) { @@ -306,7 +306,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, { idl_global->err ()->inheritance_fwd_error ( this->interface_name_, - AST_Interface::narrow_from_decl (d) + dynamic_cast<AST_Interface*> (d) ); break; } @@ -318,7 +318,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, if (sad->node_type () == AST_Decl::NT_module) { - AST_Module *m = AST_Module::narrow_from_decl (sad); + AST_Module *m = dynamic_cast<AST_Module*> (sad); d = m->look_in_prev_mods_local (item->last_component ()); } @@ -339,10 +339,10 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, // Not an appropriate interface? if (nt == AST_Decl::NT_typedef) { - d = AST_Typedef::narrow_from_decl (d)->primitive_base_type (); + d = dynamic_cast<AST_Typedef*> (d)->primitive_base_type (); } - i = AST_Interface::narrow_from_decl (d); + i = dynamic_cast<AST_Interface*> (d); if (i != 0) { @@ -364,7 +364,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, else if (nt == AST_Decl::NT_param_holder) { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (d); + dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; @@ -390,7 +390,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, // OK, see if we have to add this to the list of interfaces // inherited from. this->compile_one_inheritance ( - AST_Type::narrow_from_decl (d)); + dynamic_cast<AST_Type*> (d)); } // OK, install in interface header. @@ -403,7 +403,7 @@ FE_InterfaceHeader::check_inherit (AST_Interface *i, { // We use the narrow instead of node_type() here so we can get a // match with both valuetypes and eventtypes. - bool is_valuetype = (AST_ValueType::narrow_from_decl (i) != 0); + bool is_valuetype = (dynamic_cast<AST_ValueType*> (i) != 0); if ( // Non-local interfaces may not inherit from local ones. @@ -499,12 +499,12 @@ bool FE_InterfaceHeader::already_seen (AST_Type *ip) { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (ip); + dynamic_cast<AST_Param_Holder*> (ip); for (long i = 0; i < this->iused_; ++i) { AST_Param_Holder *tmp = - AST_Param_Holder::narrow_from_decl (this->iseen_[i]); + dynamic_cast<AST_Param_Holder*> (this->iseen_[i]); if (ph != 0 && tmp != 0) { diff --git a/TAO/TAO_IDL/fe/fe_obv_header.cpp b/TAO/TAO_IDL/fe/fe_obv_header.cpp index f0c4644c87a..d63106425f4 100644 --- a/TAO/TAO_IDL/fe/fe_obv_header.cpp +++ b/TAO/TAO_IDL/fe/fe_obv_header.cpp @@ -131,7 +131,7 @@ FE_OBVHeader::compile_inheritance (UTL_NameList *vtypes, if (this->n_inherits_ > 0) { AST_Type *t = this->inherits_[0]; - AST_ValueType *vt = AST_ValueType::narrow_from_decl (t); + AST_ValueType *vt = dynamic_cast<AST_ValueType*> (t); if (vt != 0 && vt->is_abstract () == false) @@ -210,7 +210,7 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports) if (sad->node_type () == AST_Decl::NT_module) { - AST_Module *m = AST_Module::narrow_from_decl (sad); + AST_Module *m = dynamic_cast<AST_Module*> (sad); d = m->look_in_prev_mods_local (item->last_component ()); } @@ -229,20 +229,20 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports) // Remove typedefs, if any. if (d->node_type () == AST_Decl::NT_typedef) { - d = AST_Typedef::narrow_from_decl (d)->primitive_base_type (); + d = dynamic_cast<AST_Typedef*> (d)->primitive_base_type (); } AST_Decl::NodeType nt = d->node_type (); - t = AST_Type::narrow_from_decl (d); + t = dynamic_cast<AST_Type*> (d); if (nt == AST_Decl::NT_interface) { - iface = AST_Interface::narrow_from_decl (d); + iface = dynamic_cast<AST_Interface*> (d); } else if (nt == AST_Decl::NT_param_holder) { AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (d); + dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; @@ -309,7 +309,7 @@ FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d) for (long i = 0; i < this->n_inherits_; ++i) { - vt = AST_ValueType::narrow_from_decl (this->inherits_[i]); + vt = dynamic_cast<AST_ValueType*> (this->inherits_[i]); concrete = vt->supports_concrete (); if (0 == concrete) diff --git a/TAO/TAO_IDL/fe/fe_utils.cpp b/TAO/TAO_IDL/fe/fe_utils.cpp index 7e4ac13855b..32ab27879db 100644 --- a/TAO/TAO_IDL/fe/fe_utils.cpp +++ b/TAO/TAO_IDL/fe/fe_utils.cpp @@ -277,7 +277,7 @@ FE_Utils::create_uses_multiple_stuff (AST_Component *c, UTL_ScopedName *fn = u->uses_type ()->name (); AST_Decl *d = idl_global->root ()->lookup_by_name (fn, true, false); - AST_Type *ft = AST_Type::narrow_from_decl (d); + AST_Type *ft = dynamic_cast<AST_Type*> (d); Identifier object_id ("objref"); UTL_ScopedName object_name (&object_id, @@ -307,7 +307,7 @@ FE_Utils::create_uses_multiple_stuff (AST_Component *c, return; } - AST_ValueType *cookie = AST_ValueType::narrow_from_decl (d); + AST_ValueType *cookie = dynamic_cast<AST_ValueType*> (d); Identifier cookie_id ("ck"); UTL_ScopedName cookie_name (&cookie_id, @@ -387,7 +387,7 @@ FE_Utils::create_implied_ami_uses_stuff (void) delete sn; sn = 0; - AST_Uses *u = AST_Uses::narrow_from_decl (d); + AST_Uses *u = dynamic_cast<AST_Uses*> (d); if (u == 0) { @@ -406,7 +406,7 @@ FE_Utils::create_implied_ami_uses_stuff (void) } AST_Component *c = - AST_Component::narrow_from_scope (u->defined_in ()); + dynamic_cast<AST_Component*> (u->defined_in ()); if (c == 0) { @@ -852,8 +852,8 @@ FE_Utils::can_be_redefined (AST_Decl *prev_decl, } /// Neither can be a template module. - ptm = AST_Template_Module::narrow_from_decl (prev_decl); - ctm = AST_Template_Module::narrow_from_decl (curr_decl); + ptm = dynamic_cast<AST_Template_Module*> (prev_decl); + ctm = dynamic_cast<AST_Template_Module*> (curr_decl); return (ptm == 0 && ctm == 0); /// For the *_fwd types, if scopes aren't related, it's ok. /// If they are related, then we need another fwd or a full decl. @@ -874,7 +874,7 @@ FE_Utils::can_be_redefined (AST_Decl *prev_decl, /// in a derived interface type is ok. case AST_Decl::NT_struct: case AST_Decl::NT_union: - s = AST_Structure::narrow_from_decl (prev_decl); + s = dynamic_cast<AST_Structure*> (prev_decl); s_fwd = (s == 0 ? 0 : s->fwd_decl ()); return (!s_eq || s_fwd != 0); /// Only 2 or more full definitions in the same scope are illegal, @@ -982,7 +982,7 @@ FE_Utils::get_tm_container (AST_Decl *contained) while (d != 0) { AST_Template_Module *tm = - AST_Template_Module::narrow_from_decl (d); + dynamic_cast<AST_Template_Module*> (d); if (tm != 0) { diff --git a/TAO/TAO_IDL/fe/idl.tab.cpp b/TAO/TAO_IDL/fe/idl.tab.cpp index 5fecde985c4..9b4ef38cad2 100644 --- a/TAO/TAO_IDL/fe/idl.tab.cpp +++ b/TAO/TAO_IDL/fe/idl.tab.cpp @@ -3280,7 +3280,7 @@ yyreduce: } AST_Template_Module *ref = - AST_Template_Module::narrow_from_decl (d); + dynamic_cast<AST_Template_Module*> (d); if (ref == 0) { @@ -3381,7 +3381,7 @@ yyreduce: } else { - ref = AST_Template_Module::narrow_from_decl (d); + ref = dynamic_cast<AST_Template_Module*> (d); if (ref == 0) { @@ -3733,7 +3733,7 @@ yyreduce: idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); AST_ValueType *vt = - AST_ValueType::narrow_from_scope ( + dynamic_cast<AST_ValueType*> ( idl_global->scopes ().top_non_null () ); @@ -3776,13 +3776,13 @@ yyreduce: false, false ); - i = AST_Interface::narrow_from_decl (v); + i = dynamic_cast<AST_Interface*> (v); AST_Interface::fwd_redefinition_helper (i, s); /* * Add the valuetype to its definition scope */ - v = AST_ValueType::narrow_from_decl (i); + v = dynamic_cast<AST_ValueType*> (i); (void) s->fe_add_valuetype (v); // FE_OBVHeader is not automatically destroyed in the AST @@ -3994,11 +3994,11 @@ yyreduce: */ AST_Type *tp = 0; AST_Typedef *td - = AST_Typedef::narrow_from_decl ((yyvsp[0].dcval)); + = dynamic_cast<AST_Typedef*> ((yyvsp[0].dcval)); if (td == 0) { - tp = AST_Type::narrow_from_decl ((yyvsp[0].dcval)); + tp = dynamic_cast<AST_Type*> ((yyvsp[0].dcval)); } else { @@ -4690,7 +4690,7 @@ yyreduce: */ while (d->node_type () == AST_Decl::NT_typedef) { - t = AST_Typedef::narrow_from_decl (d); + t = dynamic_cast<AST_Typedef*> (d); if (t == 0) { @@ -4702,7 +4702,7 @@ yyreduce: if (d->node_type () == AST_Decl::NT_pre_defined) { - c = AST_PredefinedType::narrow_from_decl (d); + c = dynamic_cast<AST_PredefinedType*> (d); (yyval.etval) = FE_Utils::PredefinedTypeToExprType (c->pt ()); } @@ -4718,7 +4718,7 @@ yyreduce: { (yyval.etval) = AST_Expression::EV_enum; tao_enum_constant_decl = - AST_Enum::narrow_from_decl (d); + dynamic_cast<AST_Enum*> (d); } else { @@ -5303,7 +5303,7 @@ yyreduce: lookup_by_name (name); if (d) { - decl = AST_Annotation_Decl::narrow_from_decl (d); + decl = dynamic_cast<AST_Annotation_Decl*> (d); if (decl) { idl_global->scopes ().push (decl); @@ -5993,7 +5993,7 @@ yyreduce: /* * Done with this struct. Pop its scope off the scopes stack. */ - (yyval.dcval) = AST_Structure::narrow_from_scope ( + (yyval.dcval) = dynamic_cast<AST_Structure*> ( idl_global->scopes ().top_non_null () ); idl_global->scopes ().pop (); @@ -6154,9 +6154,9 @@ yyreduce: s->is_local (), s->is_abstract ()); - AST_Structure *st = AST_Structure::narrow_from_decl (u); + AST_Structure *st = dynamic_cast<AST_Structure*> (u); AST_Structure::fwd_redefinition_helper (st, s); - u = AST_Union::narrow_from_decl (st); + u = dynamic_cast<AST_Union*> (st); (void) s->fe_add_union (u); } @@ -6203,7 +6203,7 @@ yyreduce: if ((yyvsp[-2].dcval) != 0 && s != 0) { AST_ConcreteType *tp = - AST_ConcreteType::narrow_from_decl ((yyvsp[-2].dcval)); + dynamic_cast<AST_ConcreteType*> ((yyvsp[-2].dcval)); if (tp == 0) { @@ -6219,7 +6219,7 @@ yyreduce: s->is_abstract ()); /* Narrow the enclosing scope. */ - AST_Union *e = AST_Union::narrow_from_scope (top); + AST_Union *e = dynamic_cast<AST_Union*> (top); e->redefine (u); e->disc_annotations (*disc_annotations); // Set Discriminator Annotations @@ -6267,7 +6267,7 @@ yyreduce: /* * Done with this union. Pop its scope from the scopes stack. */ - (yyval.dcval) = AST_Union::narrow_from_scope ( + (yyval.dcval) = dynamic_cast<AST_Union*> ( idl_global->scopes ().top_non_null () ); @@ -6360,7 +6360,7 @@ yyreduce: found = true; break; case AST_Decl::NT_pre_defined: - p = AST_PredefinedType::narrow_from_decl (d); + p = dynamic_cast<AST_PredefinedType*> (d); if (p != 0) { @@ -6400,7 +6400,7 @@ yyreduce: break; case AST_Decl::NT_typedef: - t = AST_Typedef::narrow_from_decl (d); + t = dynamic_cast<AST_Typedef*> (d); if (t != 0) { @@ -6780,7 +6780,7 @@ yyreduce: } else { - (yyval.dcval) = AST_Enum::narrow_from_scope ( + (yyval.dcval) = dynamic_cast<AST_Enum*> ( idl_global->scopes ().top_non_null () ); idl_global->scopes ().pop (); @@ -6816,7 +6816,7 @@ yyreduce: if (s != 0 && s->scope_node_type () == AST_Decl::NT_enum) { - c = AST_Enum::narrow_from_scope (s); + c = dynamic_cast<AST_Enum*> (s); if (c != 0) { @@ -6903,7 +6903,7 @@ yyreduce: } else if (type) { - AST_Type *tp = AST_Type::narrow_from_decl (type); + AST_Type *tp = dynamic_cast<AST_Type*> (type); if (0 == tp) { @@ -6968,7 +6968,7 @@ yyreduce: */ if (type) { - AST_Type *tp = AST_Type::narrow_from_decl (type); + AST_Type *tp = dynamic_cast<AST_Type*> (type); if (tp == 0) { @@ -7090,7 +7090,7 @@ yyreduce: * Add this AST_String to the types defined in the global scope. */ idl_global->root ()->fe_add_string ( - AST_String::narrow_from_decl ( + dynamic_cast<AST_String*> ( tao_string_decl)); idl_global->err ()->anonymous_type_diagnostic (); @@ -7123,7 +7123,7 @@ yyreduce: * Add this AST_String to the types defined in the global scope. */ idl_global->root ()->fe_add_string ( - AST_String::narrow_from_decl ( + dynamic_cast<AST_String*> ( tao_string_decl)); (yyval.dcval) = tao_string_decl; @@ -7178,7 +7178,7 @@ yyreduce: * Add this AST_String to the types defined in the global scope. */ idl_global->root ()->fe_add_string ( - AST_String::narrow_from_decl ( + dynamic_cast<AST_String*> ( string)); idl_global->err ()->anonymous_type_diagnostic (); @@ -7208,7 +7208,7 @@ yyreduce: * Add this AST_String to the types defined in the global scope. */ idl_global->root ()->fe_add_string ( - AST_String::narrow_from_decl ( + dynamic_cast<AST_String*> ( string)); (yyval.dcval) = string; @@ -7676,7 +7676,7 @@ yyreduce: */ if (scope != 0 && type_node != 0) { - AST_Type *type = AST_Type::narrow_from_decl (type_node); + AST_Type *type = dynamic_cast<AST_Type*> (type_node); if (type == 0) { @@ -7747,7 +7747,7 @@ yyreduce: */ if (s != 0 && s->scope_node_type () == AST_Decl::NT_op) { - o = AST_Operation::narrow_from_scope (s); + o = dynamic_cast<AST_Operation*> (s); if ((yyvsp[-2].nlval) != 0 && o != 0) { @@ -7879,7 +7879,7 @@ yyreduce: if ((yyvsp[0].nlval)) { UTL_Scope *s = idl_global->scopes ().top_non_null (); - AST_Factory *f = AST_Factory::narrow_from_scope (s); + AST_Factory *f = dynamic_cast<AST_Factory*> (s); (void) f->fe_add_exceptions ((yyvsp[0].nlval)); } @@ -8117,7 +8117,7 @@ yyreduce: { d->last_referenced_as ((yyvsp[0].idlist)); AST_Decl::NodeType nt = d->node_type (); - AST_Type *t = AST_Type::narrow_from_decl (d); + AST_Type *t = dynamic_cast<AST_Type*> (d); AST_Typedef *td = 0; bool can_be_undefined = false; @@ -8126,14 +8126,14 @@ yyreduce: // This code block ensures that a sequence of // as-yet-undefined struct or union isn't used // as a return type or argument. - td = AST_Typedef::narrow_from_decl (d); + td = dynamic_cast<AST_Typedef*> (d); AST_Type *pbt = td->primitive_base_type (); if (pbt->node_type () == AST_Decl::NT_sequence) { t = pbt; AST_Sequence *seq_type = - AST_Sequence::narrow_from_decl (pbt); + dynamic_cast<AST_Sequence*> (pbt); AST_Type *elem_type = seq_type->base_type (); AST_Decl::NodeType elem_nt = @@ -8142,7 +8142,7 @@ yyreduce: if (elem_nt == AST_Decl::NT_typedef) { AST_Typedef *elem_td = - AST_Typedef::narrow_from_decl (elem_type); + dynamic_cast<AST_Typedef*> (elem_type); elem_type = elem_td->primitive_base_type (); elem_nt = elem_type->node_type (); } @@ -8174,7 +8174,7 @@ yyreduce: // want the full definition, but we need to // check that it's been fully defined. AST_StructureFwd *fwd = - AST_StructureFwd::narrow_from_decl (d); + dynamic_cast<AST_StructureFwd*> (d); if (fwd != 0) { @@ -8825,7 +8825,7 @@ yyreduce: case AST_Decl::NT_interface: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -8866,7 +8866,7 @@ yyreduce: if (so_far_so_good) { AST_Type *port_interface_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ((yyvsp[0].idval)); @@ -8956,7 +8956,7 @@ yyreduce: case AST_Decl::NT_interface: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -8997,7 +8997,7 @@ yyreduce: if (so_far_so_good) { AST_Type *port_interface_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ((yyvsp[0].idval)); @@ -9010,7 +9010,7 @@ yyreduce: s->fe_add_uses (uses); AST_Component *c = - AST_Component::narrow_from_scope (s); + dynamic_cast<AST_Component*> (s); if (c != 0 && uses->is_multiple () @@ -9089,7 +9089,7 @@ yyreduce: case AST_Decl::NT_eventtype: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -9114,7 +9114,7 @@ yyreduce: if (so_far_so_good) { AST_Type *event_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ((yyvsp[0].idval)); @@ -9165,7 +9165,7 @@ yyreduce: case AST_Decl::NT_eventtype: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -9190,7 +9190,7 @@ yyreduce: if (so_far_so_good) { AST_Type *event_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ((yyvsp[0].idval)); @@ -9238,7 +9238,7 @@ yyreduce: case AST_Decl::NT_eventtype: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -9263,7 +9263,7 @@ yyreduce: if (so_far_so_good) { AST_Type *event_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ((yyvsp[0].idval)); @@ -9739,13 +9739,13 @@ yyreduce: false, false ); - i = AST_Interface::narrow_from_decl (e); + i = dynamic_cast<AST_Interface*> (e); AST_Interface::fwd_redefinition_helper (i, s); /* * Add the eventetype to its definition scope */ - e = AST_EventType::narrow_from_decl (i); + e = dynamic_cast<AST_EventType*> (i); (void) s->fe_add_eventtype (e); } @@ -10313,7 +10313,7 @@ yyreduce: } else { - pt = AST_PortType::narrow_from_decl (d); + pt = dynamic_cast<AST_PortType*> (d); if (pt == 0) { @@ -10343,12 +10343,12 @@ yyreduce: { d = i.item (); - AST_Uses *u = AST_Uses::narrow_from_decl (d); + AST_Uses *u = dynamic_cast<AST_Uses*> (d); if (u != 0 && u->is_multiple ()) { AST_Component *c = - AST_Component::narrow_from_scope (s); + dynamic_cast<AST_Component*> (s); FE_Utils::create_uses_multiple_stuff ( c, @@ -10384,7 +10384,7 @@ yyreduce: } else { - pt = AST_PortType::narrow_from_decl (d); + pt = dynamic_cast<AST_PortType*> (d); if (pt == 0) { @@ -10567,7 +10567,7 @@ yyreduce: } parent = - AST_Connector::narrow_from_decl (d); + dynamic_cast<AST_Connector*> (d); if (parent == 0) { diff --git a/TAO/TAO_IDL/fe/idl.ypp b/TAO/TAO_IDL/fe/idl.ypp index a2f6d5ae21b..2f168d1af31 100644 --- a/TAO/TAO_IDL/fe/idl.ypp +++ b/TAO/TAO_IDL/fe/idl.ypp @@ -765,7 +765,7 @@ template_module_ref } AST_Template_Module *ref = - AST_Template_Module::narrow_from_decl (d); + dynamic_cast<AST_Template_Module*> (d); if (ref == 0) { @@ -857,7 +857,7 @@ template_module_inst } else { - ref = AST_Template_Module::narrow_from_decl (d); + ref = dynamic_cast<AST_Template_Module*> (d); if (ref == 0) { @@ -1174,7 +1174,7 @@ value_concrete_decl : idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); AST_ValueType *vt = - AST_ValueType::narrow_from_scope ( + dynamic_cast<AST_ValueType*> ( idl_global->scopes ().top_non_null () ); @@ -1217,13 +1217,13 @@ value_abs_decl : false, false ); - i = AST_Interface::narrow_from_decl (v); + i = dynamic_cast<AST_Interface*> (v); AST_Interface::fwd_redefinition_helper (i, s); /* * Add the valuetype to its definition scope */ - v = AST_ValueType::narrow_from_decl (i); + v = dynamic_cast<AST_ValueType*> (i); (void) s->fe_add_valuetype (v); // FE_OBVHeader is not automatically destroyed in the AST @@ -1401,11 +1401,11 @@ value_box_decl */ AST_Type *tp = 0; AST_Typedef *td - = AST_Typedef::narrow_from_decl ($2); + = dynamic_cast<AST_Typedef*> ($2); if (td == 0) { - tp = AST_Type::narrow_from_decl ($2); + tp = dynamic_cast<AST_Type*> ($2); } else { @@ -1967,7 +1967,7 @@ const_type */ while (d->node_type () == AST_Decl::NT_typedef) { - t = AST_Typedef::narrow_from_decl (d); + t = dynamic_cast<AST_Typedef*> (d); if (t == 0) { @@ -1979,7 +1979,7 @@ const_type if (d->node_type () == AST_Decl::NT_pre_defined) { - c = AST_PredefinedType::narrow_from_decl (d); + c = dynamic_cast<AST_PredefinedType*> (d); $$ = FE_Utils::PredefinedTypeToExprType (c->pt ()); } @@ -1995,7 +1995,7 @@ const_type { $$ = AST_Expression::EV_enum; tao_enum_constant_decl = - AST_Enum::narrow_from_decl (d); + dynamic_cast<AST_Enum*> (d); } else { @@ -2512,7 +2512,7 @@ annotation_appl lookup_by_name (name); if (d) { - decl = AST_Annotation_Decl::narrow_from_decl (d); + decl = dynamic_cast<AST_Annotation_Decl*> (d); if (decl) { idl_global->scopes ().push (decl); @@ -3116,7 +3116,7 @@ struct_type /* * Done with this struct. Pop its scope off the scopes stack. */ - $$ = AST_Structure::narrow_from_scope ( + $$ = dynamic_cast<AST_Structure*> ( idl_global->scopes ().top_non_null () ); idl_global->scopes ().pop (); @@ -3256,9 +3256,9 @@ union_type s->is_local (), s->is_abstract ()); - AST_Structure *st = AST_Structure::narrow_from_decl (u); + AST_Structure *st = dynamic_cast<AST_Structure*> (u); AST_Structure::fwd_redefinition_helper (st, s); - u = AST_Union::narrow_from_decl (st); + u = dynamic_cast<AST_Union*> (st); (void) s->fe_add_union (u); } @@ -3297,7 +3297,7 @@ union_type if ($7 != 0 && s != 0) { AST_ConcreteType *tp = - AST_ConcreteType::narrow_from_decl ($7); + dynamic_cast<AST_ConcreteType*> ($7); if (tp == 0) { @@ -3313,7 +3313,7 @@ union_type s->is_abstract ()); /* Narrow the enclosing scope. */ - AST_Union *e = AST_Union::narrow_from_scope (top); + AST_Union *e = dynamic_cast<AST_Union*> (top); e->redefine (u); e->disc_annotations (*disc_annotations); // Set Discriminator Annotations @@ -3349,7 +3349,7 @@ union_type /* * Done with this union. Pop its scope from the scopes stack. */ - $$ = AST_Union::narrow_from_scope ( + $$ = dynamic_cast<AST_Union*> ( idl_global->scopes ().top_non_null () ); @@ -3426,7 +3426,7 @@ switch_type_spec : found = true; break; case AST_Decl::NT_pre_defined: - p = AST_PredefinedType::narrow_from_decl (d); + p = dynamic_cast<AST_PredefinedType*> (d); if (p != 0) { @@ -3466,7 +3466,7 @@ switch_type_spec : break; case AST_Decl::NT_typedef: - t = AST_Typedef::narrow_from_decl (d); + t = dynamic_cast<AST_Typedef*> (d); if (t != 0) { @@ -3789,7 +3789,7 @@ enum_type : } else { - $$ = AST_Enum::narrow_from_scope ( + $$ = dynamic_cast<AST_Enum*> ( idl_global->scopes ().top_non_null () ); idl_global->scopes ().pop (); @@ -3828,7 +3828,7 @@ enumerator : if (s != 0 && s->scope_node_type () == AST_Decl::NT_enum) { - c = AST_Enum::narrow_from_scope (s); + c = dynamic_cast<AST_Enum*> (s); if (c != 0) { @@ -3907,7 +3907,7 @@ sequence_type_spec } else if (type) { - AST_Type *tp = AST_Type::narrow_from_decl (type); + AST_Type *tp = dynamic_cast<AST_Type*> (type); if (0 == tp) { @@ -3969,7 +3969,7 @@ sequence_type_spec */ if (type) { - AST_Type *tp = AST_Type::narrow_from_decl (type); + AST_Type *tp = dynamic_cast<AST_Type*> (type); if (tp == 0) { @@ -4073,7 +4073,7 @@ string_type_spec * Add this AST_String to the types defined in the global scope. */ idl_global->root ()->fe_add_string ( - AST_String::narrow_from_decl ( + dynamic_cast<AST_String*> ( tao_string_decl)); idl_global->err ()->anonymous_type_diagnostic (); @@ -4102,7 +4102,7 @@ string_type_spec * Add this AST_String to the types defined in the global scope. */ idl_global->root ()->fe_add_string ( - AST_String::narrow_from_decl ( + dynamic_cast<AST_String*> ( tao_string_decl)); $$ = tao_string_decl; @@ -4148,7 +4148,7 @@ wstring_type_spec * Add this AST_String to the types defined in the global scope. */ idl_global->root ()->fe_add_string ( - AST_String::narrow_from_decl ( + dynamic_cast<AST_String*> ( string)); idl_global->err ()->anonymous_type_diagnostic (); @@ -4174,7 +4174,7 @@ wstring_type_spec * Add this AST_String to the types defined in the global scope. */ idl_global->root ()->fe_add_string ( - AST_String::narrow_from_decl ( + dynamic_cast<AST_String*> ( string)); $$ = string; @@ -4570,7 +4570,7 @@ operation */ if (scope != 0 && type_node != 0) { - AST_Type *type = AST_Type::narrow_from_decl (type_node); + AST_Type *type = dynamic_cast<AST_Type*> (type_node); if (type == 0) { @@ -4629,7 +4629,7 @@ operation */ if (s != 0 && s->scope_node_type () == AST_Decl::NT_op) { - o = AST_Operation::narrow_from_scope (s); + o = dynamic_cast<AST_Operation*> (s); if ($8 != 0 && o != 0) { @@ -4739,7 +4739,7 @@ init_decl if ($7) { UTL_Scope *s = idl_global->scopes ().top_non_null (); - AST_Factory *f = AST_Factory::narrow_from_scope (s); + AST_Factory *f = dynamic_cast<AST_Factory*> (s); (void) f->fe_add_exceptions ($7); } @@ -4940,7 +4940,7 @@ param_type_spec { d->last_referenced_as ($1); AST_Decl::NodeType nt = d->node_type (); - AST_Type *t = AST_Type::narrow_from_decl (d); + AST_Type *t = dynamic_cast<AST_Type*> (d); AST_Typedef *td = 0; bool can_be_undefined = false; @@ -4949,14 +4949,14 @@ param_type_spec // This code block ensures that a sequence of // as-yet-undefined struct or union isn't used // as a return type or argument. - td = AST_Typedef::narrow_from_decl (d); + td = dynamic_cast<AST_Typedef*> (d); AST_Type *pbt = td->primitive_base_type (); if (pbt->node_type () == AST_Decl::NT_sequence) { t = pbt; AST_Sequence *seq_type = - AST_Sequence::narrow_from_decl (pbt); + dynamic_cast<AST_Sequence*> (pbt); AST_Type *elem_type = seq_type->base_type (); AST_Decl::NodeType elem_nt = @@ -4965,7 +4965,7 @@ param_type_spec if (elem_nt == AST_Decl::NT_typedef) { AST_Typedef *elem_td = - AST_Typedef::narrow_from_decl (elem_type); + dynamic_cast<AST_Typedef*> (elem_type); elem_type = elem_td->primitive_base_type (); elem_nt = elem_type->node_type (); } @@ -4997,7 +4997,7 @@ param_type_spec // want the full definition, but we need to // check that it's been fully defined. AST_StructureFwd *fwd = - AST_StructureFwd::narrow_from_decl (d); + dynamic_cast<AST_StructureFwd*> (d); if (fwd != 0) { @@ -5501,7 +5501,7 @@ provides_decl : IDL_PROVIDES interface_type id case AST_Decl::NT_interface: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -5542,7 +5542,7 @@ provides_decl : IDL_PROVIDES interface_type id if (so_far_so_good) { AST_Type *port_interface_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ($3); @@ -5625,7 +5625,7 @@ uses_decl : uses_opt_multiple interface_type id case AST_Decl::NT_interface: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -5666,7 +5666,7 @@ uses_decl : uses_opt_multiple interface_type id if (so_far_so_good) { AST_Type *port_interface_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ($3); @@ -5679,7 +5679,7 @@ uses_decl : uses_opt_multiple interface_type id s->fe_add_uses (uses); AST_Component *c = - AST_Component::narrow_from_scope (s); + dynamic_cast<AST_Component*> (s); if (c != 0 && uses->is_multiple () @@ -5751,7 +5751,7 @@ emits_decl case AST_Decl::NT_eventtype: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -5776,7 +5776,7 @@ emits_decl if (so_far_so_good) { AST_Type *event_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ($3); @@ -5826,7 +5826,7 @@ publishes_decl case AST_Decl::NT_eventtype: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -5851,7 +5851,7 @@ publishes_decl if (so_far_so_good) { AST_Type *event_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ($3); @@ -5898,7 +5898,7 @@ consumes_decl case AST_Decl::NT_eventtype: break; case AST_Decl::NT_param_holder: - ph = AST_Param_Holder::narrow_from_decl (d); + ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; if (nt != AST_Decl::NT_type @@ -5923,7 +5923,7 @@ consumes_decl if (so_far_so_good) { AST_Type *event_type = - AST_Type::narrow_from_decl (d); + dynamic_cast<AST_Type*> (d); // Strip off _cxx_, if any, for port name. FE_Utils::original_local_name ($3); @@ -6336,13 +6336,13 @@ event_abs_decl : false, false ); - i = AST_Interface::narrow_from_decl (e); + i = dynamic_cast<AST_Interface*> (e); AST_Interface::fwd_redefinition_helper (i, s); /* * Add the eventetype to its definition scope */ - e = AST_EventType::narrow_from_decl (i); + e = dynamic_cast<AST_EventType*> (i); (void) s->fe_add_eventtype (e); } @@ -6811,7 +6811,7 @@ extended_port_decl } else { - pt = AST_PortType::narrow_from_decl (d); + pt = dynamic_cast<AST_PortType*> (d); if (pt == 0) { @@ -6841,12 +6841,12 @@ extended_port_decl { d = i.item (); - AST_Uses *u = AST_Uses::narrow_from_decl (d); + AST_Uses *u = dynamic_cast<AST_Uses*> (d); if (u != 0 && u->is_multiple ()) { AST_Component *c = - AST_Component::narrow_from_scope (s); + dynamic_cast<AST_Component*> (s); FE_Utils::create_uses_multiple_stuff ( c, @@ -6878,7 +6878,7 @@ extended_port_decl } else { - pt = AST_PortType::narrow_from_decl (d); + pt = dynamic_cast<AST_PortType*> (d); if (pt == 0) { @@ -7044,7 +7044,7 @@ connector_header } parent = - AST_Connector::narrow_from_decl (d); + dynamic_cast<AST_Connector*> (d); if (parent == 0) { diff --git a/TAO/TAO_IDL/include/ast_annotation_appl.h b/TAO/TAO_IDL/include/ast_annotation_appl.h index 85567255021..941a8ab0883 100644 --- a/TAO/TAO_IDL/include/ast_annotation_appl.h +++ b/TAO/TAO_IDL/include/ast_annotation_appl.h @@ -47,12 +47,6 @@ public: virtual ~AST_Annotation_Appl (); - /// Narrowing - ///{ - DEF_NARROW_FROM_DECL (AST_Annotation_Appl); - DEF_NARROW_FROM_SCOPE (AST_Annotation_Appl); - ///} - /// AST Dumping virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_annotation_decl.h b/TAO/TAO_IDL/include/ast_annotation_decl.h index 0ee0fd2eab7..28ae96220e4 100644 --- a/TAO/TAO_IDL/include/ast_annotation_decl.h +++ b/TAO/TAO_IDL/include/ast_annotation_decl.h @@ -18,12 +18,6 @@ public: virtual ~AST_Annotation_Decl (); - /// Narrowing - ///{ - DEF_NARROW_FROM_DECL (AST_Annotation_Decl); - DEF_NARROW_FROM_SCOPE (AST_Annotation_Decl); - ///} - /// AST Dumping virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_annotation_member.h b/TAO/TAO_IDL/include/ast_annotation_member.h index 5686a2f639f..883512bb053 100644 --- a/TAO/TAO_IDL/include/ast_annotation_member.h +++ b/TAO/TAO_IDL/include/ast_annotation_member.h @@ -37,12 +37,6 @@ public: /// Cleanup virtual void destroy (); - /// Narrowing - ///{ - DEF_NARROW_FROM_DECL (AST_Annotation_Member); - DEF_NARROW_FROM_SCOPE (AST_Annotation_Member); - ///} - /// AST Dumping virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_argument.h b/TAO/TAO_IDL/include/ast_argument.h index 17d9ef41401..1666dd12548 100644 --- a/TAO/TAO_IDL/include/ast_argument.h +++ b/TAO/TAO_IDL/include/ast_argument.h @@ -92,10 +92,6 @@ public: // Data Accessors. Direction direction (void); - // Narrowing - - DEF_NARROW_FROM_DECL(AST_Argument); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_array.h b/TAO/TAO_IDL/include/ast_array.h index 2eb72f84859..6fac7521260 100644 --- a/TAO/TAO_IDL/include/ast_array.h +++ b/TAO/TAO_IDL/include/ast_array.h @@ -108,10 +108,6 @@ public: // Cleanup. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Array); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_attribute.h b/TAO/TAO_IDL/include/ast_attribute.h index 6a5b10ce5d5..e1d813fd9cf 100644 --- a/TAO/TAO_IDL/include/ast_attribute.h +++ b/TAO/TAO_IDL/include/ast_attribute.h @@ -89,10 +89,6 @@ public: UTL_ExceptList *get_get_exceptions (void) const; UTL_ExceptList *get_set_exceptions (void) const; - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Attribute); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_component.h b/TAO/TAO_IDL/include/ast_component.h index 2a8e15758f3..fe962cab9ac 100644 --- a/TAO/TAO_IDL/include/ast_component.h +++ b/TAO/TAO_IDL/include/ast_component.h @@ -59,11 +59,6 @@ public: int be_add_uses (AST_Uses *i, AST_Uses *ix = 0); - // Narrowing. - - DEF_NARROW_FROM_DECL (AST_Component); - DEF_NARROW_FROM_SCOPE (AST_Component); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_component_fwd.h b/TAO/TAO_IDL/include/ast_component_fwd.h index 1c356431df0..528b1da6753 100644 --- a/TAO/TAO_IDL/include/ast_component_fwd.h +++ b/TAO/TAO_IDL/include/ast_component_fwd.h @@ -17,10 +17,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_ComponentFwd); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_concrete_type.h b/TAO/TAO_IDL/include/ast_concrete_type.h index edac0ba5211..79caca0859a 100644 --- a/TAO/TAO_IDL/include/ast_concrete_type.h +++ b/TAO/TAO_IDL/include/ast_concrete_type.h @@ -82,9 +82,6 @@ public: // Cleanup. virtual void destroy (void); - // Narrowing. - DEF_NARROW_FROM_DECL(AST_ConcreteType); - virtual bool annotatable () const { return true; } }; diff --git a/TAO/TAO_IDL/include/ast_connector.h b/TAO/TAO_IDL/include/ast_connector.h index 60dd5360f99..54d08ce7e26 100644 --- a/TAO/TAO_IDL/include/ast_connector.h +++ b/TAO/TAO_IDL/include/ast_connector.h @@ -21,11 +21,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (AST_Connector); - DEF_NARROW_FROM_SCOPE (AST_Connector); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_constant.h b/TAO/TAO_IDL/include/ast_constant.h index 01196eb790a..f0961ab11be 100644 --- a/TAO/TAO_IDL/include/ast_constant.h +++ b/TAO/TAO_IDL/include/ast_constant.h @@ -111,10 +111,6 @@ public: UTL_ScopedName *enum_full_name (void); // If our type is enum, we have to generate the scoped name. - // Narrowing - - DEF_NARROW_FROM_DECL(AST_Constant); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_consumes.h b/TAO/TAO_IDL/include/ast_consumes.h index 24407232a0e..22c84fc62e3 100644 --- a/TAO/TAO_IDL/include/ast_consumes.h +++ b/TAO/TAO_IDL/include/ast_consumes.h @@ -17,9 +17,6 @@ public: // Data Accessor. AST_Type *consumes_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(AST_Consumes); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_decl.h b/TAO/TAO_IDL/include/ast_decl.h index 161f71115d9..e1a4b73138a 100644 --- a/TAO/TAO_IDL/include/ast_decl.h +++ b/TAO/TAO_IDL/include/ast_decl.h @@ -288,10 +288,6 @@ public: // the corresponding forward declaration classes. virtual bool is_defined (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Decl); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_emits.h b/TAO/TAO_IDL/include/ast_emits.h index 20c8b276b9c..c19e620dafb 100644 --- a/TAO/TAO_IDL/include/ast_emits.h +++ b/TAO/TAO_IDL/include/ast_emits.h @@ -17,9 +17,6 @@ public: // Data Accessor. AST_Type *emits_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(AST_Emits); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_enum.h b/TAO/TAO_IDL/include/ast_enum.h index 3ab61916e3b..dc580f08ab2 100644 --- a/TAO/TAO_IDL/include/ast_enum.h +++ b/TAO/TAO_IDL/include/ast_enum.h @@ -82,11 +82,6 @@ public: virtual ~AST_Enum (void); - // Narrowing - - DEF_NARROW_FROM_DECL(AST_Enum); - DEF_NARROW_FROM_SCOPE(AST_Enum); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_enum_val.h b/TAO/TAO_IDL/include/ast_enum_val.h index 6339f5280cf..fcfa695315d 100644 --- a/TAO/TAO_IDL/include/ast_enum_val.h +++ b/TAO/TAO_IDL/include/ast_enum_val.h @@ -80,9 +80,6 @@ public: virtual ~AST_EnumVal (void); - // Narrowing. - DEF_NARROW_FROM_DECL(AST_EnumVal); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_eventtype.h b/TAO/TAO_IDL/include/ast_eventtype.h index f47c01def16..10fb255cde7 100644 --- a/TAO/TAO_IDL/include/ast_eventtype.h +++ b/TAO/TAO_IDL/include/ast_eventtype.h @@ -25,11 +25,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_EventType); - DEF_NARROW_FROM_SCOPE(AST_EventType); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_eventtype_fwd.h b/TAO/TAO_IDL/include/ast_eventtype_fwd.h index a928e482232..0913ae4e2e0 100644 --- a/TAO/TAO_IDL/include/ast_eventtype_fwd.h +++ b/TAO/TAO_IDL/include/ast_eventtype_fwd.h @@ -17,10 +17,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_EventTypeFwd); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_exception.h b/TAO/TAO_IDL/include/ast_exception.h index 996b6c63114..ebcb56fd145 100644 --- a/TAO/TAO_IDL/include/ast_exception.h +++ b/TAO/TAO_IDL/include/ast_exception.h @@ -88,11 +88,6 @@ public: virtual bool in_recursion (ACE_Unbounded_Queue<AST_Type *> &list); // Check if we or the parameter node is in recursion. - // Narrowing - - DEF_NARROW_FROM_DECL(AST_Exception); - DEF_NARROW_FROM_SCOPE(AST_Exception); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_extended_port.h b/TAO/TAO_IDL/include/ast_extended_port.h index 3b49cefc994..8e467d4977f 100644 --- a/TAO/TAO_IDL/include/ast_extended_port.h +++ b/TAO/TAO_IDL/include/ast_extended_port.h @@ -20,10 +20,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (AST_Extended_Port); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_factory.h b/TAO/TAO_IDL/include/ast_factory.h index ad2996b0a23..c84ef84ca9e 100644 --- a/TAO/TAO_IDL/include/ast_factory.h +++ b/TAO/TAO_IDL/include/ast_factory.h @@ -97,11 +97,6 @@ public: // This is important because in that case no code should be // generated for the stubs. - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Factory); - DEF_NARROW_FROM_SCOPE(AST_Factory); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_field.h b/TAO/TAO_IDL/include/ast_field.h index 03adc8d793d..68d8fe39754 100644 --- a/TAO/TAO_IDL/include/ast_field.h +++ b/TAO/TAO_IDL/include/ast_field.h @@ -128,10 +128,6 @@ public: // we are destroyed. void set_recursive_flag (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (AST_Field); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_finder.h b/TAO/TAO_IDL/include/ast_finder.h index ce0403c6936..25d6dabd511 100644 --- a/TAO/TAO_IDL/include/ast_finder.h +++ b/TAO/TAO_IDL/include/ast_finder.h @@ -13,10 +13,6 @@ public: AST_Finder (UTL_ScopedName *n); virtual ~AST_Finder (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Finder); - DEF_NARROW_FROM_SCOPE(AST_Finder); // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_fixed.h b/TAO/TAO_IDL/include/ast_fixed.h index 2c7a8793375..afd9311e6df 100644 --- a/TAO/TAO_IDL/include/ast_fixed.h +++ b/TAO/TAO_IDL/include/ast_fixed.h @@ -17,8 +17,6 @@ public: virtual ~AST_Fixed (); - DEF_NARROW_FROM_DECL (AST_Fixed); - virtual void dump (ACE_OSTREAM_TYPE &o); virtual void destroy (); diff --git a/TAO/TAO_IDL/include/ast_home.h b/TAO/TAO_IDL/include/ast_home.h index d12a3624009..728b3af6a55 100644 --- a/TAO/TAO_IDL/include/ast_home.h +++ b/TAO/TAO_IDL/include/ast_home.h @@ -52,11 +52,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Home); - DEF_NARROW_FROM_SCOPE(AST_Home); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_interface.h b/TAO/TAO_IDL/include/ast_interface.h index 2be8cee24f3..ebb57be4b30 100644 --- a/TAO/TAO_IDL/include/ast_interface.h +++ b/TAO/TAO_IDL/include/ast_interface.h @@ -159,11 +159,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Interface); - DEF_NARROW_FROM_SCOPE(AST_Interface); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_interface_fwd.h b/TAO/TAO_IDL/include/ast_interface_fwd.h index 34a4ff22828..f0427fedd5c 100644 --- a/TAO/TAO_IDL/include/ast_interface_fwd.h +++ b/TAO/TAO_IDL/include/ast_interface_fwd.h @@ -107,10 +107,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_InterfaceFwd); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_mirror_port.h b/TAO/TAO_IDL/include/ast_mirror_port.h index a5fbc761b4f..dee54323979 100644 --- a/TAO/TAO_IDL/include/ast_mirror_port.h +++ b/TAO/TAO_IDL/include/ast_mirror_port.h @@ -17,10 +17,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (AST_Mirror_Port); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_module.h b/TAO/TAO_IDL/include/ast_module.h index 03998ee62f0..07da023f2f3 100644 --- a/TAO/TAO_IDL/include/ast_module.h +++ b/TAO/TAO_IDL/include/ast_module.h @@ -92,10 +92,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - DEF_NARROW_FROM_DECL(AST_Module); - DEF_NARROW_FROM_SCOPE(AST_Module); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_native.h b/TAO/TAO_IDL/include/ast_native.h index 04a5fec2681..389f61f593f 100644 --- a/TAO/TAO_IDL/include/ast_native.h +++ b/TAO/TAO_IDL/include/ast_native.h @@ -20,9 +20,6 @@ public: // Cleanup. virtual void destroy (void); - // Narrowing. - DEF_NARROW_FROM_DECL(AST_Native); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_operation.h b/TAO/TAO_IDL/include/ast_operation.h index f226d57780d..3c8d277cb60 100644 --- a/TAO/TAO_IDL/include/ast_operation.h +++ b/TAO/TAO_IDL/include/ast_operation.h @@ -130,11 +130,6 @@ public: // This is important because in that case no code should be // generated for the stubs. - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Operation); - DEF_NARROW_FROM_SCOPE(AST_Operation); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_param_holder.h b/TAO/TAO_IDL/include/ast_param_holder.h index e3c99455c5c..abd5ad403b1 100644 --- a/TAO/TAO_IDL/include/ast_param_holder.h +++ b/TAO/TAO_IDL/include/ast_param_holder.h @@ -17,9 +17,6 @@ public: FE_Utils::T_Param_Info const *info (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL (AST_Param_Holder); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_porttype.h b/TAO/TAO_IDL/include/ast_porttype.h index 1a745e2ad87..aa98a84ee2a 100644 --- a/TAO/TAO_IDL/include/ast_porttype.h +++ b/TAO/TAO_IDL/include/ast_porttype.h @@ -23,11 +23,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL (AST_PortType); - DEF_NARROW_FROM_SCOPE (AST_PortType); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_predefined_type.h b/TAO/TAO_IDL/include/ast_predefined_type.h index 311e89c3e04..7e621aa8088 100644 --- a/TAO/TAO_IDL/include/ast_predefined_type.h +++ b/TAO/TAO_IDL/include/ast_predefined_type.h @@ -105,9 +105,6 @@ public: // Data Accessors. PredefinedType pt (void); - // Narrowing - DEF_NARROW_FROM_DECL(AST_PredefinedType); - // AST Dumping virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_provides.h b/TAO/TAO_IDL/include/ast_provides.h index 6074f47e09d..bb01a45d6b1 100644 --- a/TAO/TAO_IDL/include/ast_provides.h +++ b/TAO/TAO_IDL/include/ast_provides.h @@ -15,9 +15,6 @@ public: // Data Accessor. AST_Type *provides_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(AST_Provides); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_publishes.h b/TAO/TAO_IDL/include/ast_publishes.h index 1ef752f8f9c..b1ac2051e36 100644 --- a/TAO/TAO_IDL/include/ast_publishes.h +++ b/TAO/TAO_IDL/include/ast_publishes.h @@ -17,9 +17,6 @@ public: // Data Accessor. AST_Type *publishes_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(AST_Publishes); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_root.h b/TAO/TAO_IDL/include/ast_root.h index 542de927785..e3750e20934 100644 --- a/TAO/TAO_IDL/include/ast_root.h +++ b/TAO/TAO_IDL/include/ast_root.h @@ -79,11 +79,6 @@ public: virtual unsigned long nmembers (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Root); - DEF_NARROW_FROM_SCOPE(AST_Root); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_sequence.h b/TAO/TAO_IDL/include/ast_sequence.h index 228a579dd43..e165bd03ed6 100644 --- a/TAO/TAO_IDL/include/ast_sequence.h +++ b/TAO/TAO_IDL/include/ast_sequence.h @@ -106,10 +106,6 @@ public: // Cleanup method. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Sequence); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_string.h b/TAO/TAO_IDL/include/ast_string.h index 5fbd6631885..75ea44326e1 100644 --- a/TAO/TAO_IDL/include/ast_string.h +++ b/TAO/TAO_IDL/include/ast_string.h @@ -88,9 +88,6 @@ public: AST_Expression *max_size (void); long width (void); - // Narrowing. - DEF_NARROW_FROM_DECL(AST_String); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_structure.h b/TAO/TAO_IDL/include/ast_structure.h index 7ccf834cf66..48d4341e6a4 100644 --- a/TAO/TAO_IDL/include/ast_structure.h +++ b/TAO/TAO_IDL/include/ast_structure.h @@ -103,11 +103,6 @@ public: // Overridden for unions. virtual void redefine (AST_Structure *from); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Structure); - DEF_NARROW_FROM_SCOPE(AST_Structure); - virtual int member_count (void); // Return the count of members. diff --git a/TAO/TAO_IDL/include/ast_structure_fwd.h b/TAO/TAO_IDL/include/ast_structure_fwd.h index 8481a85fea2..0e610192ea7 100644 --- a/TAO/TAO_IDL/include/ast_structure_fwd.h +++ b/TAO/TAO_IDL/include/ast_structure_fwd.h @@ -24,10 +24,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_StructureFwd); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_template_module.h b/TAO/TAO_IDL/include/ast_template_module.h index bfc44bc6f74..2908afed679 100644 --- a/TAO/TAO_IDL/include/ast_template_module.h +++ b/TAO/TAO_IDL/include/ast_template_module.h @@ -26,10 +26,6 @@ public: // Checks for errors in the template param refs of an alias. bool match_param_refs (UTL_StrList *refs, UTL_Scope *decl_scope); - // Narrowing. - DEF_NARROW_FROM_DECL (AST_Template_Module); - DEF_NARROW_FROM_SCOPE (AST_Template_Module); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_template_module_inst.h b/TAO/TAO_IDL/include/ast_template_module_inst.h index 4b2031cbcaa..5adb0e898f2 100644 --- a/TAO/TAO_IDL/include/ast_template_module_inst.h +++ b/TAO/TAO_IDL/include/ast_template_module_inst.h @@ -22,9 +22,6 @@ public: FE_Utils::T_ARGLIST const * template_args (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL (AST_Template_Module_Inst); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_template_module_ref.h b/TAO/TAO_IDL/include/ast_template_module_ref.h index 5abdba89e19..30a5b0ee81b 100644 --- a/TAO/TAO_IDL/include/ast_template_module_ref.h +++ b/TAO/TAO_IDL/include/ast_template_module_ref.h @@ -21,9 +21,6 @@ public: UTL_StrList *param_refs (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL (AST_Template_Module_Ref); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_type.h b/TAO/TAO_IDL/include/ast_type.h index e3698c729c9..9b10b6a2821 100644 --- a/TAO/TAO_IDL/include/ast_type.h +++ b/TAO/TAO_IDL/include/ast_type.h @@ -131,10 +131,6 @@ public: // a primary key. Overridden for valuetype, struct, sequence, // union, array, typedef, and interface. - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_Type); - // Visiting. virtual int ast_accept (ast_visitor *visitor); diff --git a/TAO/TAO_IDL/include/ast_typedef.h b/TAO/TAO_IDL/include/ast_typedef.h index 91a3819f840..cd3d776165c 100644 --- a/TAO/TAO_IDL/include/ast_typedef.h +++ b/TAO/TAO_IDL/include/ast_typedef.h @@ -102,9 +102,6 @@ public: void owns_base_type (bool val); // Sometimes this has to be accessed or managed from outside. - // Narrowing. - DEF_NARROW_FROM_DECL (AST_Typedef); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_union.h b/TAO/TAO_IDL/include/ast_union.h index 4aada429a1b..4815d0736d8 100644 --- a/TAO/TAO_IDL/include/ast_union.h +++ b/TAO/TAO_IDL/include/ast_union.h @@ -98,10 +98,6 @@ public: AST_Expression::ExprType udisc_type (void); - // Narrowing. - DEF_NARROW_FROM_DECL(AST_Union); - DEF_NARROW_FROM_SCOPE(AST_Union); - struct DefaultValue { union PermittedTypes diff --git a/TAO/TAO_IDL/include/ast_union_branch.h b/TAO/TAO_IDL/include/ast_union_branch.h index 955f9e0c8e3..e1427765f7c 100644 --- a/TAO/TAO_IDL/include/ast_union_branch.h +++ b/TAO/TAO_IDL/include/ast_union_branch.h @@ -103,10 +103,6 @@ public: // we call this at the end of fe_add_union_branch. void coerce_labels (AST_Union *u); - // Narrowing. - - DEF_NARROW_FROM_DECL (AST_UnionBranch); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_union_fwd.h b/TAO/TAO_IDL/include/ast_union_fwd.h index 13d391677cd..65dc9013a93 100644 --- a/TAO/TAO_IDL/include/ast_union_fwd.h +++ b/TAO/TAO_IDL/include/ast_union_fwd.h @@ -19,10 +19,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_UnionFwd); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/ast_uses.h b/TAO/TAO_IDL/include/ast_uses.h index 10115d09a77..f34d66d4ec5 100644 --- a/TAO/TAO_IDL/include/ast_uses.h +++ b/TAO/TAO_IDL/include/ast_uses.h @@ -17,9 +17,6 @@ public: AST_Type *uses_type (void) const; bool is_multiple (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(AST_Uses); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_valuebox.h b/TAO/TAO_IDL/include/ast_valuebox.h index cd8e3366031..40e5cc87c50 100644 --- a/TAO/TAO_IDL/include/ast_valuebox.h +++ b/TAO/TAO_IDL/include/ast_valuebox.h @@ -15,9 +15,6 @@ public: // Data Accessors. AST_Type *boxed_type (void) const; - // Narrowing. - DEF_NARROW_FROM_DECL(AST_ValueBox); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_valuetype.h b/TAO/TAO_IDL/include/ast_valuetype.h index f8398efce68..4f5583e41b3 100644 --- a/TAO/TAO_IDL/include/ast_valuetype.h +++ b/TAO/TAO_IDL/include/ast_valuetype.h @@ -60,11 +60,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_ValueType); - DEF_NARROW_FROM_SCOPE(AST_ValueType); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/include/ast_valuetype_fwd.h b/TAO/TAO_IDL/include/ast_valuetype_fwd.h index b31b56f1b7d..736271cc50c 100644 --- a/TAO/TAO_IDL/include/ast_valuetype_fwd.h +++ b/TAO/TAO_IDL/include/ast_valuetype_fwd.h @@ -17,10 +17,6 @@ public: // Cleanup function. virtual void destroy (void); - // Narrowing. - - DEF_NARROW_FROM_DECL(AST_ValueTypeFwd); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &); diff --git a/TAO/TAO_IDL/include/utl_scope.h b/TAO/TAO_IDL/include/utl_scope.h index ef20c534e08..658c2be463b 100644 --- a/TAO/TAO_IDL/include/utl_scope.h +++ b/TAO/TAO_IDL/include/utl_scope.h @@ -167,10 +167,6 @@ public: return pd_scope_node_type; } - // Narrowing. - - DEF_NARROW_FROM_SCOPE(UTL_Scope); - // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); diff --git a/TAO/TAO_IDL/narrow/narrow.cpp b/TAO/TAO_IDL/narrow/narrow.cpp index 180ac2888df..08d367af5e5 100644 --- a/TAO/TAO_IDL/narrow/narrow.cpp +++ b/TAO/TAO_IDL/narrow/narrow.cpp @@ -94,41 +94,41 @@ ScopeAsDecl (UTL_Scope *s) switch (s->scope_node_type ()) { case AST_Decl::NT_module: - return AST_Module::narrow_from_scope (s); + return dynamic_cast<AST_Module*> (s); case AST_Decl::NT_root: - return AST_Root::narrow_from_scope (s); + return dynamic_cast<AST_Root*> (s); case AST_Decl::NT_interface: - return AST_Interface::narrow_from_scope (s); + return dynamic_cast<AST_Interface*> (s); case AST_Decl::NT_valuetype: - return AST_ValueType::narrow_from_scope (s); + return dynamic_cast<AST_ValueType*> (s); case AST_Decl::NT_eventtype: - return AST_EventType::narrow_from_scope (s); + return dynamic_cast<AST_EventType*> (s); case AST_Decl::NT_component: - return AST_Component::narrow_from_scope (s); + return dynamic_cast<AST_Component*> (s); case AST_Decl::NT_porttype: - return AST_PortType::narrow_from_scope (s); + return dynamic_cast<AST_PortType*> (s); case AST_Decl::NT_connector: - return AST_Connector::narrow_from_scope (s); + return dynamic_cast<AST_Connector*> (s); case AST_Decl::NT_home: - return AST_Home::narrow_from_scope (s); + return dynamic_cast<AST_Home*> (s); case AST_Decl::NT_op: - return AST_Operation::narrow_from_scope (s); + return dynamic_cast<AST_Operation*> (s); case AST_Decl::NT_factory: - return AST_Factory::narrow_from_scope (s); + return dynamic_cast<AST_Factory*> (s); case AST_Decl::NT_finder: - return AST_Finder::narrow_from_scope (s); + return dynamic_cast<AST_Finder*> (s); case AST_Decl::NT_except: - return AST_Exception::narrow_from_scope (s); + return dynamic_cast<AST_Exception*> (s); case AST_Decl::NT_union: - return AST_Union::narrow_from_scope (s); + return dynamic_cast<AST_Union*> (s); case AST_Decl::NT_struct: - return AST_Structure::narrow_from_scope (s); + return dynamic_cast<AST_Structure*> (s); case AST_Decl::NT_enum: - return AST_Enum::narrow_from_scope (s); + return dynamic_cast<AST_Enum*> (s); case AST_Decl::NT_annotation_decl: - return AST_Annotation_Decl::narrow_from_scope (s); + return dynamic_cast<AST_Annotation_Decl*> (s); case AST_Decl::NT_annotation_appl: - return AST_Annotation_Appl::narrow_from_scope (s); + return dynamic_cast<AST_Annotation_Appl*> (s); default: return 0; } @@ -152,40 +152,40 @@ DeclAsScope (AST_Decl *d) * Resolve forward declared interface by looking at full_definition() * field and iterating */ - d = (AST_InterfaceFwd::narrow_from_decl (d))->full_definition (); + d = (dynamic_cast<AST_InterfaceFwd*> (d))->full_definition (); // fallthrough case AST_Decl::NT_interface: - return AST_Interface::narrow_from_decl (d); + return dynamic_cast<AST_Interface*> (d); case AST_Decl::NT_valuetype: - return AST_ValueType::narrow_from_decl (d); + return dynamic_cast<AST_ValueType*> (d); case AST_Decl::NT_eventtype: - return AST_EventType::narrow_from_decl (d); + return dynamic_cast<AST_EventType*> (d); case AST_Decl::NT_component: - return AST_Component::narrow_from_decl (d); + return dynamic_cast<AST_Component*> (d); case AST_Decl::NT_porttype: - return AST_PortType::narrow_from_decl (d); + return dynamic_cast<AST_PortType*> (d); case AST_Decl::NT_connector: - return AST_Connector::narrow_from_decl (d); + return dynamic_cast<AST_Connector*> (d); case AST_Decl::NT_home: - return AST_Home::narrow_from_decl (d); + return dynamic_cast<AST_Home*> (d); case AST_Decl::NT_module: - return AST_Module::narrow_from_decl (d); + return dynamic_cast<AST_Module*> (d); case AST_Decl::NT_root: - return AST_Root::narrow_from_decl (d); + return dynamic_cast<AST_Root*> (d); case AST_Decl::NT_except: - return AST_Exception::narrow_from_decl (d); + return dynamic_cast<AST_Exception*> (d); case AST_Decl::NT_union: - return AST_Union::narrow_from_decl (d); + return dynamic_cast<AST_Union*> (d); case AST_Decl::NT_struct: - return AST_Structure::narrow_from_decl (d); + return dynamic_cast<AST_Structure*> (d); case AST_Decl::NT_enum: - return AST_Enum::narrow_from_decl (d); + return dynamic_cast<AST_Enum*> (d); case AST_Decl::NT_op: - return AST_Operation::narrow_from_decl (d); + return dynamic_cast<AST_Operation*> (d); case AST_Decl::NT_factory: - return AST_Factory::narrow_from_decl (d); + return dynamic_cast<AST_Factory*> (d); case AST_Decl::NT_finder: - return AST_Finder::narrow_from_decl (d); + return dynamic_cast<AST_Finder*> (d); default: return 0; } diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp index 347182d76f6..4d2cfab6f9b 100644 --- a/TAO/TAO_IDL/util/utl_scope.cpp +++ b/TAO/TAO_IDL/util/utl_scope.cpp @@ -347,11 +347,11 @@ UTL_Scope::check_for_predef_seq (AST_Decl *d) case AST_Decl::NT_union_branch: case AST_Decl::NT_attr: case AST_Decl::NT_argument: - bt = AST_Field::narrow_from_decl (d)->field_type (); + bt = dynamic_cast<AST_Field*> (d)->field_type (); break; case AST_Decl::NT_typedef: - bt = AST_Typedef::narrow_from_decl (d)->base_type (); + bt = dynamic_cast<AST_Typedef*> (d)->base_type (); break; default: @@ -364,7 +364,7 @@ UTL_Scope::check_for_predef_seq (AST_Decl *d) return; } - bt = AST_Typedef::narrow_from_decl (bt)->base_type (); + bt = dynamic_cast<AST_Typedef*> (bt)->base_type (); nt = bt->node_type (); // Must be a sequence with only one level of typedef. @@ -381,7 +381,7 @@ UTL_Scope::check_for_predef_seq (AST_Decl *d) } // We know this narrowing will be successful. - bt = AST_Sequence::narrow_from_decl (bt)->base_type (); + bt = dynamic_cast<AST_Sequence*> (bt)->base_type (); nt = bt->node_type (); // First check for string or wstring base type. @@ -398,7 +398,7 @@ UTL_Scope::check_for_predef_seq (AST_Decl *d) } // Now check for predefined base type. - AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (bt); + AST_PredefinedType *pdt = dynamic_cast<AST_PredefinedType*> (bt); if (!pdt) { return; @@ -562,13 +562,13 @@ UTL_Scope::fe_add_ref_decl (AST_Field *t) // Catches struct/union/exception which all maintain a queue // for fields as distinct from decls and enum values. - AST_Structure *s = AST_Structure::narrow_from_scope (this); + AST_Structure *s = dynamic_cast<AST_Structure*> (this); if (s) { s->fields ().enqueue_tail (t); } - return AST_Field::narrow_from_decl (d); + return dynamic_cast<AST_Field*> (d); } AST_Structure * @@ -634,7 +634,7 @@ UTL_Scope::fe_add_fwd_struct_type (AST_StructureFwd *t) // value, but the result is what we want. if (d->node_type () == AST_Decl::NT_struct) { - t->set_full_definition (AST_Structure::narrow_from_decl (d)); + t->set_full_definition (dynamic_cast<AST_Structure*> (d)); } else if (!FE_Utils::can_be_redefined (d, t)) { @@ -1061,7 +1061,7 @@ UTL_Scope::lookup_primitive_type (AST_Expression::ExprType et) if (as_decl->node_type () == AST_Decl::NT_pre_defined) { AST_PredefinedType *t = - AST_PredefinedType::narrow_from_decl (as_decl); + dynamic_cast<AST_PredefinedType*> (as_decl); if (t->pt () == pdt) { @@ -1153,7 +1153,7 @@ UTL_Scope::lookup_by_name_local (Identifier *e, // Ok the name wasn't found in the current scope, if this // scope is a module, we can check it's previous openings! - AST_Module *m = AST_Module::narrow_from_scope (this); + AST_Module *m = dynamic_cast<AST_Module*> (this); if (m) { d = m->look_in_prev_mods_local (e); @@ -1166,7 +1166,7 @@ UTL_Scope::lookup_by_name_local (Identifier *e, { // Or if this scope is an interface, we can check if // it was inherited! - AST_Interface *i = AST_Interface::narrow_from_scope (this); + AST_Interface *i = dynamic_cast<AST_Interface*> (this); if (i) { d = i->look_in_inherited_local (e); @@ -1413,7 +1413,7 @@ UTL_Scope::add_to_referenced (AST_Decl *e, if ( nt == AST_Decl::NT_interface || nt == AST_Decl::NT_component) { - AST_Interface *itf = AST_Interface::narrow_from_decl (e); + AST_Interface *itf = dynamic_cast<AST_Interface*> (e); if (itf && itf->defined_in () == this && !itf->is_defined ()) @@ -1960,7 +1960,7 @@ UTL_Scope::match_param (UTL_ScopedName *e) bool UTL_Scope::inherited_op_attr_clash (AST_Decl *t) { - AST_Interface *i = AST_Interface::narrow_from_scope (this); + AST_Interface *i = dynamic_cast<AST_Interface*> (this); if (!i) { return false; @@ -1987,13 +1987,13 @@ UTL_Scope::inherited_op_attr_clash (AST_Decl *t) bool UTL_Scope::arg_specific_error (AST_Decl *t) { - AST_Operation *op = AST_Operation::narrow_from_scope (this); + AST_Operation *op = dynamic_cast<AST_Operation*> (this); if (!op) { return false; } - AST_Argument *arg = AST_Argument::narrow_from_decl (t); + AST_Argument *arg = dynamic_cast<AST_Argument*> (t); AST_Argument::Direction d = arg->direction (); // Cannot add OUT or INOUT argument to oneway operation. @@ -2023,10 +2023,10 @@ void UTL_Scope::smart_local_add (AST_Decl *t) { // Catches struct, union * exception - AST_Structure *s = AST_Structure::narrow_from_scope (this); + AST_Structure *s = dynamic_cast<AST_Structure*> (this); // Catches AST_Field and AST_UnionBranch. - AST_Field *f = AST_Field::narrow_from_decl (t); + AST_Field *f = dynamic_cast<AST_Field*> (t); // Decls inside a struct/union/exception are also referenced by // fields, and so must be handled differently. @@ -2042,8 +2042,8 @@ UTL_Scope::smart_local_add (AST_Decl *t) // If we have an enum discriminator, add the label names to // the name_referenced list before we add the union branch, // so a branch name clash with a label name will be caught. - AST_Union *u = AST_Union::narrow_from_scope (this); - AST_UnionBranch *ub = AST_UnionBranch::narrow_from_decl (t); + AST_Union *u = dynamic_cast<AST_Union*> (this); + AST_UnionBranch *ub = dynamic_cast<AST_UnionBranch*> (t); if (u && ub) { if (u->udisc_type () == AST_Expression::EV_enum) @@ -2078,7 +2078,7 @@ UTL_Scope::iter_lookup_by_name_local (AST_Decl *d, // Remove all the layers of typedefs. while (d && d->node_type () == AST_Decl::NT_typedef) { - AST_Typedef *td = AST_Typedef::narrow_from_decl (d); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (d); if (!td) { return 0; @@ -2108,7 +2108,7 @@ UTL_Scope::iter_lookup_by_name_local (AST_Decl *d, } else { - AST_Interface *i = AST_Interface::narrow_from_decl (d); + AST_Interface *i = dynamic_cast<AST_Interface*> (d); result = i ? i->look_in_inherited_local (e->head ()) : sc->look_in_prev_mods_local (e->head (), true); } @@ -2132,8 +2132,6 @@ UTL_Scope::iter_lookup_by_name_local (AST_Decl *d, return result; } -IMPL_NARROW_FROM_SCOPE(UTL_Scope) - // UTL_SCOPE_ACTIVE_ITERATOR // Constructor. |