diff options
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp index 614e272f79e..cff75285ad5 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp @@ -56,29 +56,21 @@ be_visitor_sequence_cdr_op_ci::visit_sequence (be_sequence *node) // If we contain an anonymous sequence, // generate code for the sequence here. - // retrieve the base type - be_type *base = be_type::narrow_from_decl (node->base_type ()); - if (!base) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_sequence_cdr_op_ci::" - "visit_sequence - " - "Bad base type\n"), - -1); - } + // Retrieve the base type. + AST_Type *base = node->base_type (); + AST_Decl::NodeType nt = base->node_type (); - if (base->node_type () == AST_Decl::NT_sequence) + if (nt == AST_Decl::NT_sequence && base->anonymous ()) { - // CDR operators for sequences are now declared in the .i file, - // so we pass this state to the function. - if (this->gen_anonymous_base_type (base, - TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI) - == -1) + be_sequence *bs = be_sequence::narrow_from_decl (base); + be_visitor_sequence_cdr_op_ci visitor (this->ctx_); + + if (bs->accept (&visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_sequence_cdr_op_ci::" + "be_visitor_sequence_cdr_op_ci::" "visit_sequence - " - "gen_anonymous_base_type failed\n"), + "accept on anonymous base type failed\n"), -1); } } |