summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2021-06-21 20:22:55 -0500
committerFred Hornsey <hornseyf@objectcomputing.com>2021-06-21 20:22:55 -0500
commit2ed7fe7c1c6492c7f920581ec3ac8e7ec4278efd (patch)
tree7580b073445bd321afe9b4e3a0764108595c48c6 /TAO/TAO_IDL
parentb489eefef18d6c538d5498350bb732bc51792f50 (diff)
downloadATCD-2ed7fe7c1c6492c7f920581ec3ac8e7ec4278efd.tar.gz
Support int8/uint8 Sequences and Arrays
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r--TAO/TAO_IDL/ast/ast_expression.cpp6
-rw-r--r--TAO/TAO_IDL/ast/ast_sequence.cpp13
-rw-r--r--TAO/TAO_IDL/be/be_predefined_type.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_sequence.cpp164
-rw-r--r--TAO/TAO_IDL/be/be_visitor_any_extracted_type_decl.cpp10
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp20
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp103
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp20
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp20
-rw-r--r--TAO/TAO_IDL/include/ast_sequence.h6
13 files changed, 253 insertions, 167 deletions
diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp
index 36372478e10..d1705399e7f 100644
--- a/TAO/TAO_IDL/ast/ast_expression.cpp
+++ b/TAO/TAO_IDL/ast/ast_expression.cpp
@@ -768,7 +768,7 @@ coerce_value (AST_Expression::AST_ExprValue *ev,
ev->et = AST_Expression::EV_ushort;
return ev;
case AST_Expression::EV_int8:
- if (ev->u.int8val < 0) return 0;
+ if (ev->u.int8val < 0) return nullptr;
ev->u.usval = static_cast<unsigned short> (ev->u.int8val);
ev->et = t;
return ev;
@@ -949,7 +949,7 @@ coerce_value (AST_Expression::AST_ExprValue *ev,
ev->et = AST_Expression::EV_ulong;
return ev;
case AST_Expression::EV_int8:
- if (ev->u.int8val < 0) return 0;
+ if (ev->u.int8val < 0) return nullptr;
ev->u.ulval = static_cast<unsigned long> (ev->u.int8val);
ev->et = t;
return ev;
@@ -1119,7 +1119,7 @@ coerce_value (AST_Expression::AST_ExprValue *ev,
ev->et = AST_Expression::EV_ulonglong;
return ev;
case AST_Expression::EV_int8:
- if (ev->u.int8val < 0) return 0;
+ if (ev->u.int8val < 0) return nullptr;
ev->u.ullval = static_cast<ACE_UINT64> (ev->u.int8val);
ev->et = t;
return ev;
diff --git a/TAO/TAO_IDL/ast/ast_sequence.cpp b/TAO/TAO_IDL/ast/ast_sequence.cpp
index 94dcbd97893..d8b57129573 100644
--- a/TAO/TAO_IDL/ast/ast_sequence.cpp
+++ b/TAO/TAO_IDL/ast/ast_sequence.cpp
@@ -245,6 +245,19 @@ AST_Sequence::base_type () const
return this->pd_base_type;
}
+AST_Type *
+AST_Sequence::primitive_base_type () const
+{
+ AST_Type *type_node = dynamic_cast<AST_Type *> (base_type ());
+ if (type_node && type_node->node_type () == AST_Decl::NT_typedef)
+ {
+ AST_Typedef *typedef_node = dynamic_cast<AST_Typedef*> (type_node);
+ if (typedef_node) return nullptr;
+ type_node = typedef_node->primitive_base_type ();
+ }
+ return type_node;
+}
+
bool
AST_Sequence::unbounded () const
{
diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp
index 77c2f2490ec..09ac9fcb692 100644
--- a/TAO/TAO_IDL/be/be_predefined_type.cpp
+++ b/TAO/TAO_IDL/be/be_predefined_type.cpp
@@ -110,6 +110,14 @@ be_predefined_type::gen_member_ostream_operator (TAO_OutStream *os,
*os << "ACE_OutputCDR::from_wchar (" << instance_name
<< (accessor ? " ()" : "") << ")";
break;
+ case AST_PredefinedType::PT_uint8:
+ *os << "ACE_OutputCDR::from_uint8 (" << instance_name
+ << (accessor ? " ()" : "") << ")";
+ break;
+ case AST_PredefinedType::PT_int8:
+ *os << "ACE_OutputCDR::from_int8 (" << instance_name
+ << (accessor ? " ()" : "") << ")";
+ break;
case AST_PredefinedType::PT_object:
case AST_PredefinedType::PT_abstract:
case AST_PredefinedType::PT_pseudo:
diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp
index e59a718ad6d..abb53381d2b 100644
--- a/TAO/TAO_IDL/be/be_sequence.cpp
+++ b/TAO/TAO_IDL/be/be_sequence.cpp
@@ -95,22 +95,10 @@ be_sequence::be_sequence (AST_Expression *v,
break;
}
- AST_Decl::NodeType nt = t->node_type ();
- AST_Typedef *td = nullptr;
- AST_Type *pbt = nullptr;
-
- if (nt == AST_Decl::NT_typedef)
- {
- td = dynamic_cast<AST_Typedef*> (t);
- pbt = td->primitive_base_type ();
- nt = pbt->node_type ();
- }
-
- if (nt == AST_Decl::NT_pre_defined)
+ AST_Type *const base_type = primitive_base_type ();
+ if (base_type && base_type->node_type () == AST_Decl::NT_pre_defined)
{
- AST_PredefinedType *pdt =
- dynamic_cast<AST_PredefinedType*> (pbt ? pbt : t);
-
+ AST_PredefinedType *pdt = dynamic_cast<AST_PredefinedType*> (base_type);
switch (pdt->pt ())
{
case AST_PredefinedType::PT_octet:
@@ -280,31 +268,16 @@ be_sequence::managed_type ()
if (this->mt_ == be_sequence::MNG_UNKNOWN) // Not calculated yet.
{
// Base types.
- be_type *bt = nullptr;
- be_type *prim_type = nullptr;
-
- bt = dynamic_cast<be_type*> (this->base_type ());
-
- if (!bt)
+ be_type *const base_type = dynamic_cast<be_type*> (primitive_base_type ());
+ if (!base_type)
ACE_ERROR_RETURN ((LM_ERROR,
"TAO_IDL (%N:%l) "
"dynamic_cast<be_type*> "
"failed\n"),
be_sequence::MNG_UNKNOWN);
- if (bt->node_type () == AST_Decl::NT_typedef)
- {
- // Get the primitive base type of this typedef node.
- be_typedef *t = dynamic_cast<be_typedef*> (bt);
- prim_type = t->primitive_base_type ();
- }
- else
- {
- prim_type = bt;
- }
-
// Determine if we need a managed type and which one.
- switch (prim_type->node_type ())
+ switch (base_type->node_type ())
{
case AST_Decl::NT_interface:
case AST_Decl::NT_interface_fwd:
@@ -329,7 +302,7 @@ be_sequence::managed_type ()
case AST_Decl::NT_pre_defined:
{
be_predefined_type * const bpd =
- dynamic_cast<be_predefined_type*> (prim_type);
+ dynamic_cast<be_predefined_type*> (base_type);
AST_PredefinedType::PredefinedType pt = bpd->pt ();
@@ -426,10 +399,8 @@ be_sequence::instance_name ()
'\0',
NAMEBUFSIZE);
- be_type *bt = nullptr;
- bt = dynamic_cast<be_type*> (this->base_type ());
-
- if (bt == nullptr)
+ be_type *const prim_type = dynamic_cast<be_type *> (primitive_base_type ());
+ if (!prim_type)
{
ACE_ERROR ((LM_ERROR,
"(%N:%l) be_visitor_sequence_ch::"
@@ -439,18 +410,6 @@ be_sequence::instance_name ()
return namebuf;
}
- // Generate the class name.
-
- // The base type after removing all the aliases.
- be_type *prim_type = bt;
-
- if (bt->node_type () == AST_Decl::NT_typedef)
- {
- // Get the primitive base type of this typedef node.
- be_typedef *t = dynamic_cast<be_typedef*> (bt);
- prim_type = t->primitive_base_type ();
- }
-
// Generate the appropriate sequence type.
switch (this->managed_type ())
{
@@ -621,19 +580,8 @@ be_sequence::gen_base_class_name (TAO_OutStream *os,
break;
case be_sequence::MNG_STRING:
{
- be_type *prim_type = nullptr;
- if (elem->node_type () == AST_Decl::NT_typedef)
- {
- // Get the primitive base type of this typedef node.
- be_typedef *t = dynamic_cast<be_typedef*> (elem);
- prim_type = t->primitive_base_type ();
- }
- else
- {
- prim_type = elem;
- }
-
- if (prim_type->node_type () == AST_Decl::NT_string)
+ be_type *const prim_type = dynamic_cast<be_type *> (primitive_base_type ());
+ if (prim_type && prim_type->node_type () == AST_Decl::NT_string)
{
be_string *str =
dynamic_cast<be_string*> (prim_type);
@@ -680,19 +628,8 @@ be_sequence::gen_base_class_name (TAO_OutStream *os,
break;
case be_sequence::MNG_WSTRING:
{
- be_type *prim_type = nullptr;
- if (elem->node_type () == AST_Decl::NT_typedef)
- {
- // Get the primitive base type of this typedef node.
- be_typedef *t = dynamic_cast<be_typedef*> (elem);
- prim_type = t->primitive_base_type ();
- }
- else
- {
- prim_type = elem;
- }
-
- if (prim_type->node_type () == AST_Decl::NT_wstring)
+ be_type *const prim_type = dynamic_cast<be_type *> (primitive_base_type ());
+ if (prim_type && prim_type->node_type () == AST_Decl::NT_wstring)
{
be_string *str =
dynamic_cast<be_string*> (prim_type);
@@ -744,46 +681,59 @@ be_sequence::gen_base_class_name (TAO_OutStream *os,
if (this->unbounded ())
{
*os << "::TAO::unbounded_array_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak
- << be_nl;
- *os << elem->nested_type_name (ctx_scope) << "_slice,"
- << linebreak << be_nl
- << elem->nested_type_name (ctx_scope) << "_tag"
- << linebreak << be_uidt_nl
- << ">" << be_uidt;
+ << be_idt << be_idt_nl
+ << elem->nested_type_name (ctx_scope) << "," << linebreak
+ << be_nl;
+ *os << elem->nested_type_name (ctx_scope) << "_slice,"
+ << linebreak << be_nl
+ << elem->nested_type_name (ctx_scope) << "_tag"
+ << linebreak << be_uidt_nl
+ << ">" << be_uidt;
}
else
{
*os << "::TAO::bounded_array_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak
- << be_nl;
- *os << elem->nested_type_name (ctx_scope) << "_slice,"
- << linebreak << be_nl
- << elem->nested_type_name (ctx_scope) << "_tag,"
- << linebreak << be_nl
- << this->max_size ()->ev ()->u.ulval << linebreak
- << be_uidt_nl
- << ">" << be_uidt;
+ << be_idt << be_idt_nl
+ << elem->nested_type_name (ctx_scope) << "," << linebreak
+ << be_nl;
+ *os << elem->nested_type_name (ctx_scope) << "_slice,"
+ << linebreak << be_nl
+ << elem->nested_type_name (ctx_scope) << "_tag,"
+ << linebreak << be_nl
+ << this->max_size ()->ev ()->u.ulval << linebreak
+ << be_uidt_nl
+ << ">" << be_uidt;
}
break;
default:
- if (this->unbounded ())
- {
- *os << "::TAO::unbounded_value_sequence< "
- << elem->nested_type_name (ctx_scope)
- << ">";
- }
- else
- {
- *os << "::TAO::bounded_value_sequence< "
- << elem->nested_type_name (ctx_scope) << ","
- << this->max_size ()->ev ()->u.ulval
- << ">";
- }
+ {
+ const char *tag = "";
+ be_type *const base_type = dynamic_cast<be_type*> (primitive_base_type ());
+ if (base_type && base_type->node_type () == AST_Decl::NT_pre_defined)
+ {
+ be_predefined_type *const predefined_type =
+ dynamic_cast<be_predefined_type*> (base_type);
+ switch (predefined_type->pt ())
+ {
+ case AST_PredefinedType::PT_uint8:
+ tag = ", CORBA::IDLv4::UInt8_tag";
+ break;
+ case AST_PredefinedType::PT_int8:
+ tag = ", CORBA::IDLv4::Int8_tag";
+ break;
+ default:
+ break;
+ }
+ }
+ *os
+ << "::TAO::" << (unbounded () ? "un" : "") << "bounded_value_sequence< "
+ << elem->nested_type_name (ctx_scope);
+ if (!unbounded ())
+ *os << "," << this->max_size ()->ev ()->u.ulval;
+ *os << tag << ">";
+ }
break;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_any_extracted_type_decl.cpp b/TAO/TAO_IDL/be/be_visitor_any_extracted_type_decl.cpp
index e9bc800f9a7..440369d0354 100644
--- a/TAO/TAO_IDL/be/be_visitor_any_extracted_type_decl.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_any_extracted_type_decl.cpp
@@ -108,6 +108,16 @@ be_visitor_any_extracted_type_decl::visit_predefined_type (
<< "::CORBA::Any::to_wchar " << var_name_
<< " (" << tmp_name_ << ");";
break;
+ case AST_PredefinedType::PT_uint8:
+ os_ << tmp_name_ << " = 0;" << be_nl
+ << "::CORBA::Any::to_uint8 " << var_name_
+ << " (" << tmp_name_ << ");";
+ break;
+ case AST_PredefinedType::PT_int8:
+ os_ << tmp_name_ << " = 0;" << be_nl
+ << "::CORBA::Any::to_int8 " << var_name_
+ << " (" << tmp_name_ << ");";
+ break;
case AST_PredefinedType::PT_short:
case AST_PredefinedType::PT_ushort:
case AST_PredefinedType::PT_long:
diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp
index 160bf640597..c66e3219503 100644
--- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp
@@ -363,6 +363,12 @@ be_visitor_array_cdr_op_cs::visit_predefined_type (
case AST_PredefinedType::PT_boolean:
*os << "boolean_array";
break;
+ case AST_PredefinedType::PT_uint8:
+ *os << "uint8_array";
+ break;
+ case AST_PredefinedType::PT_int8:
+ *os << "int8_array";
+ break;
default:
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_visitor_array_cdr_op_cs::"
@@ -431,6 +437,12 @@ be_visitor_array_cdr_op_cs::visit_predefined_type (
case AST_PredefinedType::PT_boolean:
*os << "ACE_CDR::Boolean";
break;
+ case AST_PredefinedType::PT_uint8:
+ *os << "ACE_CDR::UInt8";
+ break;
+ case AST_PredefinedType::PT_int8:
+ *os << "ACE_CDR::Int8";
+ break;
default:
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_visitor_array_cdr_op_cs::"
diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
index 79c2c13aff0..78bdd8dc7cb 100644
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
@@ -500,6 +500,16 @@ be_visitor_field_cdr_op_cs::visit_predefined_type (be_predefined_type *node)
*os << "(strm >> ::ACE_InputCDR::to_boolean (_tao_aggregate."
<< f->local_name () << "))";
}
+ else if (pt == AST_PredefinedType::PT_uint8)
+ {
+ *os << "(strm >> ::ACE_InputCDR::to_uint8 (_tao_aggregate."
+ << f->local_name () << "))";
+ }
+ else if (pt == AST_PredefinedType::PT_int8)
+ {
+ *os << "(strm >> ::ACE_InputCDR::to_int8 (_tao_aggregate."
+ << f->local_name () << "))";
+ }
else
{
*os << "(strm >> _tao_aggregate." << f->local_name () << ")";
@@ -531,6 +541,16 @@ be_visitor_field_cdr_op_cs::visit_predefined_type (be_predefined_type *node)
*os << "(strm << ::ACE_OutputCDR::from_boolean (_tao_aggregate."
<< f->local_name () << "))";
}
+ else if (pt == AST_PredefinedType::PT_uint8)
+ {
+ *os << "(strm << ::ACE_OutputCDR::from_uint8 (_tao_aggregate."
+ << f->local_name () << "))";
+ }
+ else if (pt == AST_PredefinedType::PT_int8)
+ {
+ *os << "(strm << ::ACE_OutputCDR::from_int8 (_tao_aggregate."
+ << f->local_name () << "))";
+ }
else
{
*os << "(strm << _tao_aggregate." << f->local_name () << ")";
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
index 498b403d1da..6727ee57e58 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
@@ -529,6 +529,12 @@ be_visitor_operation::gen_arg_template_param_name (AST_Decl *scope,
case AST_PredefinedType::PT_wchar:
*os << "::ACE_InputCDR::to_wchar";
return;
+ case AST_PredefinedType::PT_uint8:
+ *os << "::ACE_InputCDR::to_uint8";
+ return;
+ case AST_PredefinedType::PT_int8:
+ *os << "::ACE_InputCDR::to_int8";
+ return;
case AST_PredefinedType::PT_void:
break;
default:
diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp
index f3173b1742b..9072ec9a74b 100644
--- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp
@@ -21,6 +21,49 @@ be_visitor_union_cdr_op_cs::~be_visitor_union_cdr_op_cs ()
{
}
+namespace {
+ void
+ serialize_disc (TAO_OutStream *os, AST_Expression::ExprType disc_type, bool out)
+ {
+ const char* tmp_suffix = nullptr;
+ switch (disc_type)
+ {
+ case AST_Expression::EV_bool:
+ tmp_suffix = "boolean";
+ break;
+ case AST_Expression::EV_char:
+ tmp_suffix = "char";
+ break;
+ case AST_Expression::EV_wchar:
+ tmp_suffix = "wchar";
+ break;
+ case AST_Expression::EV_uint8:
+ tmp_suffix = "uint8";
+ break;
+ case AST_Expression::EV_int8:
+ tmp_suffix = "int8";
+ break;
+ default:
+ break;
+ }
+
+ const char* val = out ? "_tao_union._d ()" : "_tao_discriminant";
+ if (tmp_suffix)
+ {
+ *os << (out ? "::ACE_OutputCDR::from_" : "::ACE_InputCDR::to_")
+ << tmp_suffix << " tmp (" << val << ");" << be_nl;
+ val = "tmp";
+ }
+
+ *os
+ << "if (!(strm " << (out ? "<<" : ">>") << " " << val << "))" << be_idt_nl
+ << "{" << be_idt_nl
+ << "return false;" << be_uidt_nl
+ << "}" << be_uidt_nl << be_nl
+ << "::CORBA::Boolean result = true;" << be_nl_2;
+ }
+}
+
int
be_visitor_union_cdr_op_cs::visit_union (be_union *node)
{
@@ -84,37 +127,9 @@ be_visitor_union_cdr_op_cs::visit_union (be_union *node)
<< ")" << be_uidt_nl
<< "{" << be_idt_nl;
- bool boolDisc = false;
-
- switch (node->udisc_type ())
- {
- case AST_Expression::EV_bool:
- boolDisc = true;
- *os << "::ACE_OutputCDR::from_boolean tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_char:
- *os << "::ACE_OutputCDR::from_char tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_wchar:
- *os << "::ACE_OutputCDR::from_wchar tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- default:
- *os << "if ( !(strm << _tao_union._d ()) )" << be_idt_nl;
-
- break;
- }
-
- *os << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "::CORBA::Boolean result = true;" << be_nl_2;
+ serialize_disc (os, node->udisc_type (), true /* out */);
+ const bool boolDisc = node->udisc_type () == AST_Expression::EV_bool;
if (!boolDisc)
{
*os << "switch (_tao_union._d ())" << be_nl
@@ -165,33 +180,7 @@ be_visitor_union_cdr_op_cs::visit_union (be_union *node)
*os << disc_type->full_name ()
<< " " << "_tao_discriminant;" << be_nl;
- switch (node->udisc_type ())
- {
- case AST_Expression::EV_bool:
- *os << "::ACE_InputCDR::to_boolean tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_char:
- *os << "::ACE_InputCDR::to_char tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_wchar:
- *os << "::ACE_InputCDR::to_wchar tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- default:
- *os << "if ( !(strm >> _tao_discriminant) )" << be_idt_nl;
-
- break;
- }
-
- *os << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "::CORBA::Boolean result = true;" << be_nl_2;
+ serialize_disc (os, node->udisc_type (), false /* in */);
if (boolDisc)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp
index 5fb6a632f95..f02c02b38a8 100644
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp
@@ -574,6 +574,28 @@ be_visitor_union_branch_cdr_op_cs::visit_predefined_type (
<< "_tao_union." << f->local_name ()
<< " (_tao_union_tmp);";
}
+ else if (pt == AST_PredefinedType::PT_uint8)
+ {
+ *os << "::CORBA::UInt8 _tao_union_tmp;" << be_nl
+ << "::ACE_InputCDR::to_uint8 _tao_union_helper "
+ << "(_tao_union_tmp);" << be_nl
+ << "result = strm >> _tao_union_helper;" << be_nl_2
+ << "if (result)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "_tao_union." << f->local_name ()
+ << " (_tao_union_tmp);";
+ }
+ else if (pt == AST_PredefinedType::PT_int8)
+ {
+ *os << "::CORBA::Int8 _tao_union_tmp;" << be_nl
+ << "::ACE_InputCDR::to_int8 _tao_union_helper "
+ << "(_tao_union_tmp);" << be_nl
+ << "result = strm >> _tao_union_helper;" << be_nl_2
+ << "if (result)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "_tao_union." << f->local_name ()
+ << " (_tao_union_tmp);";
+ }
else
{
*os << node->name () << " _tao_union_tmp;" << be_nl
@@ -619,6 +641,16 @@ be_visitor_union_branch_cdr_op_cs::visit_predefined_type (
*os << "strm << ::ACE_OutputCDR::from_boolean (_tao_union."
<< f->local_name () << " ());";
}
+ else if (pt == AST_PredefinedType::PT_uint8)
+ {
+ *os << "strm << ::ACE_OutputCDR::from_uint8 (_tao_union."
+ << f->local_name () << " ());";
+ }
+ else if (pt == AST_PredefinedType::PT_int8)
+ {
+ *os << "strm << ::ACE_OutputCDR::from_int8 (_tao_union."
+ << f->local_name () << " ());";
+ }
else
{
*os << "strm << _tao_union." << f->local_name () << " ();";
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp
index 5dcc239871d..06420943760 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp
@@ -204,6 +204,16 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node)
"::ACE_InputCDR::to_octet (vb_object->_pd_value)";
break;
+ case AST_PredefinedType::PT_uint8:
+ unmarshal_arg =
+ "::ACE_InputCDR::to_uint8 (vb_object->_pd_value)";
+ break;
+
+ case AST_PredefinedType::PT_int8:
+ unmarshal_arg =
+ "::ACE_InputCDR::to_int8 (vb_object->_pd_value)";
+ break;
+
case AST_PredefinedType::PT_any:
// We need to help the ">>" operator for "any" because
// a conversion operator is not available.
@@ -407,6 +417,16 @@ be_visitor_valuebox_cs::visit_predefined_type (be_predefined_type * node)
"::ACE_OutputCDR::from_octet (this->_pd_value)";
break;
+ case AST_PredefinedType::PT_uint8:
+ marshal_arg =
+ "::ACE_OutputCDR::from_uint8 (this->_pd_value)";
+ break;
+
+ case AST_PredefinedType::PT_int8:
+ marshal_arg =
+ "::ACE_OutputCDR::from_int8 (this->_pd_value)";
+ break;
+
case AST_PredefinedType::PT_any:
marshal_arg = "this->_pd_value.in ()";
break;
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp
index 53547d82e7d..f06e8fbcfc4 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp
@@ -502,6 +502,16 @@ be_visitor_valuetype_field_cdr_cs::visit_predefined_type (be_predefined_type *no
*os << "(strm >> ::ACE_InputCDR::to_boolean ("
<< this->pre_ << f->local_name () << this->post_ << "))";
}
+ else if (pt == AST_PredefinedType::PT_uint8)
+ {
+ *os << "(strm >> ::ACE_InputCDR::to_uint8 ("
+ << this->pre_ << f->local_name () << this->post_ << "))";
+ }
+ else if (pt == AST_PredefinedType::PT_int8)
+ {
+ *os << "(strm >> ::ACE_InputCDR::to_int8 ("
+ << this->pre_ << f->local_name () << this->post_ << "))";
+ }
else
{
*os << "(strm >> " << this->pre_ << f->local_name ()
@@ -535,6 +545,16 @@ be_visitor_valuetype_field_cdr_cs::visit_predefined_type (be_predefined_type *no
*os << "(strm << ::ACE_OutputCDR::from_boolean ("
<< this->pre_ << f->local_name () << this->post_ << "))";
}
+ else if (pt == AST_PredefinedType::PT_uint8)
+ {
+ *os << "(strm << ::ACE_OutputCDR::from_uint8 ("
+ << this->pre_ << f->local_name () << this->post_ << "))";
+ }
+ else if (pt == AST_PredefinedType::PT_int8)
+ {
+ *os << "(strm << ::ACE_OutputCDR::from_int8 ("
+ << this->pre_ << f->local_name () << this->post_ << "))";
+ }
else
{
*os << "(strm << " << this->pre_ << f->local_name ()
diff --git a/TAO/TAO_IDL/include/ast_sequence.h b/TAO/TAO_IDL/include/ast_sequence.h
index 0ad62ce18b0..6c9688c7d5a 100644
--- a/TAO/TAO_IDL/include/ast_sequence.h
+++ b/TAO/TAO_IDL/include/ast_sequence.h
@@ -90,6 +90,12 @@ public:
AST_Type *base_type () const;
+ /**
+ * Returns the fully dealiased base type if it's a typedef. If it's not a
+ * typedef, the it returns the same value as as base_type().
+ */
+ AST_Type *primitive_base_type () const;
+
virtual bool unbounded () const;
// Is this sequence bounded or not.