-/* Helper for make_cleanup_free_dwarf_expr_context. */
-
-static void
-free_dwarf_expr_context_cleanup (void *arg)
-{
- free_dwarf_expr_context (arg);
-}
-
-/* Return a cleanup that calls free_dwarf_expr_context. */
-
-struct cleanup *
-make_cleanup_free_dwarf_expr_context (struct dwarf_expr_context *ctx)
-{
- return make_cleanup (free_dwarf_expr_context_cleanup, ctx);
-}
-
-/* Expand the memory allocated to CTX's stack to contain at least
- NEED more elements than are currently used. */
-
-static void
-dwarf_expr_grow_stack (struct dwarf_expr_context *ctx, size_t need)
-{
- if (ctx->stack_len + need > ctx->stack_allocated)
- {
- size_t newlen = ctx->stack_len + need + 10;
-
- ctx->stack = xrealloc (ctx->stack,
- newlen * sizeof (struct dwarf_stack_value));
- ctx->stack_allocated = newlen;
- }
-}
-
-/* Push VALUE onto CTX's stack. */
-
-static void
-dwarf_expr_push (struct dwarf_expr_context *ctx, struct value *value,
- int in_stack_memory)
-{
- struct dwarf_stack_value *v;
-
- dwarf_expr_grow_stack (ctx, 1);
- v = &ctx->stack[ctx->stack_len++];
- v->value = value;
- v->in_stack_memory = in_stack_memory;
-}
-
-/* Push VALUE onto CTX's stack. */