Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_decl.cpp
blobc735b7bcc1333fd3dbbe84a9b5c95e77bfe60871
2 //=============================================================================
3 /**
4 * @file be_visitor_decl.cpp
6 * Visitor for the base be_decl node. This serves to maintain the current
7 * state (context) of code generation for the derived visitor.
9 * @author Aniruddha Gokhale
11 //=============================================================================
13 #include "be_visitor_decl.h"
14 #include "be_visitor_sequence.h"
15 #include "be_visitor_context.h"
16 #include "be_typedef.h"
17 #include "be_type.h"
18 #include "ace/Log_Msg.h"
20 be_visitor_decl::be_visitor_decl (be_visitor_context *ctx)
21 : ctx_ (ctx),
22 os_ (*ctx->stream ())
26 be_visitor_decl::~be_visitor_decl ()
30 be_visitor_context *
31 be_visitor_decl::ctx ()
33 return this->ctx_;
36 int
37 be_visitor_decl::gen_anonymous_base_type (be_type *bt,
38 TAO_CodeGen::CG_STATE cg_state)
40 be_typedef *tdef = dynamic_cast<be_typedef*> (bt);
42 if (!tdef)
44 be_visitor_context ctx (*this->ctx_);
45 ctx.state (cg_state);
47 // In case our container was typedef'd.
48 ctx.tdef (nullptr);
50 int status = 0;
52 switch (cg_state)
54 case TAO_CodeGen::TAO_ROOT_CH:
56 be_visitor_sequence_ch visitor (&ctx);
57 status = bt->accept (&visitor);
58 break;
60 case TAO_CodeGen::TAO_ROOT_CI:
62 break;
64 case TAO_CodeGen::TAO_ROOT_CS:
66 be_visitor_sequence_cs visitor (&ctx);
67 status = bt->accept (&visitor);
68 break;
70 case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
72 be_visitor_sequence_cdr_op_cs visitor (&ctx);
73 status = bt->accept (&visitor);
74 break;
76 default:
77 ACE_ERROR_RETURN ((LM_ERROR,
78 "(%N:%l) be_visitor_decl::"
79 "gen_anonymous_base_type - "
80 "bad context state\n"),
81 -1);
84 if (status == -1)
86 ACE_ERROR_RETURN ((LM_ERROR,
87 "(%N:%l) be_visitor_decl::"
88 "gen_anonymous_base_type - "
89 "anonymous base type codegen failed\n"),
90 -1);
94 return 0;