diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-09-18 08:46:41 +0200 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-09-18 08:46:41 +0200 |
commit | 6f78b0285ec9a20ccc8c626ff99e5df711a25e18 (patch) | |
tree | 007b3cf4129ecb433a642605b88ab8f5ca68a306 | |
parent | 0eff81cbdb5089fc417afd9aeddf20a626e7512a (diff) | |
download | ATCD-6f78b0285ec9a20ccc8c626ff99e5df711a25e18.tar.gz |
Remove usage of narrow_from_decl/narrow_from_scope and replace them with dynamic_cast
254 files changed, 1257 insertions, 1394 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) @@ -1,6 +1,11 @@ USER VISIBLE CHANGES BETWEEN TAO-2.5.11 and TAO-2.5.12 ====================================================== +. Removed usage of narrow_from_decl and narrow_from_scope + from TAO_IDL, use dynamic_cast now that we have RTTI. Any + user that has a custom backend should make the similar + changes to their own TAO_IDL backend + USER VISIBLE CHANGES BETWEEN TAO-2.5.10 and TAO-2.5.11 ====================================================== diff --git a/TAO/TAO_IDL/ast/ast_annotation_appl.cpp b/TAO/TAO_IDL/ast/ast_annotation_appl.cpp index aed09a6c3cf..68786c72f52 100644 --- a/TAO/TAO_IDL/ast/ast_annotation_appl.cpp +++ b/TAO/TAO_IDL/ast/ast_annotation_appl.cpp @@ -117,7 +117,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..f63c0cfb7b8 100644 --- a/TAO/TAO_IDL/ast/ast_annotation_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_annotation_decl.cpp @@ -86,19 +86,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_attribute.cpp b/TAO/TAO_IDL/ast/ast_attribute.cpp index 3dc8331d3a8..aa222f9060c 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, diff --git a/TAO/TAO_IDL/ast/ast_component.cpp b/TAO/TAO_IDL/ast/ast_component.cpp index c1cbe1729b5..0e2319a182f 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 diff --git a/TAO/TAO_IDL/ast/ast_connector.cpp b/TAO/TAO_IDL/ast/ast_connector.cpp index e92a55de7d7..9d997d41824 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 diff --git a/TAO/TAO_IDL/ast/ast_decl.cpp b/TAO/TAO_IDL/ast/ast_decl.cpp index 96a46df6707..9ed972220fb 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 ())) diff --git a/TAO/TAO_IDL/ast/ast_enum.cpp b/TAO/TAO_IDL/ast/ast_enum.cpp index 6ad9afb3fc9..ce4037d9cac 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) diff --git a/TAO/TAO_IDL/ast/ast_exception.cpp b/TAO/TAO_IDL/ast/ast_exception.cpp index f2dddf6946b..301539d96d8 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 (); } 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..a43ede5aba0 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 diff --git a/TAO/TAO_IDL/ast/ast_factory.cpp b/TAO/TAO_IDL/ast/ast_factory.cpp index 15b779fbd10..9cc95825374 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) { @@ -208,9 +208,7 @@ AST_Factory::compute_argument_attr (void) AST_Argument * AST_Factory::fe_add_argument (AST_Argument *t) { - return - AST_Argument::narrow_from_decl ( - this->fe_add_ref_decl (t)); + return dynamic_cast<AST_Argument*> (this->fe_add_ref_decl (t)); } UTL_NameList * @@ -246,7 +244,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, diff --git a/TAO/TAO_IDL/ast/ast_field.cpp b/TAO/TAO_IDL/ast/ast_field.cpp index 15f5d97b957..8ff7cb8321e 100644 --- a/TAO/TAO_IDL/ast/ast_field.cpp +++ b/TAO/TAO_IDL/ast/ast_field.cpp @@ -107,8 +107,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); + AST_Param_Holder *ph = dynamic_cast<AST_Param_Holder*> (ft); if (ph->info ()->type_ == AST_Decl::NT_const) { @@ -140,8 +139,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); + AST_Param_Holder *ph = dynamic_cast<AST_Param_Holder*> (ft); if (ph->info ()->type_ == AST_Decl::NT_const) { 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..a7a02a9374c 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); diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index 9e3d780b418..0817f96053e 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. @@ -256,26 +242,20 @@ AST_Interface::fe_add_union_fwd (AST_UnionFwd *t) AST_EnumVal * AST_Interface::fe_add_enum_val (AST_EnumVal *t) { - return - AST_EnumVal::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_EnumVal*> (this->fe_add_decl (t)); } // Add an AST_Typedef (a typedef) to the current scope. AST_Typedef * AST_Interface::fe_add_typedef (AST_Typedef *t) { - return - AST_Typedef::narrow_from_decl ( - this->fe_add_ref_decl (t)); + return dynamic_cast<AST_Typedef*> (this->fe_add_ref_decl (t)); } AST_Native * AST_Interface::fe_add_native (AST_Native *t) { - return - AST_Native::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Native*> (this->fe_add_decl (t)); } // Dump this AST_Interface node to the ostream o. @@ -442,8 +422,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); + AST_Interface *i = dynamic_cast<AST_Interface*> (t); AST_Type **parents = i->inherits (); long n_parents = i->n_inherits (); @@ -456,7 +435,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 +446,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 (); @@ -506,8 +485,7 @@ int AST_Interface::insert_non_dup (AST_Type *t, bool abstract_paths_only) { - AST_Interface *f = - AST_Interface::narrow_from_decl (t); + AST_Interface *f = 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. @@ -828,8 +806,7 @@ AST_Interface::look_in_inherited (UTL_ScopedName *e, nis > 0; nis--, is++) { - AST_Interface *i = - AST_Interface::narrow_from_decl (*is); + AST_Interface *i = dynamic_cast<AST_Interface*> (*is); if (i == 0) { @@ -896,8 +873,7 @@ AST_Interface::look_in_inherited_local (Identifier *e, nis > 0; nis--, is++) { - AST_Interface *i = - AST_Interface::narrow_from_decl (*is); + AST_Interface *i = dynamic_cast<AST_Interface*> (*is); if (i == 0) { @@ -1009,8 +985,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]); + AST_Interface *parent = dynamic_cast<AST_Interface*> (this->pd_inherits[i]); if (parent == 0) { @@ -1034,8 +1009,7 @@ AST_Interface::analyze_parentage (void) while (s != 0) { - AST_Template_Module *m = - AST_Template_Module::narrow_from_scope (s); + AST_Template_Module *m = dynamic_cast<AST_Template_Module*> (s); if (m != 0) { diff --git a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp index 655008fd030..f6a3c786810 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 ())) { @@ -223,8 +223,7 @@ AST_InterfaceFwd::is_defined (void) // that may have a full definition. if (!this->is_defined_) { - AST_Module *m = - AST_Module::narrow_from_scope (this->defined_in ()); + AST_Module *m = dynamic_cast<AST_Module*> (this->defined_in ()); if (0 != m) { @@ -241,8 +240,7 @@ AST_InterfaceFwd::is_defined (void) set_as_defined (); } - AST_InterfaceFwd *fwd = - AST_InterfaceFwd::narrow_from_decl (d); + AST_InterfaceFwd *fwd = dynamic_cast<AST_InterfaceFwd*> (d); // Since fwd_redefinition_helper() is called // before fe_add_interface(), we can't check diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp index b428d3c5dd6..8d5348fe105 100644 --- a/TAO/TAO_IDL/ast/ast_module.cpp +++ b/TAO/TAO_IDL/ast/ast_module.cpp @@ -164,7 +164,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 +226,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,8 +345,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 ( - this->fe_add_decl (t)); + return dynamic_cast<AST_PredefinedType*> (this->fe_add_decl (t)); } AST_Module * @@ -393,7 +392,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); @@ -463,121 +462,97 @@ AST_Module::fe_add_module (AST_Module *t) AST_Template_Module_Inst * AST_Module::fe_add_template_module_inst (AST_Template_Module_Inst *t) { - return - AST_Template_Module_Inst::narrow_from_decl ( - this->fe_add_ref_decl (t)); + return dynamic_cast<AST_Template_Module_Inst*> (this->fe_add_ref_decl (t)); } AST_Interface * AST_Module::fe_add_interface (AST_Interface *t) { - return - this->fe_add_full_intf_decl<AST_Interface> (t); + return this->fe_add_full_intf_decl<AST_Interface> (t); } AST_ValueBox * AST_Module::fe_add_valuebox (AST_ValueBox *t) { - return - AST_ValueBox::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_ValueBox*> (this->fe_add_decl (t)); } AST_ValueType * AST_Module::fe_add_valuetype (AST_ValueType *t) { - return - this->fe_add_full_intf_decl<AST_ValueType> (t); + return this->fe_add_full_intf_decl<AST_ValueType> (t); } AST_EventType * AST_Module::fe_add_eventtype (AST_EventType *t) { - return - this->fe_add_full_intf_decl<AST_EventType> (t); + return this->fe_add_full_intf_decl<AST_EventType> (t); } AST_Component * AST_Module::fe_add_component (AST_Component *t) { - return - this->fe_add_full_intf_decl<AST_Component> (t); + return this->fe_add_full_intf_decl<AST_Component> (t); } AST_Connector * AST_Module::fe_add_connector (AST_Connector *t) { - return - AST_Connector::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Connector*> (this->fe_add_decl (t)); } AST_Home * AST_Module::fe_add_home (AST_Home *t) { - return - AST_Home::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Home*> (this->fe_add_decl (t)); } AST_InterfaceFwd * AST_Module::fe_add_interface_fwd (AST_InterfaceFwd *t) { - return - this->fe_add_fwd_intf_decl<AST_Interface> (t); + return this->fe_add_fwd_intf_decl<AST_Interface> (t); } AST_ValueTypeFwd * AST_Module::fe_add_valuetype_fwd (AST_ValueTypeFwd *t) { - return - this->fe_add_fwd_intf_decl<AST_ValueType> (t); + return this->fe_add_fwd_intf_decl<AST_ValueType> (t); } AST_EventTypeFwd * AST_Module::fe_add_eventtype_fwd (AST_EventTypeFwd *t) { - return - this->fe_add_fwd_intf_decl<AST_EventType> (t); + return this->fe_add_fwd_intf_decl<AST_EventType> (t); } AST_ComponentFwd * AST_Module::fe_add_component_fwd (AST_ComponentFwd *t) { - return - this->fe_add_fwd_intf_decl<AST_Component> (t); + return this->fe_add_fwd_intf_decl<AST_Component> (t); } AST_Constant * AST_Module::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_Module::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_Union * AST_Module::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_Module::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)); } AST_Structure * @@ -595,9 +570,7 @@ AST_Module::fe_add_structure_fwd (AST_StructureFwd *t) AST_Enum * AST_Module::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)); } // Add an AST_EnumVal node (an enumerator) to this scope. @@ -607,33 +580,25 @@ AST_Module::fe_add_enum (AST_Enum *t) AST_EnumVal * AST_Module::fe_add_enum_val (AST_EnumVal *t) { - return - AST_EnumVal::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_EnumVal*> (this->fe_add_decl (t)); } AST_Typedef * AST_Module::fe_add_typedef (AST_Typedef *t) { - return - AST_Typedef::narrow_from_decl ( - this->fe_add_ref_decl (t)); + return dynamic_cast<AST_Typedef*> (this->fe_add_ref_decl (t)); } AST_Native * AST_Module::fe_add_native (AST_Native *t) { - return - AST_Native::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Native*> (this->fe_add_decl (t)); } AST_PortType * AST_Module::fe_add_porttype (AST_PortType *t) { - return - AST_PortType::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_PortType*> (this->fe_add_decl (t)); } void @@ -646,6 +611,5 @@ AST_Annotation_Decl * AST_Module::fe_add_annotation_decl ( AST_Annotation_Decl *annotation_decl) { - return AST_Annotation_Decl::narrow_from_decl ( - fe_add_decl (annotation_decl)); + return dynamic_cast<AST_Annotation_Decl*> (fe_add_decl (annotation_decl)); } diff --git a/TAO/TAO_IDL/ast/ast_operation.cpp b/TAO/TAO_IDL/ast/ast_operation.cpp index d82257840b4..8a787e2168a 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)); } @@ -176,8 +176,7 @@ AST_Operation::count_arguments_with_direction (int direction_mask) !si.is_done (); si.next ()) { - AST_Argument *arg = - AST_Argument::narrow_from_decl (si.item ()); + AST_Argument *arg = dynamic_cast<AST_Argument*> (si.item ()); if ((arg->direction () & direction_mask) != 0) { @@ -264,7 +263,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 +272,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 +282,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) { @@ -342,8 +341,7 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t) break; case AST_Decl::NT_param_holder: { - AST_Param_Holder *ph = - AST_Param_Holder::narrow_from_decl (d); + AST_Param_Holder *ph = dynamic_cast<AST_Param_Holder*> (d); nt = ph->info ()->type_; @@ -358,8 +356,7 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t) } case AST_Decl::NT_typedef: { - AST_Typedef *td = - AST_Typedef::narrow_from_decl (d); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (d); nt = td->primitive_base_type ()->node_type (); @@ -399,7 +396,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) { @@ -445,9 +442,7 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t) AST_Argument * AST_Operation::fe_add_argument (AST_Argument *t) { - return - AST_Argument::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_Argument*> (this->fe_add_decl (t)); } // Dump this AST_Operation node (an operation) to the ostream o. 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_sequence.cpp b/TAO/TAO_IDL/ast/ast_sequence.cpp index 0ab4820c2da..f0b69d680b9 100644 --- a/TAO/TAO_IDL/ast/ast_sequence.cpp +++ b/TAO/TAO_IDL/ast/ast_sequence.cpp @@ -113,8 +113,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); + AST_Param_Holder *ph = dynamic_cast<AST_Param_Holder*> (bt); if (ph->info ()->type_ == AST_Decl::NT_const) { @@ -159,7 +158,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 +172,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 (); } diff --git a/TAO/TAO_IDL/ast/ast_structure.cpp b/TAO/TAO_IDL/ast/ast_structure.cpp index 0bd62aa3c8c..46257ee4215 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 ()) { @@ -350,17 +350,13 @@ AST_Structure::fe_add_structure (AST_Structure *t) AST_Union * AST_Structure::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_Enum * AST_Structure::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)); } // Add this AST_EnumVal node (an enumerator declaration) to this scope. @@ -370,9 +366,7 @@ AST_Structure::fe_add_enum (AST_Enum *t) AST_EnumVal * AST_Structure::fe_add_enum_val (AST_EnumVal *t) { - return - AST_EnumVal::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_EnumVal*> (this->fe_add_decl (t)); } // Compute total number of members. @@ -450,7 +444,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 +452,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 +546,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 +560,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")); } } diff --git a/TAO/TAO_IDL/ast/ast_template_module.cpp b/TAO/TAO_IDL/ast/ast_template_module.cpp index 364040dc4ca..0e1861578c8 100644 --- a/TAO/TAO_IDL/ast/ast_template_module.cpp +++ b/TAO/TAO_IDL/ast/ast_template_module.cpp @@ -61,8 +61,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); + AST_Typedef *td = dynamic_cast<AST_Typedef*> (d); d = td->primitive_base_type (); } @@ -77,8 +76,7 @@ AST_Template_Module::match_arg_names (FE_Utils::T_ARGLIST *args) if (n == 0) { - AST_Constant *c = - AST_Constant::narrow_from_decl (d); + AST_Constant *c = dynamic_cast<AST_Constant*> (d); s = c->exprtype_to_string (); } @@ -105,7 +103,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 (); } @@ -161,9 +159,7 @@ AST_Template_Module_Ref * AST_Template_Module::fe_add_template_module_ref ( AST_Template_Module_Ref *m) { - return - AST_Template_Module_Ref::narrow_from_decl ( - this->fe_add_ref_decl (m)); + return dynamic_cast<AST_Template_Module_Ref*> (this->fe_add_ref_decl (m)); } void @@ -182,7 +178,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 (); } @@ -190,8 +186,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); + AST_Constant *c = dynamic_cast<AST_Constant*> (d); AST_Expression *ex = c->constant_value (); diff --git a/TAO/TAO_IDL/ast/ast_template_module_inst.cpp b/TAO/TAO_IDL/ast/ast_template_module_inst.cpp index 1156d1b020d..3fc794178ec 100644 --- a/TAO/TAO_IDL/ast/ast_template_module_inst.cpp +++ b/TAO/TAO_IDL/ast/ast_template_module_inst.cpp @@ -27,8 +27,7 @@ AST_Template_Module_Inst::~AST_Template_Module_Inst (void) AST_Template_Module * AST_Template_Module_Inst::ref (void) const { - return - AST_Template_Module::narrow_from_decl (this->field_type ()); + return dynamic_cast<AST_Template_Module*> (this->field_type ()); } FE_Utils::T_ARGLIST const * diff --git a/TAO/TAO_IDL/ast/ast_template_module_ref.cpp b/TAO/TAO_IDL/ast/ast_template_module_ref.cpp index 4110fe518d6..759a2e75fd2 100644 --- a/TAO/TAO_IDL/ast/ast_template_module_ref.cpp +++ b/TAO/TAO_IDL/ast/ast_template_module_ref.cpp @@ -30,8 +30,7 @@ AST_Template_Module_Ref::~AST_Template_Module_Ref (void) AST_Template_Module * AST_Template_Module_Ref::ref (void) const { - return - AST_Template_Module::narrow_from_decl (this->field_type ()); + return dynamic_cast<AST_Template_Module*> (this->field_type ()); } UTL_StrList * diff --git a/TAO/TAO_IDL/ast/ast_type.cpp b/TAO/TAO_IDL/ast/ast_type.cpp index 899ab6257ca..0c804a4b461 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 (); } diff --git a/TAO/TAO_IDL/ast/ast_typedef.cpp b/TAO/TAO_IDL/ast/ast_typedef.cpp index 4d682812334..26c82596f08 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; diff --git a/TAO/TAO_IDL/ast/ast_union.cpp b/TAO/TAO_IDL/ast/ast_union.cpp index ba352d8d7e6..4cbc23e025e 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) { @@ -265,8 +265,7 @@ AST_Union::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list) !si.is_done (); si.next ()) { - AST_UnionBranch *field = - AST_UnionBranch::narrow_from_decl (si.item ()); + AST_UnionBranch *field = dynamic_cast<AST_UnionBranch*> (si.item ()); if (field == 0) // This will be an enum value or other legitimate non-field @@ -279,7 +278,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 +322,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 +374,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 +404,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 +449,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) { @@ -548,8 +547,7 @@ AST_Union::compute_default_value (void) si.next ()) { // Get the next AST decl node. - AST_UnionBranch *ub = - AST_UnionBranch::narrow_from_decl (si.item ()); + AST_UnionBranch *ub = dynamic_cast<AST_UnionBranch*> (si.item ()); if (ub != 0) { @@ -715,8 +713,7 @@ AST_Union::compute_default_value (void) si.next ()) { // Get the next AST decl node - AST_UnionBranch *ub = - AST_UnionBranch::narrow_from_decl (si.item ()); + AST_UnionBranch *ub = dynamic_cast<AST_UnionBranch*> (si.item ()); if (ub != 0) { @@ -895,7 +892,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) { @@ -924,17 +921,13 @@ AST_Union::compute_default_index (void) AST_UnionBranch * AST_Union::fe_add_union_branch (AST_UnionBranch *t) { - return - AST_UnionBranch::narrow_from_decl ( - this->fe_add_ref_decl (t)); + return dynamic_cast<AST_UnionBranch*> (this->fe_add_ref_decl (t)); } AST_Union * AST_Union::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_Structure * @@ -946,9 +939,7 @@ AST_Union::fe_add_structure (AST_Structure *t) AST_Enum * AST_Union::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)); } // Add this AST_EnumVal node (enumerator declaration) to this scope. @@ -958,9 +949,7 @@ AST_Union::fe_add_enum (AST_Enum *t) AST_EnumVal * AST_Union::fe_add_enum_val (AST_EnumVal *t) { - return - AST_EnumVal::narrow_from_decl ( - this->fe_add_decl (t)); + return dynamic_cast<AST_EnumVal*> (this->fe_add_decl (t)); } // Dump this AST_Union node to the ostream o. @@ -1001,7 +990,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 +1005,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")); } } diff --git a/TAO/TAO_IDL/ast/ast_union_branch.cpp b/TAO/TAO_IDL/ast/ast_union_branch.cpp index e0a205b9a87..8952cdfab21 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) diff --git a/TAO/TAO_IDL/ast/ast_valuetype.cpp b/TAO/TAO_IDL/ast/ast_valuetype.cpp index 2f27d8ed3e6..019e9aa38e9 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) { @@ -275,8 +275,7 @@ AST_ValueType::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); @@ -357,7 +356,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) @@ -477,9 +476,7 @@ AST_ValueType::fe_add_field (AST_Field *t) AST_Factory * AST_ValueType::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)); } bool @@ -496,8 +493,7 @@ AST_ValueType::derived_from_primary_key_base (const AST_ValueType *node, return true; } - AST_ValueType *concrete_parent = - AST_ValueType::narrow_from_decl (node->inherits_concrete ()); + AST_ValueType *concrete_parent = dynamic_cast<AST_ValueType*> (node->inherits_concrete ()); if (this->derived_from_primary_key_base (concrete_parent, pk_base)) { @@ -508,7 +504,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 +539,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) { diff --git a/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp b/TAO/TAO_IDL/ast/ast_visitor_reifying.cpp index 0a6132034c6..bfece5f5e12 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; @@ -378,8 +378,7 @@ ast_visitor_reifying::visit_array (AST_Array *node) -1); } - AST_Constant *c = - AST_Constant::narrow_from_decl (this->reified_node_); + AST_Constant *c = dynamic_cast<AST_Constant*> (this->reified_node_); ACE_NEW_RETURN (v, AST_Expression (c->constant_value (), @@ -448,7 +447,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 (); @@ -465,8 +464,7 @@ ast_visitor_reifying::visit_sequence (AST_Sequence *node) -1); } - AST_Constant *c = - AST_Constant::narrow_from_decl (this->reified_node_); + AST_Constant *c = dynamic_cast<AST_Constant*> (this->reified_node_); v = c->constant_value (); } @@ -515,8 +513,7 @@ ast_visitor_reifying::visit_string (AST_String *node) -1); } - AST_Constant *c = - AST_Constant::narrow_from_decl (this->reified_node_); + AST_Constant *c = dynamic_cast<AST_Constant*> (this->reified_node_); b = c->constant_value (); } @@ -645,7 +642,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..e2ffabd2391 100644 --- a/TAO/TAO_IDL/ast/ast_visitor_tmpl_module_inst.cpp +++ b/TAO/TAO_IDL/ast/ast_visitor_tmpl_module_inst.cpp @@ -263,9 +263,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 ( - this->reify_type (node->provides_type ())); + AST_Type *p_type = dynamic_cast<AST_Type*> (this->reify_type (node->provides_type ())); AST_Provides *added_provides = idl_global->gen ()->create_provides (&sn, @@ -281,9 +279,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 ( - this->reify_type (node->uses_type ())); + AST_Type *u_type = dynamic_cast<AST_Type*> (this->reify_type (node->uses_type ())); AST_Uses *added_uses = idl_global->gen ()->create_uses (&sn, @@ -301,7 +297,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 +315,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 = @@ -335,9 +331,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 ( - this->reify_type (node->consumes_type ())); + AST_Type *c_type = dynamic_cast<AST_Type*> (this->reify_type (node->consumes_type ())); AST_Consumes *added_consumes = idl_global->gen ()->create_consumes (&sn, c_type); @@ -351,9 +345,7 @@ int ast_visitor_tmpl_module_inst::visit_extended_port ( AST_Extended_Port *node) { - AST_PortType *pt = - AST_PortType::narrow_from_decl ( - this->reify_type (node->port_type ())); + AST_PortType *pt = dynamic_cast<AST_PortType*> (this->reify_type (node->port_type ())); UTL_ScopedName sn (node->local_name (), 0); @@ -369,9 +361,7 @@ int ast_visitor_tmpl_module_inst::visit_mirror_port ( AST_Mirror_Port *node) { - AST_PortType *pt = - AST_PortType::narrow_from_decl ( - this->reify_type (node->port_type ())); + AST_PortType *pt = dynamic_cast<AST_PortType*> (this->reify_type (node->port_type ())); UTL_ScopedName sn (node->local_name (), 0); @@ -386,9 +376,7 @@ ast_visitor_tmpl_module_inst::visit_mirror_port ( int ast_visitor_tmpl_module_inst::visit_connector (AST_Connector *node) { - AST_Connector *parent = - AST_Connector::narrow_from_decl ( - this->reify_type (node->base_connector ())); + AST_Connector *parent = dynamic_cast<AST_Connector*> (this->reify_type (node->base_connector ())); UTL_ScopedName sn (node->local_name (), 0); @@ -431,9 +419,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 ( - this->reify_type (node->managed_component ())); + AST_Component *managed_comp = dynamic_cast<AST_Component*> (this->reify_type (node->managed_component ())); if (managed_comp != 0) { @@ -442,9 +428,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 ( - this->reify_type (node->primary_key ())); + AST_ValueType *p_key = dynamic_cast<AST_ValueType*> (this->reify_type (node->primary_key ())); if (p_key != 0) { @@ -593,7 +577,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 +592,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 +668,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 +736,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 +943,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 +972,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 +1014,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 +1040,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 +1080,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 +1146,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 +1271,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 +1300,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..dd09bd479ec 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; diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp index 5c7ef0972f2..34d584dd4f8 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 ()) + "::" diff --git a/TAO/TAO_IDL/be/be_attribute.cpp b/TAO/TAO_IDL/be/be_attribute.cpp index 3e0931ae0bf..27c06d3ed6b 100644 --- a/TAO/TAO_IDL/be/be_attribute.cpp +++ b/TAO/TAO_IDL/be/be_attribute.cpp @@ -44,16 +44,14 @@ 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)); } } be_type * be_attribute::field_type (void) const { - return - be_type::narrow_from_decl ( - this->AST_Attribute::field_type ()); + return dynamic_cast<be_type*> (this->AST_Attribute::field_type ()); } int diff --git a/TAO/TAO_IDL/be/be_component.cpp b/TAO/TAO_IDL/be/be_component.cpp index be0855463bf..0835042cb27 100644 --- a/TAO/TAO_IDL/be/be_component.cpp +++ b/TAO/TAO_IDL/be/be_component.cpp @@ -80,15 +80,13 @@ be_component::~be_component (void) be_component * be_component::base_component (void) const { - return - be_component::narrow_from_decl ( - this->AST_Component::base_component ()); + return 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); } @@ -197,7 +195,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 +205,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 +228,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 +261,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 +278,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 +400,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 +410,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 +419,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_connector.cpp b/TAO/TAO_IDL/be/be_connector.cpp index b1c4c1c68a9..f2314613a40 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) { diff --git a/TAO/TAO_IDL/be/be_consumes.cpp b/TAO/TAO_IDL/be/be_consumes.cpp index 479ef491ae5..ababb8e4673 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 ()); } diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index 51b8d05803b..cf8b601abd6 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; } } diff --git a/TAO/TAO_IDL/be/be_emits.cpp b/TAO/TAO_IDL/be/be_emits.cpp index af1edb18102..22c4e4b2dfe 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 ()); } diff --git a/TAO/TAO_IDL/be/be_extended_port.cpp b/TAO/TAO_IDL/be/be_extended_port.cpp index bf7be8e98b8..ff9b622e4a6 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 ()); } diff --git a/TAO/TAO_IDL/be/be_field.cpp b/TAO/TAO_IDL/be/be_field.cpp index fd54c73baf2..995371731b4 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, 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..84f77f66a88 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) { 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..37c651ade8a 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) diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp index 79415551ea4..a7805b5418c 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); } diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp index 5422f80cd0a..55a8c7ca7f7 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; 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_publishes.cpp b/TAO/TAO_IDL/be/be_publishes.cpp index 7920c556635..02a09249c26 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 ()); } diff --git a/TAO/TAO_IDL/be/be_scope.cpp b/TAO/TAO_IDL/be/be_scope.cpp index 90439922ea7..0ba6ed76554 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; } diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index 76a067fcad0..13c8923cebb 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, diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp index 75224d09216..06a9f79708d 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) diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp index 5a429a23a46..f1d0f9fe6e4 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) { diff --git a/TAO/TAO_IDL/be/be_typedef.cpp b/TAO/TAO_IDL/be/be_typedef.cpp index 2763137e85d..edad611c31a 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 (); } diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp index 2493aed1c23..7073184e51f 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) { diff --git a/TAO/TAO_IDL/be/be_union_branch.cpp b/TAO/TAO_IDL/be/be_union_branch.cpp index 17dd1156d16..5f9749147c2 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) diff --git a/TAO/TAO_IDL/be/be_uses.cpp b/TAO/TAO_IDL/be/be_uses.cpp index 1837fb30a19..eb453a2f76b 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 ()); } 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_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp index eeb9d21a15f..3dd6cef7936 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 (); 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 9a04b9cdcee..981748a1c9c 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp @@ -99,7 +99,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) { @@ -112,7 +112,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 ee231965520..c01a63cfe06 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp @@ -100,7 +100,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) { @@ -113,7 +113,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 efbda64eb3c..d51ec479dd2 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 @@ -87,15 +87,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 ()); } } @@ -114,7 +114,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 @@ -129,7 +129,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 a27a8fe2c17..0476d0dcec0 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_exh.cpp @@ -143,7 +143,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 ( @@ -162,7 +162,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 e90bafd8c17..90b2793691e 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_exs.cpp @@ -154,7 +154,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 (); @@ -180,7 +180,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 34021327cc2..b72911fba77 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp @@ -86,7 +86,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 (); @@ -215,7 +215,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 ( @@ -234,7 +234,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 018a02101dd..9f6f2a969bb 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp @@ -101,7 +101,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 (); @@ -345,7 +345,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 (); @@ -372,7 +372,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; @@ -458,7 +458,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) { @@ -470,7 +470,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/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/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..0a4089dfa79 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); } diff --git a/TAO/orbsvcs/IFR_Service/be_produce.cpp b/TAO/orbsvcs/IFR_Service/be_produce.cpp index 3590aaad0f8..2774ca20bfb 100644 --- a/TAO/orbsvcs/IFR_Service/be_produce.cpp +++ b/TAO/orbsvcs/IFR_Service/be_produce.cpp @@ -151,7 +151,7 @@ BE_produce (void) // Get the root node. AST_Decl *d = idl_global->root (); - AST_Root *root = AST_Root::narrow_from_decl (d); + AST_Root *root = dynamic_cast<AST_Root*> (d); if (root == 0) { diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp index da0846fb285..057e05a5013 100644 --- a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp +++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp @@ -1021,7 +1021,7 @@ ifr_adding_visitor::visit_component_fwd (AST_ComponentFwd *node) } AST_Component *c = - AST_Component::narrow_from_decl (node->full_definition ()); + dynamic_cast<AST_Component*> (node->full_definition ()); try { @@ -1872,7 +1872,7 @@ ifr_adding_visitor::visit_field (AST_Field *node) return this->create_value_member (node); } - AST_Type *ft = AST_Type::narrow_from_decl (node->field_type ()); + AST_Type *ft = dynamic_cast<AST_Type*> (node->field_type ()); if (ft == 0) { @@ -2738,7 +2738,7 @@ ifr_adding_visitor::create_interface_def (AST_Interface *node) for (CORBA::ULong i = 0; i < n_parents; ++i) { AST_Interface *intf = - AST_Interface::narrow_from_decl (parents[i]); + dynamic_cast<AST_Interface*> (parents[i]); if (intf == 0) { @@ -2800,7 +2800,7 @@ ifr_adding_visitor::create_interface_def (AST_Interface *node) for (CORBA::ULong i = 0; i < n_parents; ++i) { AST_Interface *intf = - AST_Interface::narrow_from_decl (parents[i]); + dynamic_cast<AST_Interface*> (parents[i]); if (intf == 0) { @@ -3719,21 +3719,21 @@ ifr_adding_visitor::fill_supported_interfaces (CORBA::InterfaceDefSeq &result, case AST_Decl::NT_valuetype: case AST_Decl::NT_eventtype: { - AST_ValueType *v = AST_ValueType::narrow_from_decl (node); + AST_ValueType *v = dynamic_cast<AST_ValueType*> (node); s_length = v->n_supports (); list = v->supports (); break; } case AST_Decl::NT_component: { - AST_Component *c = AST_Component::narrow_from_decl (node); + AST_Component *c = dynamic_cast<AST_Component*> (node); s_length = c->n_supports (); list = c->supports (); break; } case AST_Decl::NT_home: { - AST_Home *h = AST_Home::narrow_from_decl (node); + AST_Home *h = dynamic_cast<AST_Home*> (node); s_length = h->n_supports (); list = h->supports (); break; @@ -3788,7 +3788,7 @@ ifr_adding_visitor::fill_initializers (CORBA::ExtInitializerSeq &result, if (item->node_type () == AST_Decl::NT_factory) { - factories.push_back (AST_Factory::narrow_from_decl (item)); + factories.push_back (dynamic_cast<AST_Factory*> (item)); } } @@ -3819,7 +3819,7 @@ ifr_adding_visitor::fill_initializers (CORBA::ExtInitializerSeq &result, !f_iter.is_done (); f_iter.next (), ++index) { - arg = AST_Argument::narrow_from_decl (f_iter.item ()); + arg = dynamic_cast<AST_Argument*> (f_iter.item ()); result[i].members[index].name = CORBA::string_dup (arg->local_name ()->get_string ()); result[i].members[index].type = @@ -3850,7 +3850,7 @@ ifr_adding_visitor::fill_initializers (CORBA::ExtInitializerSeq &result, !ei.is_done (); ei.next ()) { - excp = AST_Exception::narrow_from_decl (ei.item ()); + excp = dynamic_cast<AST_Exception*> (ei.item ()); result[i].exceptions[index].name = CORBA::string_dup (excp->local_name ()->get_string ()); result[i].exceptions[index].id = excp->repoID (); @@ -3887,7 +3887,7 @@ ifr_adding_visitor::fill_exceptions (CORBA::ExceptionDefSeq &result, { case AST_Decl::NT_op: { - AST_Operation *op = AST_Operation::narrow_from_decl (node); + AST_Operation *op = dynamic_cast<AST_Operation*> (node); this->fill_exceptions (result, op->exceptions ()); return; @@ -3895,7 +3895,7 @@ ifr_adding_visitor::fill_exceptions (CORBA::ExceptionDefSeq &result, case AST_Decl::NT_factory: case AST_Decl::NT_finder: { - AST_Factory *f = AST_Factory::narrow_from_decl (node); + AST_Factory *f = dynamic_cast<AST_Factory*> (node); this->fill_exceptions (result, f->exceptions ()); return; @@ -3954,7 +3954,7 @@ ifr_adding_visitor::fill_params (CORBA::ParDescriptionSeq &result, ! iter.is_done (); iter.next (), ++index) { - arg = AST_Argument::narrow_from_decl (iter.item ()); + arg = dynamic_cast<AST_Argument*> (iter.item ()); result[index].name = CORBA::string_dup (arg->local_name ()->get_string ()); result[index].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void); @@ -3989,7 +3989,7 @@ ifr_adding_visitor::visit_all_factories (AST_Home *node, continue; } - AST_Factory *f = AST_Factory::narrow_from_decl (d); + AST_Factory *f = dynamic_cast<AST_Factory*> (d); CORBA::ParDescriptionSeq params; this->fill_params (params, f); @@ -4018,7 +4018,7 @@ ifr_adding_visitor::visit_all_finders (AST_Home *node, !h_iter.is_done (); h_iter.next ()) { - f = AST_Finder::narrow_from_decl (h_iter.item ()); + f = dynamic_cast<AST_Finder*> (h_iter.item ()); if (f == 0) { diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.cpp index 085e7f1d617..e1bc9432a95 100644 --- a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.cpp +++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.cpp @@ -35,9 +35,9 @@ ifr_adding_visitor_exception::visit_scope (UTL_Scope *node) return ifr_adding_visitor::visit_scope (node); } - AST_Exception *e = AST_Exception::narrow_from_scope (node); + AST_Exception *e = dynamic_cast<AST_Exception*> (node); - CORBA::ULong nfields = static_cast<CORBA::ULong> (e->nfields ()); + CORBA::ULong const nfields = static_cast<CORBA::ULong> (e->nfields ()); this->members_.length (nfields); diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.cpp index b2ef423353d..19227166b8e 100644 --- a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.cpp +++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.cpp @@ -29,8 +29,8 @@ ifr_adding_visitor_structure::visit_scope (UTL_Scope *node) return ifr_adding_visitor::visit_scope (node); } - AST_Structure *s = AST_Structure::narrow_from_scope (node); - CORBA::ULong nfields = static_cast<CORBA::ULong> (s->nfields ()); + AST_Structure *s = dynamic_cast<AST_Structure*> (node); + CORBA::ULong const nfields = static_cast<CORBA::ULong> (s->nfields ()); this->members_.length (nfields); AST_Field **f = 0; diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.cpp index 0ef2385edad..37915ca0a5f 100644 --- a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.cpp +++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.cpp @@ -33,9 +33,9 @@ ifr_adding_visitor_union::visit_scope (UTL_Scope *node) return ifr_adding_visitor::visit_scope (node); } - AST_Union *u = AST_Union::narrow_from_scope (node); + AST_Union *u = dynamic_cast<AST_Union*> (node); - CORBA::ULong nfields = static_cast<CORBA::ULong> (u->nfields ()); + CORBA::ULong const nfields = static_cast<CORBA::ULong> (u->nfields ()); this->members_.length (nfields); @@ -111,7 +111,7 @@ ifr_adding_visitor_union::visit_scope (UTL_Scope *node) // Get the case label(s). AST_UnionLabel *case_label = 0; - AST_UnionBranch *ub = AST_UnionBranch::narrow_from_decl (*f); + AST_UnionBranch *ub = dynamic_cast<AST_UnionBranch*> (*f); unsigned long len = ub->label_list_length (); // If there are multiple case labels, we will have an element |