summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-06-15 15:35:08 +0000
committervzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-06-15 15:35:08 +0000
commit6fb54f8c3fd4ddc1759ebbdac55ed6be8534484b (patch)
treeeaf8b5dcde19a78919a1775d2fad1a36f9e9e6ff
parentb76616e2588884364ac60beb0269907998925f70 (diff)
downloadATCD-6fb54f8c3fd4ddc1759ebbdac55ed6be8534484b.tar.gz
Tue Jun 15 15:24:25 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
* tests/Bug_3821_Regression/Bug_3821_Regression.mpc: Disabled generation of skeleton files as the test only needs stubs. * TAO_IDL/be/be_union_branch.cpp: * TAO_IDL/be/be_visitor_union/union_cs.cpp: Changed generation of constructor for IDL unions. Now constructor sets disc_ member directly without a call to _default(). The later was problematic because before setting disc_ _default() called _reset() which used disc_ in switch statement.
-rw-r--r--TAO/ChangeLog96
-rw-r--r--TAO/TAO_IDL/be/be_union_branch.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp94
-rw-r--r--TAO/tests/Bug_3821_Regression/Bug_3821_Regression.mpc2
4 files changed, 101 insertions, 93 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index b7b57083340..742cea08233 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,21 +1,33 @@
+Tue Jun 15 15:24:25 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+
+ * tests/Bug_3821_Regression/Bug_3821_Regression.mpc:
+ Disabled generation of skeleton files as the test only needs stubs.
+
+ * TAO_IDL/be/be_union_branch.cpp:
+ * TAO_IDL/be/be_visitor_union/union_cs.cpp:
+ Changed generation of constructor for IDL unions. Now constructor
+ sets disc_ member directly without a call to _default(). The later
+ was problematic because before setting disc_ _default() called
+ _reset() which used disc_ in switch statement.
+
Tue Jun 15 14:14:36 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_argument/argument.cpp(type_name):
-
+
Restored generation of a leading double colon that was lost
in the recent merge of the alt_mapping branch.
Tue Jun 15 14:02:32 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/AnyTypeCode/Any.cpp:
-
+
Removed id of unused parameters.
Mon Jun 14 18:48:29 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/Basic_Arguments.h:
* tao/PortableServer/Basic_SArguments.h:
-
+
Updated syntax of TAO::Any_Insert_Policy_Stream template
parameter, which had changed since the alt_mapping
branch was created.
@@ -23,23 +35,23 @@ Mon Jun 14 18:48:29 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Mon Jun 14 18:34:19 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_global.cpp:
-
+
Added member alt_mapping_ initialization in the constructor.
Mon Jun 14 18:29:53 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_arg_traits.cpp:
-
+
Removed unused variable.
-
+
* TAO_IDL/be/be_codegen.cpp:
-
+
Added newline to #include generation.
Mon Jun 14 15:15:21 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/AnyTypeCodeAny.cpp:
-
+
Removed some ACE_INLINE macros that came with a branch merge.
Mon Jun 14 13:45:43 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
@@ -49,27 +61,27 @@ Mon Jun 14 13:45:43 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Tue May 11 16:16:18 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_argument/arglist.cpp:
-
+
Added missing global double colon in generation of enum argument.
Fri May 7 19:44:31 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_operation/operation.cpp:
-
+
Added a check to generate the SArg_Trait parameter for
the repo id arg to _is_a() as char* instead of std::string.
We would have to regenerate ORB code for that to work,
and it may be a choice later on to do that.
-
+
* TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp:
* TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp:
-
+
To set the length of a sequence, changed the call to the
underlying vector from capacity() to resize() - capacity()
wasn't behaving as expected.
-
+
* tests/Alt_Mapping/ub_struct_seq.cpp:
-
+
Cosmetic changes, and other changes in parameter init
and results checking to make debugging easier.
@@ -158,19 +170,19 @@ Mon Jun 14 13:45:43 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Mon Apr 12 19:30:47 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_codegen.cpp:
-
+
Added conditional include of vector argument class
header file.
-
+
* TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp:
-
+
Fixed typos in generated code, and added check to
skip bounded sequences for now.
-
+
* tao/Vector_Argument_T.inl:
* tao/Vector_Argument_T.h:
* tao/Vector_Argument_T.cpp:
-
+
Overhauled signatures of most methods.
Fri Apr 9 20:39:11 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
@@ -224,30 +236,30 @@ Mon Jun 14 13:45:43 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_codegen.cpp:
* TAO_IDL/be_visitor_sequence/any_op_cs.cpp:
-
+
Minor mods to codegen for STL includes and STL any
operators.
Mon Mar 29 18:49:32 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp:
-
+
Cosmetic changes.
-
+
* TAO_IDL/be/be_codegen.cpp:
-
+
Added generation of includes for CDR and Any operator
template header files.
-
+
* TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp:
* TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp:
-
+
Added code generation for Any insertions and extraction
operators for std::vector<> types representing IDL
sequences.
-
+
* TAO_IDL/be/be_global.cpp:
-
+
Added command line option to trigger code generation for
alternate C++ mapping.
@@ -255,28 +267,28 @@ Mon Jun 14 13:45:43 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/AnyTypeCode/Any.h:
* tao/AnyTypeCode/Any.cpp:
-
+
Added non-copying Any insertion operator for std::string.
Not yet implemented, still a no-op.
-
+
* tao/tao.mpc:
* tao/Vector_AnyOp_T.h:
-
+
Moved this template file to the AnyTypeCode directory.
Mon Mar 29 17:13:54 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/Vector_CDR_T.h:
-
+
Cosmetic changes.
-
+
* tao/Vector_AnyOp_T.h:
-
+
New file defining no-op Any insertion and extraction operators
for std::vector, in various categories of element types.
-
+
* tao/tao.mpc:
-
+
Added above files to the MPC project.
Tue Mar 2 23:18:32 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
@@ -334,22 +346,22 @@ Mon Jun 14 13:45:43 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/Basic_Arguments.h:
* tao/PortableServer/Basic_SArguments.h:
-
+
Added specializations Arg_Traits<std::string> and
SArg_Traits<std::string>.
-
+
* tests/Param_Test/param_testC.cpp:
-
+
Removed specializations Arg_Traits<std::string>
since it is now in the ORB (see above).
-
+
Fri Jun 11 19:15:30 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/be/be_visitor_ccm_pre_proc.cpp(create_equivalent):
-
+
Changed creation of implied IDL home equivalent interface
to call add_to_scope() instead of be_add_interface() since
- the latter calls add_to_referenced() which gives us a
+ the latter calls add_to_referenced() which gives us a
bogus redefinition error.
Fri Jun 11 17:16:00 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
@@ -360,7 +372,7 @@ Fri Jun 11 17:16:00 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/fe/lex.yy.cpp:
* TAO_IDL/fe/idl.ll:
* TAO_IDL/util/utl_global.cpp:
-
+
Implemented a new pragma for AMI4CCM 'ciao ami4ccm idl' that
enables us to generate an include (in the component stub header
file) that exposes the AMI4CCM_* version of a uses multiple
diff --git a/TAO/TAO_IDL/be/be_union_branch.cpp b/TAO/TAO_IDL/be/be_union_branch.cpp
index c79d5c50a1b..f3f466cc9b7 100644
--- a/TAO/TAO_IDL/be/be_union_branch.cpp
+++ b/TAO/TAO_IDL/be/be_union_branch.cpp
@@ -133,7 +133,7 @@ be_union_branch::gen_default_label_value (TAO_OutStream *os,
*os << dv.u.ulong_val;
break;
case AST_Expression::EV_char:
- os->print ("%d", dv.u.char_val);
+ os->print ("'\\%o'", dv.u.char_val);
break;
case AST_Expression::EV_bool:
*os << (dv.u.bool_val == 0 ? "false" : "true");
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 ba1b609706b..30be226815e 100644
--- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp
@@ -87,69 +87,63 @@ int be_visitor_union_cs::visit_union (be_union *node)
<< "{" << be_idt_nl
<< "ACE_OS::memset (&this->u_, 0, sizeof (this->u_));" << be_nl;
+ // The default constructor must initialize the discriminator
+ // to the first case label value found in the union declaration
+ // so that, if the uninitialized union is inserted into an Any,
+ // the Any destructor's call to deep_free() will work properly.
+
+ *os << "this->disc_ = ";
+
+ UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
+ be_union_branch *ub = 0;
+
+ // In case we have some bogus enum values from an enum declared
+ // in our scope.
+ while (ub == 0)
+ {
+ // Just get the union's first member.
+ AST_Decl *d = si.item ();
+
+ ub = be_union_branch::narrow_from_decl (d);
+ si.next ();
+ }
+
+ // Get the first label in its list.
+ AST_UnionLabel *ul = ub->label (0);
+
AST_Union::DefaultValue dv;
// This can indicate an error in the return value, but it is
// caught elsewhere.
(void) node->default_value (dv);
- if ((dv.computed_ != 0) && node->default_index () == -1)
+
+ bool test = dv.computed_ == 0
+ && ul->label_kind () == AST_UnionLabel::UL_label;
+
+ if (test)
{
- // _default() function has been generated, use this.
- *os << "this->_default ();";
+ ub->gen_label_value (os);
}
else
{
- // The default constructor must initialize the discriminator
- // to the first case label value found in the union declaration
- // so that, if the uninitialized union is inserted into an Any,
- // the Any destructor's call to deep_free() will work properly.
-
- *os << "this->disc_ = ";
-
- UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- be_union_branch *ub = 0;
-
- // In case we have some bogus enum values from an enum declared
- // in our scope.
- while (ub == 0)
- {
- // Just get the union's first member.
- AST_Decl *d = si.item ();
-
- ub = be_union_branch::narrow_from_decl (d);
- si.next ();
- }
-
- // Get the first label in its list.
- AST_UnionLabel *ul = ub->label (0);
-
- bool test = dv.computed_ == 0
- && ul->label_kind () == AST_UnionLabel::UL_label;
-
- if (test)
- {
- ub->gen_label_value (os);
- }
- else
- {
- ub->gen_default_label_value (os, node);
- }
+ ub->gen_default_label_value (os, node);
+ }
- *os << ";";
+ *os << ";";
- if (dv.computed_ == 0)
+ if (dv.computed_ == 0)
+ {
+ *os << be_nl;
+ be_visitor_union_branch_public_constructor_cs const_visitor (this->ctx_);
+ if (ub->accept (&const_visitor) == -1)
{
- *os << be_nl;
- be_visitor_union_branch_public_constructor_cs const_visitor (this->ctx_);
- if (ub->accept (&const_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs::"
- "visit union - "
- "codegen for constructor failed\n"),
- -1);
- }
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_union_cs::"
+ "visit union - "
+ "codegen for constructor failed\n"),
+ -1);
}
}
+
*os << be_uidt_nl << "}" << be_nl << be_nl;
this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS);
diff --git a/TAO/tests/Bug_3821_Regression/Bug_3821_Regression.mpc b/TAO/tests/Bug_3821_Regression/Bug_3821_Regression.mpc
index f409123f946..a38353822bc 100644
--- a/TAO/tests/Bug_3821_Regression/Bug_3821_Regression.mpc
+++ b/TAO/tests/Bug_3821_Regression/Bug_3821_Regression.mpc
@@ -2,6 +2,8 @@
// $Id$
project(*idl): taoidldefaults {
+ idlflags += -SS
+
IDL_Files {
test.idl
}