summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-11-29 17:18:33 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-11-29 17:18:33 +0000
commit5a26fb0a223788d972bd81183f0ec1587a08bac1 (patch)
tree1e1d9c484df8679660d7e67f7153ac0a2676b18b
parent0a9d49bec4e899adc6dc72999c5c2dff41cf496a (diff)
downloadATCD-5a26fb0a223788d972bd81183f0ec1587a08bac1.tar.gz
ChangeLogTag: Mon Nov 29 17:11:52 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog21
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array.cpp1
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_traits.cpp31
-rw-r--r--TAO/tests/IDL_Test/anonymous.idl13
5 files changed, 51 insertions, 18 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index ca6c056910b..f64ffc47545 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,24 @@
+Mon Nov 29 17:11:52 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_visitor_array.cpp:
+ * TAO_IDL/be/be_visitor_array/array_ch.cpp:
+
+ Cosmetic changes.
+
+ * TAO_IDL/be/be_visitor_traits.cpp:
+
+ - Removed code that prevented the visitor from finding
+ anonymous arrays nested more than one level deep. Thanks
+ to Shi John <John dot Shi at acxiom dot com> for
+ sending in the IDL example that uncovered the problem.
+
+ - Fixed problem with traits generation for an interface
+ that contains itself recursively.
+
+ * tests/IDL_Test/anonymous.idl:
+
+ Added IDL example mentioned above to test coverage.
+
Mon Nov 29 15:26:46 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/ast/ast_visitor_reifying.cpp:
diff --git a/TAO/TAO_IDL/be/be_visitor_array.cpp b/TAO/TAO_IDL/be/be_visitor_array.cpp
index 68470b962bf..d5505d75cd3 100644
--- a/TAO/TAO_IDL/be/be_visitor_array.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_array.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
#include "be_enum.h"
#include "be_type.h"
#include "be_typedef.h"
diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
index 0f4a0a6ee1c..8bbb08ac0dc 100644
--- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
// ************************************************************************
// visitor for array declaration in client header
// ************************************************************************
@@ -334,6 +333,6 @@ int be_visitor_array_ch::visit_array (be_array *node)
<< ");" << be_uidt;
}
- node->cli_hdr_gen (1);
+ node->cli_hdr_gen (true);
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_traits.cpp b/TAO/TAO_IDL/be/be_visitor_traits.cpp
index 0a16c5d6fe0..0f0fa5c33f2 100644
--- a/TAO/TAO_IDL/be/be_visitor_traits.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_traits.cpp
@@ -105,6 +105,10 @@ be_visitor_traits::visit_interface (be_interface *node)
return 0;
}
+ /// Some type of recursion can cause fprintf problems,
+ /// easily avoided by setting the flag before visit_scope().
+ node->cli_traits_gen (true);
+
TAO_OutStream *os = this->ctx_->stream ();
// Since the three blocks below generate specialized (i.e., non-template)
@@ -115,19 +119,21 @@ be_visitor_traits::visit_interface (be_interface *node)
{
os->gen_ifdef_macro (node->flat_name (), "traits", false);
+ const char *fname = node->full_name ();
+
*os << be_nl_2
<< "template<>" << be_nl
<< "struct " << be_global->stub_export_macro () << " Objref_Traits<"
- << " ::" << node->name () << ">" << be_nl
+ << " ::" << fname << ">" << be_nl
<< "{" << be_idt_nl
- << "static ::" << node->name () << "_ptr duplicate ("
+ << "static ::" << fname << "_ptr duplicate ("
<< be_idt << be_idt_nl
- << "::" << node->name () << "_ptr p);" << be_uidt << be_uidt_nl
+ << "::" << fname << "_ptr p);" << be_uidt << be_uidt_nl
<< "static void release (" << be_idt << be_idt_nl
- << "::" << node->name () << "_ptr p);" << be_uidt << be_uidt_nl
- << "static ::" << node->name () << "_ptr nil (void);" << be_nl
+ << "::" << fname << "_ptr p);" << be_uidt << be_uidt_nl
+ << "static ::" << fname << "_ptr nil (void);" << be_nl
<< "static ::CORBA::Boolean marshal (" << be_idt << be_idt_nl
- << "const ::" << node->name () << "_ptr p," << be_nl
+ << "const ::" << fname << "_ptr p," << be_nl
<< "TAO_OutputCDR & cdr);" << be_uidt << be_uidt << be_uidt_nl
<< "};";
@@ -142,7 +148,6 @@ be_visitor_traits::visit_interface (be_interface *node)
-1);
}
- node->cli_traits_gen (true);
return 0;
}
@@ -179,6 +184,10 @@ be_visitor_traits::visit_valuetype (be_valuetype *node)
return 0;
}
+ /// Some type of recursion can cause fprintf problems,
+ /// easily avoided by setting the flag before visit_scope().
+ node->cli_traits_gen (true);
+
TAO_OutStream *os = this->ctx_->stream ();
// I think we need to generate this only for non-defined forward
@@ -212,7 +221,6 @@ be_visitor_traits::visit_valuetype (be_valuetype *node)
-1);
}
- node->cli_traits_gen (true);
return 0;
}
@@ -312,13 +320,6 @@ int
be_visitor_traits::visit_field (be_field *node)
{
be_type *ft = be_type::narrow_from_decl (node->field_type ());
- AST_Decl::NodeType nt = ft->node_type ();
-
- // All we are trying to catch in here are anonymous array members.
- if (nt != AST_Decl::NT_array)
- {
- return 0;
- }
if (ft->accept (this) == -1)
{
diff --git a/TAO/tests/IDL_Test/anonymous.idl b/TAO/tests/IDL_Test/anonymous.idl
index 1e18057358f..044c76efb34 100644
--- a/TAO/tests/IDL_Test/anonymous.idl
+++ b/TAO/tests/IDL_Test/anonymous.idl
@@ -72,3 +72,16 @@ module Second
{
typedef string<32> SecondString;
};
+
+/// There was a problem generating the *_Forany
+/// for the inner array.
+typedef struct teststruct
+{
+ char b[4];
+
+ struct embeddedstruct
+ {
+ char a[4];
+ } estruct;
+
+} tstruct;