summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-05-12 23:51:36 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-05-12 23:51:36 +0000
commit57c5351b0a2863f3ae6eeb886d73013643b3a179 (patch)
tree4586fa98a7e98fe874acd0527dec8a127608e7f5
parent001e51c5dcfe286b485f9ca52b72d2df56dfafbb (diff)
downloadATCD-57c5351b0a2863f3ae6eeb886d73013643b3a179.tar.gz
ChangeLogTag: Mon May 12 18:42:58 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog14
-rw-r--r--TAO/TAO_IDL/ast/ast_expression.cpp56
-rw-r--r--TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp2
-rw-r--r--TAO/TAO_IDL/include/ast_expression.h5
4 files changed, 57 insertions, 20 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 503906e7799..51b0ba2a7b9 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,17 @@
+Mon May 12 18:42:58 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/ast/ast_expression.cpp:
+ * TAO_IDL/be/be_visitor_constant/constant_ch.cpp:
+ * TAO_IDL/include/ast_expression.h:
+
+ Moved storage of an expression's typedef node out of
+ AST_Expression::AST_ExprValue and into AST_Expression itself.
+ If the rhs of a constant literal is an arithmetic or logical
+ expression, the AST_ExprValue's creation is deferred, and the
+ typedef cannot be assigned at the point where it is looked up.
+ Thanks to Ossama Othman <ossama@doc.ece.uci.edu> for reporting
+ the bug and sending an example IDL file.
+
Mon May 12 10:24:18 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
* tao/IIOP_Profile.cpp (parse_string_i):
diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp
index e2d94c45f11..27f84ec233f 100644
--- a/TAO/TAO_IDL/ast/ast_expression.cpp
+++ b/TAO/TAO_IDL/ast/ast_expression.cpp
@@ -99,7 +99,8 @@ AST_Expression::AST_Expression (UTL_ScopedName *nm)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (nm)
+ pd_n (nm),
+ tdef (0)
{
this->fill_definition_details ();
}
@@ -111,7 +112,8 @@ AST_Expression::AST_Expression (AST_Expression *v,
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -133,7 +135,8 @@ AST_Expression::AST_Expression (ExprComb c,
pd_ev (0),
pd_v1 (ev1),
pd_v2 (ev2),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
}
@@ -144,7 +147,8 @@ AST_Expression::AST_Expression (short sv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -161,7 +165,8 @@ AST_Expression::AST_Expression (unsigned short usv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -178,7 +183,8 @@ AST_Expression::AST_Expression (long lv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -196,7 +202,8 @@ AST_Expression::AST_Expression (long lv,
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -214,7 +221,8 @@ AST_Expression::AST_Expression (unsigned long ulv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -231,7 +239,8 @@ AST_Expression::AST_Expression (float fv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -248,7 +257,8 @@ AST_Expression::AST_Expression (double dv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -265,7 +275,8 @@ AST_Expression::AST_Expression (char cv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -282,7 +293,8 @@ AST_Expression::AST_Expression (ACE_OutputCDR::from_wchar wcv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -299,7 +311,8 @@ AST_Expression::AST_Expression (unsigned char ov)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -316,7 +329,8 @@ AST_Expression::AST_Expression (UTL_String *sv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -333,7 +347,8 @@ AST_Expression::AST_Expression (char *sv)
pd_ev (0),
pd_v1 (0),
pd_v2 (0),
- pd_n (0)
+ pd_n (0),
+ tdef (0)
{
this->fill_definition_details ();
@@ -349,7 +364,6 @@ AST_Expression::~AST_Expression (void)
}
AST_Expression::AST_ExprValue::AST_ExprValue (void)
- : tdef (0)
{
}
@@ -2102,10 +2116,10 @@ AST_Expression::check_and_coerce (AST_Expression::ExprType t,
if (d != 0 && d->node_type () == AST_Decl::NT_typedef)
{
- this->pd_ev->tdef = d;
+ this->tdef = d;
}
- return this->coerce (t);;
+ return this->coerce (t);
}
// Coerce "this" to the ExprType required. Returns a copy of the
@@ -2483,6 +2497,12 @@ AST_Expression::compare (AST_Expression *vc)
return I_FALSE;
}
+AST_Decl *
+AST_Expression::get_tdef (void) const
+{
+ return this->tdef;
+}
+
// Helper functions for expression dumpers.
// Dump this binary AST_Expression node to the ostream o.
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 bde4d7a3eaa..a987353d696 100644
--- a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp
@@ -55,7 +55,7 @@ be_visitor_constant_ch::visit_constant (be_constant *node)
// to us here itself, else it will be in the *.cpp file.
AST_Decl::NodeType nt = AST_Decl::NT_pre_defined;
- AST_Decl *td = node->constant_value ()->ev ()->tdef;
+ AST_Decl *td = node->constant_value ()->get_tdef ();
if (td != 0)
{
diff --git a/TAO/TAO_IDL/include/ast_expression.h b/TAO/TAO_IDL/include/ast_expression.h
index 20b173f2890..b3564dda328 100644
--- a/TAO/TAO_IDL/include/ast_expression.h
+++ b/TAO/TAO_IDL/include/ast_expression.h
@@ -181,7 +181,6 @@ public:
} u;
ExprType et;
- AST_Decl *tdef; // Propagates aliased constant type.
};
// Operations.
@@ -279,6 +278,8 @@ public:
long compare (AST_Expression *vc);
+ AST_Decl *get_tdef (void) const;
+
protected:
// Evaluate different sets of operators.
AST_ExprValue *eval_bin_op (EvalKind ek);
@@ -316,6 +317,8 @@ private:
UTL_ScopedName *pd_n;
// Symbolic name (if any).
+ AST_Decl *tdef;
+ // Propagates aliased constant type.
private:
// Fill out the lineno, filename and definition scope details.
void fill_definition_details (void);