From 4a65aaf95cd5b0517d4af2abd3bf4548c7b04c6e Mon Sep 17 00:00:00 2001 From: parsons Date: Tue, 1 Mar 2005 02:37:33 +0000 Subject: ChangeLogTag: Mon Feb 28 20:31:35 2005 Jeff Parsons --- TAO/ChangeLog | 19 +++++++++++++++++++ TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp | 14 +++++++++++--- TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp | 12 ++++++++++-- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 1e2565ba52e..50139213079 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,22 @@ +Mon Feb 28 20:31:35 2005 Jeff Parsons + + * TAO_IDL/be/be_visitor_constant/constant_ch.cpp: + * TAO_IDL/be/be_visitor_constant/constant_cs.cpp: + + Enabled inlined code generation for constants + (constant's value is assigned in the header file declaration) + when the constant is declared inside an interface, home, + valuetype or eventtype. The only documented problem with + inlined code generation for these types of constants is + when pre-compiled headers are used, in which case the IDL + compiler option -Guc can be used to explicitly turn off + inline constant generation. Thanks to Steve Baker + for redirecting our attention + to the known problem that uninlined constants cannot be used + as union case labels, or array, sequence or string bounds + since the C++ compiler does not recognize them as constant + values. + Mon Feb 28 17:06:44 2005 Iliyan Jeliazkov * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h: diff --git a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp index 407c0dd45eb..b90eb3855f4 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp @@ -125,9 +125,17 @@ be_visitor_constant_ch::visit_constant (be_constant *node) *os << " " << node->local_name (); } - if (!node->is_nested () - || (node->defined_in ()->scope_node_type () == AST_Decl::NT_module - && be_global->gen_inline_constants ())) + // (JP) I'm turning on inline constants by default for all scopes. + // The only problem I remember having with them is with + // pre-compiled headers, in which case folks can use -Guc to + // explicitly uninline constants. If this change turns up + // problems in our nightly builds, I'll revert it, otherwise it + // should stay. + +// if (!node->is_nested () +// || (node->defined_in ()->scope_node_type () == AST_Decl::NT_module +// && be_global->gen_inline_constants ())) + if (!node->is_nested () || be_global->gen_inline_constants ()) { *os << " = " << node->constant_value (); } diff --git a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp b/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp index dc5f0fcd4d6..4209c460f8e 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp @@ -47,10 +47,18 @@ be_visitor_constant_cs::visit_constant (be_constant *node) { return 0; } + + // (JP) I'm turning on inline constants by default for all scopes. + // The only problem I remember having with them is with + // pre-compiled headers, in which case folks can use -Guc to + // explicitly uninline constants. If this change turns up + // problems in our nightly builds, I'll revert it, otherwise it + // should stay. // Was the constant value already assigned in *C.h? - if (node->defined_in ()->scope_node_type () == AST_Decl::NT_module - && be_global->gen_inline_constants ()) +// if (node->defined_in ()->scope_node_type () == AST_Decl::NT_module +// && be_global->gen_inline_constants ()) + if (be_global->gen_inline_constants () || !node->is_nested ()) { return 0; } -- cgit v1.2.1