projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gdbserver/linux-low: turn 'fetch_register' into a method
[deliverable/binutils-gdb.git]
/
gas
/
app.c
diff --git
a/gas/app.c
b/gas/app.c
index 32a172f55dd8d462f16eb6a9a6752e0624a3da59..00c31bbf3906fe5ca85a191b9350cedf8a9072d9 100644
(file)
--- a/
gas/app.c
+++ b/
gas/app.c
@@
-1,5
+1,5
@@
/* This is the Assembler Pre-Processor
/* This is the Assembler Pre-Processor
- Copyright (C) 1987-20
14
Free Software Foundation, Inc.
+ Copyright (C) 1987-20
20
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
This file is part of GAS, the GNU Assembler.
@@
-55,6
+55,9
@@
static const char mri_pseudo[] = ".mri 0";
static const char symver_pseudo[] = ".symver";
static const char * symver_state;
#endif
static const char symver_pseudo[] = ".symver";
static const char * symver_state;
#endif
+#ifdef TC_ARM
+static char last_char;
+#endif
static char lex[256];
static const char symbol_chars[] =
static char lex[256];
static const char symbol_chars[] =
@@
-117,8
+120,7
@@
do_scrub_begin (int m68k_mri ATTRIBUTE_UNUSED)
{
lex['"'] = LEX_IS_STRINGQUOTE;
{
lex['"'] = LEX_IS_STRINGQUOTE;
-#if ! defined (TC_HPPA) && ! defined (TC_I370)
- /* I370 uses single-quotes to delimit integer, float constants. */
+#if ! defined (TC_HPPA)
lex['\''] = LEX_IS_ONECHAR_QUOTE;
#endif
lex['\''] = LEX_IS_ONECHAR_QUOTE;
#endif
@@
-211,7
+213,7
@@
do_scrub_begin (int m68k_mri ATTRIBUTE_UNUSED)
/* Saved state of the scrubber. */
static int state;
static int old_state;
/* Saved state of the scrubber. */
static int state;
static int old_state;
-static char *out_string;
+static c
onst c
har *out_string;
static char out_buf[20];
static int add_newlines;
static char *saved_input;
static char out_buf[20];
static int add_newlines;
static char *saved_input;
@@
-229,7
+231,7
@@
struct app_save
{
int state;
int old_state;
{
int state;
int old_state;
- c
har *
out_string;
+ c
onst char *
out_string;
char out_buf[sizeof (out_buf)];
int add_newlines;
char * saved_input;
char out_buf[sizeof (out_buf)];
int add_newlines;
char * saved_input;
@@
-242,14
+244,17
@@
struct app_save
#if defined TC_ARM && defined OBJ_ELF
const char * symver_state;
#endif
#if defined TC_ARM && defined OBJ_ELF
const char * symver_state;
#endif
+#ifdef TC_ARM
+ char last_char;
+#endif
};
char *
app_push (void)
{
};
char *
app_push (void)
{
-
register
struct app_save *saved;
+ struct app_save *saved;
- saved =
(struct app_save *) xmalloc (sizeof (*saved)
);
+ saved =
XNEW (struct app_save
);
saved->state = state;
saved->old_state = old_state;
saved->out_string = out_string;
saved->state = state;
saved->old_state = old_state;
saved->out_string = out_string;
@@
-259,7
+264,7
@@
app_push (void)
saved->saved_input = NULL;
else
{
saved->saved_input = NULL;
else
{
- saved->saved_input =
(char *) xmalloc (
saved_input_len);
+ saved->saved_input =
XNEWVEC (char,
saved_input_len);
memcpy (saved->saved_input, saved_input, saved_input_len);
saved->saved_input_len = saved_input_len;
}
memcpy (saved->saved_input, saved_input, saved_input_len);
saved->saved_input_len = saved_input_len;
}
@@
-271,6
+276,9
@@
app_push (void)
#if defined TC_ARM && defined OBJ_ELF
saved->symver_state = symver_state;
#endif
#if defined TC_ARM && defined OBJ_ELF
saved->symver_state = symver_state;
#endif
+#ifdef TC_ARM
+ saved->last_char = last_char;
+#endif
/* do_scrub_begin() is not useful, just wastes time. */
/* do_scrub_begin() is not useful, just wastes time. */
@@
-284,7
+292,7
@@
app_push (void)
void
app_pop (char *arg)
{
void
app_pop (char *arg)
{
-
register
struct app_save *saved = (struct app_save *) arg;
+ struct app_save *saved = (struct app_save *) arg;
/* There is no do_scrub_end (). */
state = saved->state;
/* There is no do_scrub_end (). */
state = saved->state;
@@
-310,6
+318,9
@@
app_pop (char *arg)
#if defined TC_ARM && defined OBJ_ELF
symver_state = saved->symver_state;
#endif
#if defined TC_ARM && defined OBJ_ELF
symver_state = saved->symver_state;
#endif
+#ifdef TC_ARM
+ last_char = saved->last_char;
+#endif
free (arg);
}
free (arg);
}
@@
-360,7
+371,7
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
char *from;
char *fromend;
size_t fromlen;
char *from;
char *fromend;
size_t fromlen;
-
register
int ch, ch2 = 0;
+ int ch, ch2 = 0;
/* Character that started the string we're working on. */
static char quotechar;
/* Character that started the string we're working on. */
static char quotechar;
@@
-591,13
+602,11
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
state = old_state;
PUT (ch);
}
state = old_state;
PUT (ch);
}
-#ifndef NO_STRING_ESCAPES
- else if (ch == '\\')
+ else if (TC_STRING_ESCAPES && ch == '\\')
{
state = 6;
PUT (ch);
}
{
state = 6;
PUT (ch);
}
-#endif
else if (scrub_m68k_mri && ch == '\n')
{
/* Just quietly terminate the string. This permits lines like
else if (scrub_m68k_mri && ch == '\n')
{
/* Just quietly terminate the string. This permits lines like
@@
-695,6
+704,7
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
state = 9;
break;
}
state = 9;
break;
}
+ /* Fall through. */
case 17:
/* We have seen "af" at the start of a symbol,
a ' here is a part of that symbol. */
case 17:
/* We have seen "af" at the start of a symbol,
a ' here is a part of that symbol. */
@@
-1040,7
+1050,6
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
PUT (ch);
break;
PUT (ch);
break;
-#ifndef IEEE_STYLE
case LEX_IS_ONECHAR_QUOTE:
#ifdef H_TICK_HEX
if (state == 9 && enable_h_tick_hex)
case LEX_IS_ONECHAR_QUOTE:
#ifdef H_TICK_HEX
if (state == 9 && enable_h_tick_hex)
@@
-1102,7
+1111,6
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
out_string = out_buf;
PUT (*out_string++);
break;
out_string = out_buf;
PUT (*out_string++);
break;
-#endif
case LEX_IS_COLON:
#ifdef KEEP_WHITE_AROUND_COLON
case LEX_IS_COLON:
#ifdef KEEP_WHITE_AROUND_COLON
@@
-1187,7
+1195,7
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
state = -2;
break;
}
state = -2;
break;
}
- else
+ else
if (ch2 != EOF)
{
UNGET (ch2);
}
{
UNGET (ch2);
}
@@
-1284,14
+1292,14
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
#ifdef TC_ARM
/* For the ARM, care is needed not to damage occurrences of \@
by stripping the @ onwards. Yuck. */
#ifdef TC_ARM
/* For the ARM, care is needed not to damage occurrences of \@
by stripping the @ onwards. Yuck. */
- if (
to > tostart && *(to - 1
) == '\\')
+ if (
(to > tostart ? to[-1] : last_char
) == '\\')
/* Do not treat the @ as a start-of-comment. */
goto de_fault;
#endif
#ifdef WARN_COMMENTS
if (!found_comment)
/* Do not treat the @ as a start-of-comment. */
goto de_fault;
#endif
#ifdef WARN_COMMENTS
if (!found_comment)
-
as_where (&found_comment_file,
&found_comment);
+
found_comment_file = as_where (
&found_comment);
#endif
do
{
#endif
do
{
@@
-1321,8
+1329,8
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
else
UNGET (quot);
}
else
UNGET (quot);
}
- /* FALL THROUGH */
#endif
#endif
+ /* Fall through. */
case LEX_IS_SYMBOL_COMPONENT:
if (state == 10)
case LEX_IS_SYMBOL_COMPONENT:
if (state == 10)
@@
-1464,6
+1472,10
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
fromeof:
/* We have reached the end of the input. */
fromeof:
/* We have reached the end of the input. */
+#ifdef TC_ARM
+ if (to > tostart)
+ last_char = to[-1];
+#endif
return to - tostart;
tofull:
return to - tostart;
tofull:
@@
-1477,5
+1489,9
@@
do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
else
saved_input = NULL;
else
saved_input = NULL;
+#ifdef TC_ARM
+ if (to > tostart)
+ last_char = to[-1];
+#endif
return to - tostart;
}
return to - tostart;
}
This page took
0.02765 seconds
and
4
git commands to generate.