Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / be / be_argument.cpp
blobdd09bd479ecb7bfda1c3417892a35faba7b62dfa
2 //=============================================================================
3 /**
4 * @file be_argument.cpp
6 * Extension of class AST_Argument that provides additional means for C++
7 * mapping.
9 * @author Copyright 1994-1995 by Sun Microsystems
10 * @author Inc. and Aniruddha Gokhale
12 //=============================================================================
14 #include "be_argument.h"
15 #include "be_type.h"
16 #include "be_visitor.h"
17 #include "be_util.h"
19 #include "nr_extern.h"
20 #include "global_extern.h"
22 be_argument::be_argument (AST_Argument::Direction d,
23 AST_Type *ft,
24 UTL_ScopedName *n)
25 : COMMON_Base (),
26 AST_Decl (AST_Decl::NT_argument,
27 n),
28 AST_Field (AST_Decl::NT_argument,
29 ft,
30 n),
31 AST_Argument (d,
32 ft,
33 n),
34 be_decl (AST_Decl::NT_argument,
37 AST_Decl *dcl = ScopeAsDecl (this->defined_in ());
39 // If there have been previous errors, dcl may be 0,
40 // and we don't want to crash, so we check for non-zero.
41 // Also, we don't want to set the bit if the operation is
42 // declared in an included file UNLESS the enclosing
43 // interface is abstract, in which case we regenerate the
44 // operation.
45 if (dcl != 0
46 && !dcl->is_local ()
47 && (idl_global->in_main_file () || dcl->is_abstract ()))
49 be_type *bt = dynamic_cast<be_type*> (ft);
50 bt->seen_in_operation (true);
51 be_util::set_arg_seen_bit (bt);
52 idl_global->need_skeleton_includes_ = true;
57 int
58 be_argument::accept (be_visitor *visitor)
60 return visitor->visit_argument (this);
63 void
64 be_argument::destroy (void)
66 this->be_decl::destroy ();
67 this->AST_Argument::destroy ();
70 IMPL_NARROW_FROM_DECL (be_argument)