Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
05183359
Commit
05183359
authored
Apr 25, 2000
by
Neil Booth
Committed by
Neil Booth
Apr 25, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Revert previous patch until build failure cause determined.
From-SVN: r33411
parent
ac79db28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
109 deletions
+54
-109
gcc/ChangeLog
+5
-0
gcc/cpphash.c
+5
-6
gcc/cpphash.h
+0
-1
gcc/cpplex.c
+0
-0
gcc/cpplib.c
+0
-23
gcc/cpplib.h
+44
-79
No files found.
gcc/ChangeLog
View file @
05183359
2000
-
04
-
25
Neil
Booth
<
NeilB
@earthling
.
net
>
*
Revert
my
patch
below
until
cause
of
build
failures
determined
.
2000
-
04
-
25
Richard
Henderson
<
rth
@cygnus
.
com
>
2000
-
04
-
25
Richard
Henderson
<
rth
@cygnus
.
com
>
*
combine
.
c
(
combine_instructions
)
:
Add
missing
argument
*
combine
.
c
(
combine_instructions
)
:
Add
missing
argument
...
...
gcc/cpphash.c
View file @
05183359
...
@@ -459,8 +459,7 @@ collect_objlike_expansion (pfile, list)
...
@@ -459,8 +459,7 @@ collect_objlike_expansion (pfile, list)
default
:
;
default
:
;
}
}
if
(
i
>
1
&&
!
last_was_paste
if
(
i
>
1
&&
!
last_was_paste
&&
(
list
->
tokens
[
i
].
flags
&
HSPACE_BEFORE
))
&&
(
list
->
tokens
[
i
].
flags
&
PREV_WHITESPACE
))
CPP_PUTC
(
pfile
,
' '
);
CPP_PUTC
(
pfile
,
' '
);
CPP_PUTS
(
pfile
,
CPP_PUTS
(
pfile
,
...
@@ -572,10 +571,10 @@ collect_funlike_expansion (pfile, list, arglist, replacement)
...
@@ -572,10 +571,10 @@ collect_funlike_expansion (pfile, list, arglist, replacement)
}
}
if
(
last_token
!=
PASTE
&&
last_token
!=
START
if
(
last_token
!=
PASTE
&&
last_token
!=
START
&&
(
list
->
tokens
[
i
].
flags
&
PREV_WHITESPAC
E
))
&&
(
list
->
tokens
[
i
].
flags
&
HSPACE_BEFOR
E
))
CPP_PUTC
(
pfile
,
' '
);
CPP_PUTC
(
pfile
,
' '
);
if
(
last_token
==
ARG
&&
CPP_TRADITIONAL
(
pfile
)
if
(
last_token
==
ARG
&&
CPP_TRADITIONAL
(
pfile
)
&&
!
(
list
->
tokens
[
i
].
flags
&
PREV_WHITESPAC
E
))
&&
!
(
list
->
tokens
[
i
].
flags
&
HSPACE_BEFOR
E
))
endpat
->
raw_after
=
1
;
endpat
->
raw_after
=
1
;
switch
(
token
)
switch
(
token
)
...
@@ -617,7 +616,7 @@ collect_funlike_expansion (pfile, list, arglist, replacement)
...
@@ -617,7 +616,7 @@ collect_funlike_expansion (pfile, list, arglist, replacement)
{
{
int
raw_before
=
(
last_token
==
PASTE
int
raw_before
=
(
last_token
==
PASTE
||
(
CPP_TRADITIONAL
(
pfile
)
||
(
CPP_TRADITIONAL
(
pfile
)
&&
!
(
list
->
tokens
[
i
].
flags
&
PREV_WHITESPAC
E
)));
&&
!
(
list
->
tokens
[
i
].
flags
&
HSPACE_BEFOR
E
)));
add_pat
(
&
pat
,
&
endpat
,
add_pat
(
&
pat
,
&
endpat
,
CPP_WRITTEN
(
pfile
)
-
last
/* nchars */
,
j
/* argno */
,
CPP_WRITTEN
(
pfile
)
-
last
/* nchars */
,
j
/* argno */
,
...
@@ -866,7 +865,7 @@ _cpp_create_definition (pfile, list, hp)
...
@@ -866,7 +865,7 @@ _cpp_create_definition (pfile, list, hp)
/* The macro is function-like only if the next character,
/* The macro is function-like only if the next character,
with no intervening whitespace, is '('. */
with no intervening whitespace, is '('. */
else
if
(
list
->
tokens
[
1
].
type
==
CPP_OPEN_PAREN
else
if
(
list
->
tokens
[
1
].
type
==
CPP_OPEN_PAREN
&&
!
(
list
->
tokens
[
1
].
flags
&
PREV_WHITESPAC
E
))
&&
!
(
list
->
tokens
[
1
].
flags
&
HSPACE_BEFOR
E
))
{
{
struct
arglist
args
;
struct
arglist
args
;
int
replacement
;
int
replacement
;
...
...
gcc/cpphash.h
View file @
05183359
...
@@ -317,6 +317,5 @@ extern void _cpp_scan_line PARAMS ((cpp_reader *, cpp_toklist *));
...
@@ -317,6 +317,5 @@ extern void _cpp_scan_line PARAMS ((cpp_reader *, cpp_toklist *));
/* In cpplib.c */
/* In cpplib.c */
extern
int
_cpp_handle_directive
PARAMS
((
cpp_reader
*
));
extern
int
_cpp_handle_directive
PARAMS
((
cpp_reader
*
));
extern
void
_cpp_handle_eof
PARAMS
((
cpp_reader
*
));
extern
void
_cpp_handle_eof
PARAMS
((
cpp_reader
*
));
extern
void
_cpp_check_directive
PARAMS
((
cpp_toklist
*
,
cpp_token
*
));
#endif
#endif
gcc/cpplex.c
View file @
05183359
This diff is collapsed.
Click to expand it.
gcc/cpplib.c
View file @
05183359
...
@@ -150,29 +150,6 @@ DIRECTIVE_TABLE
...
@@ -150,29 +150,6 @@ DIRECTIVE_TABLE
#undef D
#undef D
#undef DIRECTIVE_TABLE
#undef DIRECTIVE_TABLE
/* Check if a token's name matches that of a known directive. Put in
this file to save exporting dtable and other unneeded information. */
void
_cpp_check_directive
(
list
,
token
)
cpp_toklist
*
list
;
cpp_token
*
token
;
{
const
char
*
name
=
list
->
namebuf
+
token
->
val
.
name
.
offset
;
size_t
len
=
token
->
val
.
name
.
len
;
unsigned
int
i
;
list
->
dir_handler
=
0
;
list
->
dir_flags
=
0
;
for
(
i
=
0
;
i
<
N_DIRECTIVES
;
i
++
)
if
(
dtable
[
i
].
length
==
len
&&
!
strncmp
(
dtable
[
i
].
name
,
name
,
len
))
{
list
->
dir_handler
=
dtable
[
i
].
func
;
list
->
dir_flags
=
dtable
[
i
].
flags
;
break
;
}
}
/* Handle a possible # directive.
/* Handle a possible # directive.
'#' has already been read. */
'#' has already been read. */
...
...
gcc/cpplib.h
View file @
05183359
...
@@ -34,26 +34,13 @@ typedef struct cpp_options cpp_options;
...
@@ -34,26 +34,13 @@ typedef struct cpp_options cpp_options;
typedef
struct
cpp_printer
cpp_printer
;
typedef
struct
cpp_printer
cpp_printer
;
typedef
struct
cpp_token
cpp_token
;
typedef
struct
cpp_token
cpp_token
;
typedef
struct
cpp_toklist
cpp_toklist
;
typedef
struct
cpp_toklist
cpp_toklist
;
typedef
struct
cpp_name
cpp_name
;
/* The first two groups, apart from '=', can appear in preprocessor
expressions. This allows a lookup table to be implemented in
_cpp_parse_expr.
The first group, to CPP_LAST_EQ, can be immediately followed by an
'='. The lexer needs operators ending in '=', like ">>=", to be in
the same order as their counterparts without the '=', like ">>". */
/* Positions in the table. */
#define CPP_LAST_EQ CPP_LSHIFT
#define CPP_FIRST_DIGRAPH CPP_HASH
/* Put operators that can appear in a preprocessor expression first.
This allows a lookup table to be implemented in _cpp_parse_expr.
Ordering within this group is currently not significant, apart
from those ending in '=' being at the end. */
#define TTYPE_TABLE \
#define TTYPE_TABLE \
T(CPP_EQ = 0, "=") \
T(CPP_PLUS = 0, "+")
/* math */
\
T(CPP_NOT, "!") \
T(CPP_GREATER, ">")
/* compare */
\
T(CPP_LESS, "<") \
T(CPP_PLUS, "+")
/* math */
\
T(CPP_MINUS, "-") \
T(CPP_MINUS, "-") \
T(CPP_MULT, "*") \
T(CPP_MULT, "*") \
T(CPP_DIV, "/") \
T(CPP_DIV, "/") \
...
@@ -64,19 +51,22 @@ typedef struct cpp_name cpp_name;
...
@@ -64,19 +51,22 @@ typedef struct cpp_name cpp_name;
T(CPP_COMPL, "~") \
T(CPP_COMPL, "~") \
T(CPP_RSHIFT, ">>") \
T(CPP_RSHIFT, ">>") \
T(CPP_LSHIFT, "<<") \
T(CPP_LSHIFT, "<<") \
\
T(CPP_NOT, "!")
/* logicals */
\
T(CPP_AND_AND, "&&")
/* logical */
\
T(CPP_AND_AND, "&&")
\
T(CPP_OR_OR, "||") \
T(CPP_OR_OR, "||") \
T(CPP_QUERY, "?") \
T(CPP_QUERY, "?") \
T(CPP_COLON, ":") \
T(CPP_COLON, ":") \
T(CPP_COMMA, ",")
/* grouping */
\
T(CPP_COMMA, ",")
/* grouping */
\
T(CPP_OPEN_PAREN, "(") \
T(CPP_OPEN_PAREN, "(") \
T(CPP_CLOSE_PAREN, ")") \
T(CPP_CLOSE_PAREN, ")") \
T(CPP_EQ_EQ, "==")
/* compare */
\
T(CPP_GREATER, ">")
/* compare */
\
T(CPP_LESS, "<") \
T(CPP_EQ_EQ, "==") \
T(CPP_NOT_EQ, "!=") \
T(CPP_NOT_EQ, "!=") \
T(CPP_GREATER_EQ, ">=") \
T(CPP_GREATER_EQ, ">=") \
T(CPP_LESS_EQ, "<=") \
T(CPP_LESS_EQ, "<=") \
\
\
/* The remainder of the punctuation. Order is not significant. */
\
T(CPP_PLUS_EQ, "+=")
/* math */
\
T(CPP_PLUS_EQ, "+=")
/* math */
\
T(CPP_MINUS_EQ, "-=") \
T(CPP_MINUS_EQ, "-=") \
T(CPP_MULT_EQ, "*=") \
T(CPP_MULT_EQ, "*=") \
...
@@ -88,67 +78,55 @@ typedef struct cpp_name cpp_name;
...
@@ -88,67 +78,55 @@ typedef struct cpp_name cpp_name;
T(CPP_COMPL_EQ, "~=") \
T(CPP_COMPL_EQ, "~=") \
T(CPP_RSHIFT_EQ, ">>=") \
T(CPP_RSHIFT_EQ, ">>=") \
T(CPP_LSHIFT_EQ, "<<=") \
T(CPP_LSHIFT_EQ, "<<=") \
/* Digraphs together, beginning with CPP_FIRST_DIGRAPH. */
\
T(CPP_EQ, "=")
/* assign */
\
T(CPP_HASH, "#")
/* digraphs */
\
T(CPP_PASTE, "##") \
T(CPP_OPEN_SQUARE, "[") \
T(CPP_CLOSE_SQUARE, "]") \
T(CPP_OPEN_BRACE, "{") \
T(CPP_CLOSE_BRACE, "}") \
/* The remainder of the punctuation. Order is not significant. */
\
T(CPP_SEMICOLON, ";")
/* structure */
\
T(CPP_ELLIPSIS, "...") \
T(CPP_BACKSLASH, "\\") \
T(CPP_PLUS_PLUS, "++")
/* increment */
\
T(CPP_PLUS_PLUS, "++")
/* increment */
\
T(CPP_MINUS_MINUS, "--") \
T(CPP_MINUS_MINUS, "--") \
T(CPP_DEREF, "->")
/* accessors */
\
T(CPP_DEREF, "->")
/* accessors */
\
T(CPP_DOT, ".") \
T(CPP_DOT, ".") \
T(CPP_OPEN_SQUARE, "[") \
T(CPP_CLOSE_SQUARE, "]") \
T(CPP_SCOPE, "::") \
T(CPP_SCOPE, "::") \
T(CPP_DEREF_STAR, "->*") \
T(CPP_DEREF_STAR, "->*") \
T(CPP_DOT_STAR, ".*") \
T(CPP_DOT_STAR, ".*") \
T(CPP_OPEN_BRACE, "{")
/* structure */
\
T(CPP_CLOSE_BRACE, "}") \
T(CPP_SEMICOLON, ";") \
T(CPP_ELLIPSIS, "...") \
T(CPP_HASH, "#") \
T(CPP_PASTE, "##") \
T(CPP_BACKSLASH, "\\") \
T(CPP_MIN, "<?")
/* extension */
\
T(CPP_MIN, "<?")
/* extension */
\
T(CPP_MAX, ">?") \
T(CPP_MAX, ">?") \
H
(CPP_OTHER, spell_other)
/* stray punctuation */
\
T
(CPP_OTHER, spell_other)
/* stray punctuation */
\
\
\
H
(CPP_NAME, spell_name)
/* word */
\
T
(CPP_NAME, spell_name)
/* word */
\
N
(CPP_INT, 0)
/* 23 */
\
T
(CPP_INT, 0)
/* 23 */
\
N
(CPP_FLOAT, 0)
/* 3.14159 */
\
T
(CPP_FLOAT, 0)
/* 3.14159 */
\
H
(CPP_NUMBER, spell_name)
/* 34_be+ta */
\
T
(CPP_NUMBER, spell_name)
/* 34_be+ta */
\
H
(CPP_CHAR, spell_char)
/* 'char' */
\
T
(CPP_CHAR, spell_char)
/* 'char' */
\
H
(CPP_WCHAR, spell_char)
/* L'char' */
\
T
(CPP_WCHAR, spell_char)
/* L'char' */
\
H
(CPP_STRING, spell_string)
/* "string" */
\
T
(CPP_STRING, spell_string)
/* "string" */
\
H
(CPP_WSTRING, spell_string)
/* L"string" */
\
T
(CPP_WSTRING, spell_string)
/* L"string" */
\
\
\
H(CPP_C_COMMENT, spell_comment)
/* Only if output comments. */
\
T(CPP_COMMENT, spell_comment)
/* Only if output comments. */
\
H(CPP_CPP_COMMENT, spell_comment)
/* Only if output comments. */
\
T(CPP_VSPACE, "\n")
/* End of line. */
\
H(CPP_CHILL_COMMENT, spell_comment)
/* Only if output comments. */
\
T(CPP_EOF, 0)
/* End of file. */
\
N(CPP_MACRO_ARG, 0)
/* Macro argument. */
\
T(CPP_HEADER_NAME, 0)
/* <stdio.h> in #include */
\
N(CPP_SUBLIST, 0)
/* Sublist. */
\
T(CPP_ASSERTION, 0)
/* (...) in #assert */
\
E(CPP_VSPACE, "\n")
/* End of line. */
\
N(CPP_EOF, 0)
/* End of file. */
\
N(CPP_HEADER_NAME, 0)
/* <stdio.h> in #include */
\
N(CPP_ASSERTION, 0)
/* (...) in #assert */
\
\
\
/* Obsolete - will be removed when no code uses them still. */
\
/* Obsolete - will be removed when no code uses them still. */
\
H(CPP_COMMENT, 0)
/* Only if output comments. */
\
T(CPP_HSPACE, 0)
/* Horizontal white space. */
\
N(CPP_HSPACE, 0)
/* Horizontal white space. */
\
T(CPP_POP, 0)
/* End of buffer. */
\
N(CPP_POP, 0)
/* End of buffer. */
\
T(CPP_DIRECTIVE, 0)
/* #define and the like */
\
N(CPP_DIRECTIVE, 0)
/* #define and the like */
\
T(CPP_MACRO, 0)
/* Like a NAME, but expanded. */
N(CPP_MACRO, 0)
/* Like a NAME, but expanded. */
#define T(e, s) e,
#define T(e, s) e,
#define H(e, s) e,
#define N(e, s) e,
#define E(e, s) e,
enum
cpp_ttype
enum
cpp_ttype
{
{
TTYPE_TABLE
TTYPE_TABLE
N_TTYPES
N_TTYPES
};
};
#undef T
#undef T
#undef H
#undef N
#undef E
/* Payload of a NAME, NUMBER, FLOAT, STRING, or COMMENT token. */
/* Payload of a NAME, NUMBER, FLOAT, STRING, or COMMENT token. */
struct
cpp_name
struct
cpp_name
...
@@ -157,12 +135,8 @@ struct cpp_name
...
@@ -157,12 +135,8 @@ struct cpp_name
unsigned
int
offset
;
/* from list->namebuf */
unsigned
int
offset
;
/* from list->namebuf */
};
};
#define TOK_NAME(list, token) ((list)->namebuf + (token)->val.name.offset)
/* Per token flags. */
#define HSPACE_BEFORE (1 << 0)
/* token preceded by hspace */
/* Flags for the cpp_token structure. */
#define PREV_WHITESPACE 1
/* If whitespace before this token. */
#define DIGRAPH 2
/* If it was a digraph. */
#define UNSIGNED_INT 4
/* If int preprocessing token unsigned. */
/* A preprocessing token.
/* A preprocessing token.
This has been carefully packed and should occupy 16 bytes on
This has been carefully packed and should occupy 16 bytes on
...
@@ -176,9 +150,8 @@ struct cpp_token
...
@@ -176,9 +150,8 @@ struct cpp_token
unsigned
char
type
;
unsigned
char
type
;
#endif
#endif
unsigned
char
flags
;
/* flags - see above */
unsigned
char
flags
;
/* flags - see above */
unsigned
int
aux
;
/* CPP_OTHER character. Hash of a
unsigned
int
aux
;
/* hash of a NAME, or something -
NAME, or something - see uses
see uses in the code */
in the code */
union
union
{
{
struct
cpp_name
name
;
/* a string */
struct
cpp_name
name
;
/* a string */
...
@@ -195,7 +168,7 @@ typedef int (*parse_cleanup_t) PARAMS ((cpp_buffer *, cpp_reader *));
...
@@ -195,7 +168,7 @@ typedef int (*parse_cleanup_t) PARAMS ((cpp_buffer *, cpp_reader *));
struct
cpp_toklist
struct
cpp_toklist
{
{
cpp_token
*
tokens
;
/* actual tokens as an array */
struct
cpp_token
*
tokens
;
/* actual tokens as an array */
unsigned
int
tokens_used
;
/* tokens used */
unsigned
int
tokens_used
;
/* tokens used */
unsigned
int
tokens_cap
;
/* tokens allocated */
unsigned
int
tokens_cap
;
/* tokens allocated */
...
@@ -205,11 +178,6 @@ struct cpp_toklist
...
@@ -205,11 +178,6 @@ struct cpp_toklist
unsigned
int
line
;
/* starting line number */
unsigned
int
line
;
/* starting line number */
/* Comment copying. */
cpp_token
*
comments
;
/* comment tokens. */
unsigned
int
comments_used
;
/* comment tokens used. */
unsigned
int
comments_cap
;
/* comment token capacity. */
/* Only used if tokens[0].type == CPP_DIRECTIVE. This is the
/* Only used if tokens[0].type == CPP_DIRECTIVE. This is the
handler to call after lexing the rest of this line. The flags
handler to call after lexing the rest of this line. The flags
indicate whether the rest of the line gets special treatment
indicate whether the rest of the line gets special treatment
...
@@ -593,7 +561,6 @@ struct cpp_printer
...
@@ -593,7 +561,6 @@ struct cpp_printer
/* Name under which this program was invoked. */
/* Name under which this program was invoked. */
extern
const
char
*
progname
;
extern
const
char
*
progname
;
extern
void
_cpp_lex_file
PARAMS
((
cpp_reader
*
));
extern
int
cpp_handle_options
PARAMS
((
cpp_reader
*
,
int
,
char
**
));
extern
int
cpp_handle_options
PARAMS
((
cpp_reader
*
,
int
,
char
**
));
extern
enum
cpp_ttype
cpp_get_token
PARAMS
((
cpp_reader
*
));
extern
enum
cpp_ttype
cpp_get_token
PARAMS
((
cpp_reader
*
));
extern
enum
cpp_ttype
cpp_get_non_space_token
PARAMS
((
cpp_reader
*
));
extern
enum
cpp_ttype
cpp_get_non_space_token
PARAMS
((
cpp_reader
*
));
...
@@ -613,8 +580,6 @@ extern void cpp_assert PARAMS ((cpp_reader *, const char *));
...
@@ -613,8 +580,6 @@ extern void cpp_assert PARAMS ((cpp_reader *, const char *));
extern
void
cpp_undef
PARAMS
((
cpp_reader
*
,
const
char
*
));
extern
void
cpp_undef
PARAMS
((
cpp_reader
*
,
const
char
*
));
extern
void
cpp_unassert
PARAMS
((
cpp_reader
*
,
const
char
*
));
extern
void
cpp_unassert
PARAMS
((
cpp_reader
*
,
const
char
*
));
extern
void
cpp_free_token_list
PARAMS
((
cpp_toklist
*
));
/* N.B. The error-message-printer prototypes have not been nicely
/* N.B. The error-message-printer prototypes have not been nicely
formatted because exgettext needs to see 'msgid' on the same line
formatted because exgettext needs to see 'msgid' on the same line
as the name of the function in order to work properly. Only the
as the name of the function in order to work properly. Only the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment