X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gas%2Fexpr.h;h=dff408574275e02ba112450ff442a59997cd24fb;hb=811f61d4c453934b765c73bde78fc29ea22c0c7d;hp=fc6b7210a9f1d7a9cc13cc16e7d788cada85fd34;hpb=b90efa5b79ac1524ec260f8eb89d1be37e0219a7;p=binutils-gdb.git diff --git a/gas/expr.h b/gas/expr.h index fc6b7210a9f..dff40857427 100644 --- a/gas/expr.h +++ b/gas/expr.h @@ -1,5 +1,5 @@ /* expr.h -> header file for expr.c - Copyright (C) 1987-2015 Free Software Foundation, Inc. + Copyright (C) 1987-2022 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -18,28 +18,27 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -/* - * By popular demand, we define a struct to represent an expression. - * This will no doubt mutate as expressions become baroque. - * - * Currently, we support expressions like "foo OP bar + 42". In other - * words we permit a (possibly undefined) symbol, a (possibly - * undefined) symbol and the operation used to combine the symbols, - * and an (absolute) augend. RMS says this is so we can have 1-pass - * assembly for any compiler emissions, and a 'case' statement might - * emit 'undefined1 - undefined2'. - * - * The type of an expression used to be stored as a segment. That got - * confusing because it overloaded the concept of a segment. I added - * an operator field, instead. - */ +/* By popular demand, we define a struct to represent an expression. + This will no doubt mutate as expressions become baroque. + + Currently, we support expressions like "foo OP bar + 42". In other + words we permit a (possibly undefined) symbol, a (possibly + undefined) symbol and the operation used to combine the symbols, + and an (absolute) augend. RMS says this is so we can have 1-pass + assembly for any compiler emissions, and a 'case' statement might + emit 'undefined1 - undefined2'. + + The type of an expression used to be stored as a segment. That got + confusing because it overloaded the concept of a segment. I added + an operator field, instead. */ /* This is the type of an expression. The operator types are also used while parsing an expression. NOTE: This enumeration must match the op_rank array in expr.c. */ -typedef enum { +typedef enum +{ /* An illegal expression. */ O_illegal, /* A nonexistent expression. */ @@ -50,6 +49,8 @@ typedef enum { O_symbol, /* X_add_symbol + X_add_number - the base address of the image. */ O_symbol_rva, + /* The section index of X_add_symbol. */ + O_secidx, /* A register (X_add_number is register number). */ O_register, /* A big value. If X_add_number is negative or 0, the value is in @@ -112,7 +113,8 @@ typedef enum { O_max } operatorT; -typedef struct expressionS { +typedef struct expressionS +{ /* The main symbol. */ symbolS *X_add_symbol; /* The second symbol, if needed. */ @@ -170,7 +172,8 @@ extern LITTLENUM_TYPE generic_bignum[]; typedef char operator_rankT; -extern char get_symbol_end (void); +extern char get_symbol_name (char **); +extern char restore_line_pointer (char); extern void expr_begin (void); extern void expr_set_precedence (void); extern void expr_set_rank (operatorT, operator_rankT); @@ -179,10 +182,12 @@ extern void subtract_from_result (expressionS *, offsetT, int); extern segT expr (int, expressionS *, enum expr_mode); extern unsigned int get_single_number (void); extern symbolS *make_expr_symbol (expressionS * expressionP); -extern int expr_symbol_where (symbolS *, char **, unsigned int *); +extern int expr_symbol_where (symbolS *, const char **, unsigned int *); extern void current_location (expressionS *); - extern symbolS *expr_build_uconstant (offsetT); extern symbolS *expr_build_dot (void); +extern uint32_t generic_bignum_to_int32 (void); +extern uint64_t generic_bignum_to_int64 (void); +extern int resolve_expression (expressionS *); -int resolve_expression (expressionS *); +extern bool literal_prefix_dollar_hex;