along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Parse an expression from text in a string,
- and return the result as a struct expression pointer.
+ and return the result as a struct expression pointer.
That structure contains arithmetic operations in reverse polish,
with constants represented by operations that are followed by special data.
See expression.h for the details of the format.
}
}
\f
-/* This page contains the functions for adding data to the struct expression
+/* This page contains the functions for adding data to the struct expression
being constructed. */
/* Add one element to the end of the expression. */
/* To avoid a bug in the Sun 4 compiler, we pass things that can fit into
a register through here. */
-void
-write_exp_elt (union exp_element expelt)
+static void
+write_exp_elt (const union exp_element *expelt)
{
if (expout_ptr >= expout_size)
{
xrealloc ((char *) expout, sizeof (struct expression)
+ EXP_ELEM_TO_BYTES (expout_size));
}
- expout->elts[expout_ptr++] = expelt;
+ expout->elts[expout_ptr++] = *expelt;
}
void
memset (&tmp, 0, sizeof (union exp_element));
tmp.opcode = expelt;
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
void
memset (&tmp, 0, sizeof (union exp_element));
tmp.symbol = expelt;
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
void
memset (&tmp, 0, sizeof (union exp_element));
tmp.block = b;
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
void
memset (&tmp, 0, sizeof (union exp_element));
tmp.objfile = objfile;
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
void
memset (&tmp, 0, sizeof (union exp_element));
tmp.longconst = expelt;
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
void
memset (&tmp, 0, sizeof (union exp_element));
tmp.doubleconst = expelt;
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
void
for (index = 0; index < 16; index++)
tmp.decfloatconst[index] = expelt[index];
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
void
memset (&tmp, 0, sizeof (union exp_element));
tmp.type = expelt;
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
void
memset (&tmp, 0, sizeof (union exp_element));
tmp.internalvar = expelt;
- write_exp_elt (tmp);
+ write_exp_elt (&tmp);
}
/* Add a string constant to the end of the expression.
case OP_BOOL:
case OP_LAST:
case OP_INTERNALVAR:
+ case OP_VAR_ENTRY_VALUE:
oplen = 3;
break;
/* C++ */
case OP_THIS:
- case OP_OBJC_SELF:
oplen = 2;
break;
}
\f
/* Read an expression from the string *STRINGPTR points to,
- parse it, and return a pointer to a struct expression that we malloc.
+ parse it, and return a pointer to a struct expression that we malloc.
Use block BLOCK as the lexical context for variable names;
if BLOCK is zero, use the block of the selected stack frame.
Meanwhile, advance *STRINGPTR to point after the expression,