return result;
}
-/* Parse STRING as an expression, and complain if this fails
- to use up all of the contents of STRING. */
+/* Parse STRING as an expression, and complain if this fails to use up
+ all of the contents of STRING. TRACKER, if non-null, will be
+ updated by the parser. VOID_CONTEXT_P should be true to indicate
+ that the expression may be expected to return a value with void
+ type. Parsers are free to ignore this, or to use it to help with
+ overload resolution decisions. */
expression_up
-parse_expression (const char *string, innermost_block_tracker *tracker)
+parse_expression (const char *string, innermost_block_tracker *tracker,
+ bool void_context_p)
{
- expression_up exp = parse_exp_1 (&string, 0, 0, 0, tracker);
+ expression_up exp = parse_exp_in_context (&string, 0, nullptr, 0,
+ void_context_p, nullptr,
+ tracker, nullptr);
if (*string)
error (_("Junk after end of expression."));
return exp;
for (arg = 0; arg < nargs; arg++)
{
struct type *inst_type = elts[pos + 3 + arg].type;
- struct objfile *inst_objfile = TYPE_OBJFILE (inst_type);
+ struct objfile *inst_objfile = inst_type->objfile_owner ();
if (inst_objfile && (*objfile_func) (inst_objfile, data))
return 1;
/* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL. */
- if (type && TYPE_OBJFILE (type)
- && (*objfile_func) (TYPE_OBJFILE (type), data))
+ if (type != nullptr && type->objfile_owner () != nullptr
+ && objfile_func (type->objfile_owner (), data))
return 1;
+
if (objfile && (*objfile_func) (objfile, data))
return 1;