* expression.h: Rename ObjC ops to OP_OBJC_MSGCALL,

OP_OBJC_SELECTOR, OP_OBJC_NSSTRING, and OP_OBJC_SELF.
* parse.c (length_of_subexp, prefixify_subexp): Likewise.
* objc-exp.y: Likewise.
This commit is contained in:
Adam Fedor
2002-11-19 03:23:40 +00:00
parent 379b85dfc1
commit 646df18d28
4 changed files with 34 additions and 27 deletions

View File

@ -1,3 +1,10 @@
2002-11-18 Adam Fedor <fedor@gnu.org>
* expression.h: Rename ObjC ops to OP_OBJC_MSGCALL,
OP_OBJC_SELECTOR, OP_OBJC_NSSTRING, and OP_OBJC_SELF.
* parse.c (length_of_subexp, prefixify_subexp): Likewise.
* objc-exp.y: Likewise.
2002-11-18 Adam Fedor <fedor@gnu.org> 2002-11-18 Adam Fedor <fedor@gnu.org>
* gdb/parser-defs.h: (struct objc_class_str): New structure * gdb/parser-defs.h: (struct objc_class_str): New structure

View File

@ -181,11 +181,11 @@ enum exp_opcode
making three exp_elements. */ making three exp_elements. */
OP_FUNCALL, OP_FUNCALL,
/* OP_MSGCALL is followed by a string in the next exp_element and then an /* OP_OBJC_MSGCALL is followed by a string in the next exp_element and then an
integer. The string is the selector string. The integer is the number integer. The string is the selector string. The integer is the number
of arguments to the message call. That many plus one values are used, of arguments to the message call. That many plus one values are used,
the first one being the object pointer. This is an Objective C message */ the first one being the object pointer. This is an Objective C message */
OP_MSGCALL, OP_OBJC_MSGCALL,
/* This is EXACTLY like OP_FUNCALL but is semantically different. /* This is EXACTLY like OP_FUNCALL but is semantically different.
In F77, array subscript expressions, substring expressions In F77, array subscript expressions, substring expressions
@ -283,12 +283,12 @@ enum exp_opcode
It just comes in a tight (OP_THIS, OP_THIS) pair. */ It just comes in a tight (OP_THIS, OP_THIS) pair. */
OP_THIS, OP_THIS,
/* Objective-C: OP_SELF is just a placeholder for the class instance /* Objective-C: OP_OBJC_SELF is just a placeholder for the class instance
variable. It just comes in a tight (OP_SELF, OP_SELF) pair. */ variable. It just comes in a tight (OP_OBJC_SELF, OP_OBJC_SELF) pair. */
OP_SELF, OP_OBJC_SELF,
/* Objective C: "@selector" pseudo-operator */ /* Objective C: "@selector" pseudo-operator */
OP_SELECTOR, OP_OBJC_SELECTOR,
/* OP_SCOPE surrounds a type name and a field name. The type /* OP_SCOPE surrounds a type name and a field name. The type
name is encoded as one element, but the field name stays as name is encoded as one element, but the field name stays as
@ -320,7 +320,7 @@ enum exp_opcode
OP_EXPRSTRING, OP_EXPRSTRING,
/* An Objective C Foundation Class NSString constant */ /* An Objective C Foundation Class NSString constant */
OP_NSSTRING, OP_OBJC_NSSTRING,
}; };
union exp_element union exp_element

View File

@ -341,9 +341,9 @@ exp : '[' TYPENAME
start_msglist(); start_msglist();
} }
msglist ']' msglist ']'
{ write_exp_elt_opcode (OP_MSGCALL); { write_exp_elt_opcode (OP_OBJC_MSGCALL);
end_msglist(); end_msglist();
write_exp_elt_opcode (OP_MSGCALL); write_exp_elt_opcode (OP_OBJC_MSGCALL);
} }
; ;
@ -356,18 +356,18 @@ exp : '[' CLASSNAME
start_msglist(); start_msglist();
} }
msglist ']' msglist ']'
{ write_exp_elt_opcode (OP_MSGCALL); { write_exp_elt_opcode (OP_OBJC_MSGCALL);
end_msglist(); end_msglist();
write_exp_elt_opcode (OP_MSGCALL); write_exp_elt_opcode (OP_OBJC_MSGCALL);
} }
; ;
exp : '[' exp exp : '[' exp
{ start_msglist(); } { start_msglist(); }
msglist ']' msglist ']'
{ write_exp_elt_opcode (OP_MSGCALL); { write_exp_elt_opcode (OP_OBJC_MSGCALL);
end_msglist(); end_msglist();
write_exp_elt_opcode (OP_MSGCALL); write_exp_elt_opcode (OP_OBJC_MSGCALL);
} }
; ;
@ -565,9 +565,9 @@ exp : VARIABLE
exp : SELECTOR exp : SELECTOR
{ {
write_exp_elt_opcode (OP_SELECTOR); write_exp_elt_opcode (OP_OBJC_SELECTOR);
write_exp_string ($1); write_exp_string ($1);
write_exp_elt_opcode (OP_SELECTOR); } write_exp_elt_opcode (OP_OBJC_SELECTOR); }
exp : SIZEOF '(' type ')' %prec UNARY exp : SIZEOF '(' type ')' %prec UNARY
{ write_exp_elt_opcode (OP_LONG); { write_exp_elt_opcode (OP_LONG);
@ -605,9 +605,9 @@ exp : STRING
exp : NSSTRING /* ObjC NextStep NSString constant exp : NSSTRING /* ObjC NextStep NSString constant
* of the form '@' '"' string '"'. * of the form '@' '"' string '"'.
*/ */
{ write_exp_elt_opcode (OP_NSSTRING); { write_exp_elt_opcode (OP_OBJC_NSSTRING);
write_exp_string ($1); write_exp_string ($1);
write_exp_elt_opcode (OP_NSSTRING); } write_exp_elt_opcode (OP_OBJC_NSSTRING); }
; ;
block : BLOCKNAME block : BLOCKNAME
@ -756,8 +756,8 @@ variable: name_not_typename
if (innermost_block == 0 || if (innermost_block == 0 ||
contained_in (block_found, innermost_block)) contained_in (block_found, innermost_block))
innermost_block = block_found; innermost_block = block_found;
write_exp_elt_opcode (OP_SELF); write_exp_elt_opcode (OP_OBJC_SELF);
write_exp_elt_opcode (OP_SELF); write_exp_elt_opcode (OP_OBJC_SELF);
write_exp_elt_opcode (STRUCTOP_PTR); write_exp_elt_opcode (STRUCTOP_PTR);
write_exp_string ($1.stoken); write_exp_string ($1.stoken);
write_exp_elt_opcode (STRUCTOP_PTR); write_exp_elt_opcode (STRUCTOP_PTR);

View File

@ -830,7 +830,7 @@ length_of_subexp (register struct expression *expr, register int endpos)
args = 1 + longest_to_int (expr->elts[endpos - 2].longconst); args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
break; break;
case OP_MSGCALL: /* Objective C message (method) call */ case OP_OBJC_MSGCALL: /* Objective C message (method) call */
oplen = 4; oplen = 4;
args = 1 + longest_to_int (expr->elts[endpos - 2].longconst); args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
break; break;
@ -866,8 +866,8 @@ length_of_subexp (register struct expression *expr, register int endpos)
/* fall through */ /* fall through */
case OP_M2_STRING: case OP_M2_STRING:
case OP_STRING: case OP_STRING:
case OP_NSSTRING: /* Objective C Foundation Class NSString constant */ case OP_OBJC_NSSTRING: /* Objective C Foundation Class NSString constant */
case OP_SELECTOR: /* Objective C "@selector" pseudo-op */ case OP_OBJC_SELECTOR: /* Objective C "@selector" pseudo-op */
case OP_NAME: case OP_NAME:
case OP_EXPRSTRING: case OP_EXPRSTRING:
oplen = longest_to_int (expr->elts[endpos - 2].longconst); oplen = longest_to_int (expr->elts[endpos - 2].longconst);
@ -906,7 +906,7 @@ length_of_subexp (register struct expression *expr, register int endpos)
/* C++ */ /* C++ */
case OP_THIS: case OP_THIS:
case OP_SELF: case OP_OBJC_SELF:
oplen = 2; oplen = 2;
break; break;
@ -975,7 +975,7 @@ prefixify_subexp (register struct expression *inexpr,
args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst); args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst);
break; break;
case OP_MSGCALL: /* Objective C message (method) call */ case OP_OBJC_MSGCALL: /* Objective C message (method) call */
oplen = 4; oplen = 4;
args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst); args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst);
break; break;
@ -1010,8 +1010,8 @@ prefixify_subexp (register struct expression *inexpr,
/* fall through */ /* fall through */
case OP_M2_STRING: case OP_M2_STRING:
case OP_STRING: case OP_STRING:
case OP_NSSTRING: /* Objective C Foundation Class NSString constant */ case OP_OBJC_NSSTRING: /* Objective C Foundation Class NSString constant */
case OP_SELECTOR: /* Objective C "@selector" pseudo-op */ case OP_OBJC_SELECTOR: /* Objective C "@selector" pseudo-op */
case OP_NAME: case OP_NAME:
case OP_EXPRSTRING: case OP_EXPRSTRING:
oplen = longest_to_int (inexpr->elts[inend - 2].longconst); oplen = longest_to_int (inexpr->elts[inend - 2].longconst);
@ -1050,7 +1050,7 @@ prefixify_subexp (register struct expression *inexpr,
/* C++ */ /* C++ */
case OP_THIS: case OP_THIS:
case OP_SELF: case OP_OBJC_SELF:
oplen = 2; oplen = 2;
break; break;