summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp85
1 files changed, 6 insertions, 79 deletions
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 6c178833f3a..2d103aca25b 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
@@ -48,65 +48,6 @@ be_visitor_typecode_defn::~be_visitor_typecode_defn (void)
this->queue_reset (this->compute_queue_);
}
-int
-be_visitor_typecode_defn::visit_members (AST_Structure *node)
-{
- this->elem_number_ = 0;
-
- AST_Field **member_ptr = 0;
- size_t count = node->nfields ();
-
- for (size_t i = 0; i < count; ++i)
- {
- node->field (member_ptr, i);
-
- be_decl *bd = be_decl::narrow_from_decl (*member_ptr);
-
- // Set the node to be visited.
- this->ctx_->node (bd);
- this->elem_number_++;
-
- // Do any pre processing using the next item info.
- if (this->pre_process (bd) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::visit_members - "
- "pre processing failed\n"
- ),
- -1
- );
- }
-
- // Send the visitor.
- if (bd == 0 || bd->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::visit_members - "
- "codegen for scope failed\n"
- ),
- -1
- );
-
- }
-
- // Do any post processing using this item info.
- if (this->post_process (bd) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::visit_members - "
- "post processing failed\n"
- ),
- -1
- );
- }
- }
-
- return 0;
-}
-
// the following needs to be done to deal with the most bizarre behavior of
// MSVC++ compiler
int
@@ -427,7 +368,7 @@ be_visitor_typecode_defn::visit_exception (be_exception *node)
return ((this->computed_encap_len_ > 0) ? 0 : -1);
case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_members (node);
+ return this->visit_scope (node);
default:
// error
break;
@@ -613,7 +554,7 @@ be_visitor_typecode_defn::visit_structure (be_structure *node)
return ((this->computed_encap_len_ > 0) ? 0 : -1);
case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_members (node);
+ return this->visit_scope (node);
default:
// error
break;
@@ -676,7 +617,7 @@ be_visitor_typecode_defn::visit_union (be_union *node)
return ((this->computed_encap_len_ > 0) ? 0 : -1);
case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_members (node);
+ return this->visit_scope (node);
default:
// error
break;
@@ -1033,7 +974,6 @@ be_visitor_typecode_defn::gen_typecode (be_exception *node)
// now emit the encapsulation
this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
-
if (node->accept (this) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -1069,18 +1009,12 @@ be_visitor_typecode_defn::gen_encapsulation (be_exception *node)
// generate the member count
os->indent ();
- *os << node->nfields () << ", // member count\n";
+ *os << node->member_count () << ", // member count\n";
// size of the member count
this->tc_offset_ += sizeof (ACE_CDR::ULong);
// hand over to the scope to generate the typecode for elements
this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
-
- // 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.
- this->ctx_->scope (node);
-
if (node->accept (this) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -1619,13 +1553,12 @@ be_visitor_typecode_defn::gen_encapsulation (be_structure *node)
// generate the member count
os->indent ();
- *os << node->nfields () << ", // member count\n";
+ *os << node->member_count () << ", // member count\n";
// size of the member count
this->tc_offset_ += sizeof (ACE_CDR::ULong);
// hand over to the scope to generate the typecode for elements
this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
-
if (node->accept (this) == -1)
{
ACE_ERROR ((LM_ERROR, "be_structure: cannot generate typecode for members\n"));
@@ -1864,18 +1797,12 @@ be_visitor_typecode_defn::gen_encapsulation (be_union *node)
this->tc_offset_ += sizeof (ACE_CDR::ULong);
// generate the member count
- *os << node->nfields () << ", // member count\n";
+ *os << node->member_count () << ", // member count\n";
// size of the member count
this->tc_offset_ += sizeof (ACE_CDR::ULong);
// hand over to the scope to generate the typecode for elements
this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
-
- // 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.
- this->ctx_->scope (node);
-
if (node->accept (this) == -1)
{
ACE_ERROR ((LM_ERROR, "be_union: cannot generate code for members\n"));