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
ae4d12ca
Commit
ae4d12ca
authored
Sep 02, 1998
by
Nick Clifton
Committed by
Nick Clifton
Sep 02, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change HANDLE_PRAGMA macro so that it will work with USE_CPPLIB
From-SVN: r22166
parent
f09db6e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
147 additions
and
22 deletions
+147
-22
gcc/cp/ChangeLog
+13
-0
gcc/cp/lex.c
+74
-15
gcc/f/ChangeLog
+11
-0
gcc/f/lex.c
+49
-7
No files found.
gcc/cp/ChangeLog
View file @
ae4d12ca
Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
* lex.c (check_newline): Call HANDLE_PRAGMA before
HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
if unknown pragmas are encountered.
(handle_sysv_pragma): Interpret return code from
handle_pragma_token (). Return success/failure indication rather
than next unprocessed character.
(pragma_getc): New function: retrieves characters from the
input stream. Defined when HANDLE_PRAGMA is defined.
(pragma_ungetc): New function: replaces characters back into the
input stream. Defined when HANDLE_PRAGMA is defined.
1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
* decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
...
...
gcc/cp/lex.c
View file @
ae4d12ca
...
@@ -2216,6 +2216,32 @@ get_last_nonwhite_on_line ()
...
@@ -2216,6 +2216,32 @@ get_last_nonwhite_on_line ()
return
c
;
return
c
;
}
}
#if defined HANDLE_PRAGMA
/* Local versions of these macros, that can be passed as function pointers. */
static
int
pragma_getc
()
{
int
c
;
if
(
nextchar
!=
EOF
)
{
c
=
nextchar
;
nextchar
=
EOF
;
}
else
c
=
getch
();
return
c
;
}
static
void
pragma_ungetc
(
arg
)
int
arg
;
{
yyungetc
(
arg
,
0
);
}
#endif
/* HANDLE_PRAGMA */
/* At the beginning of a line, increment the line number
/* At the beginning of a line, increment the line number
and process any #-directive on this line.
and process any #-directive on this line.
If the line is a #-directive, read the entire line and return a newline.
If the line is a #-directive, read the entire line and return a newline.
...
@@ -2282,21 +2308,29 @@ check_newline ()
...
@@ -2282,21 +2308,29 @@ check_newline ()
else
if
(
token
==
END_OF_LINE
)
else
if
(
token
==
END_OF_LINE
)
goto
skipline
;
goto
skipline
;
#ifdef HANDLE_PRAGMA
/* We invoke HANDLE_PRAGMA before HANDLE_SYSV_PRAGMA
(if both are defined), in order to give the back
end a chance to override the interpretation of
SYSV style pragmas. */
if
(
HANDLE_PRAGMA
(
pragma_getc
,
pragma_ungetc
,
IDENTIFIER_POINTER
(
yylval
.
ttype
)))
goto
skipline
;
#endif
/* HANDLE_PRAGMA */
#ifdef HANDLE_SYSV_PRAGMA
#ifdef HANDLE_SYSV_PRAGMA
if
(
handle_sysv_pragma
(
token
))
if
(
handle_sysv_pragma
(
token
))
goto
skipline
;
goto
skipline
;
#else
#endif
/* !HANDLE_SYSV_PRAGMA */
#ifdef HANDLE_PRAGMA
#if USE_CPPLIB
/* Issue a warning message if we have been asked to do so.
/* TODO: ??? */
Ignoring unknown pragmas in system header file unless
goto
skipline
;
an explcit -Wunknown-pragmas has been given. */
#else
if
(
warn_unknown_pragmas
>
1
if
(
HANDLE_PRAGMA
(
finput
,
yylval
.
ttype
))
||
(
warn_unknown_pragmas
&&
!
in_system_header
))
goto
skipline
;
warning
(
"ignoring pragma: %s"
,
token_buffer
);
#endif
/* !USE_CPPLIB */
#endif
#endif
}
}
goto
skipline
;
goto
skipline
;
}
}
else
if
(
c
==
'd'
)
else
if
(
c
==
'd'
)
...
@@ -4730,7 +4764,33 @@ handle_cp_pragma (pname)
...
@@ -4730,7 +4764,33 @@ handle_cp_pragma (pname)
{
{
register
int
token
;
register
int
token
;
if
(
!
strcmp
(
pname
,
"unit"
))
if
(
!
strcmp
(
pname
,
"vtable"
))
{
extern
tree
pending_vtables
;
/* More follows: it must be a string constant (class name). */
token
=
real_yylex
();
if
(
token
!=
STRING
||
TREE_CODE
(
yylval
.
ttype
)
!=
STRING_CST
)
{
error
(
"invalid #pragma vtable"
);
return
-
1
;
}
if
(
write_virtuals
!=
2
)
{
warning
(
"use `+e2' option to enable #pragma vtable"
);
return
-
1
;
}
pending_vtables
=
perm_tree_cons
(
NULL_TREE
,
get_identifier
(
TREE_STRING_POINTER
(
yylval
.
ttype
)),
pending_vtables
);
token
=
real_yylex
();
if
(
token
!=
END_OF_LINE
)
warning
(
"trailing characters ignored"
);
return
1
;
}
else
if
(
!
strcmp
(
pname
,
"unit"
))
{
{
/* More follows: it must be a string constant (unit name). */
/* More follows: it must be a string constant (unit name). */
token
=
real_yylex
();
token
=
real_yylex
();
...
@@ -4895,7 +4955,7 @@ handle_sysv_pragma (token)
...
@@ -4895,7 +4955,7 @@ handle_sysv_pragma (token)
case
TYPENAME
:
case
TYPENAME
:
case
STRING
:
case
STRING
:
case
CONSTANT
:
case
CONSTANT
:
handle_pragma_token
(
"ignored"
,
yylval
.
ttype
);
handle_pragma_token
(
IDENTIFIER_POINTER
(
yylval
.
ttype
)
,
yylval
.
ttype
);
break
;
break
;
case
'('
:
case
'('
:
handle_pragma_token
(
"("
,
NULL_TREE
);
handle_pragma_token
(
"("
,
NULL_TREE
);
...
@@ -4915,8 +4975,7 @@ handle_sysv_pragma (token)
...
@@ -4915,8 +4975,7 @@ handle_sysv_pragma (token)
break
;
break
;
case
END_OF_LINE
:
case
END_OF_LINE
:
default
:
default
:
handle_pragma_token
(
NULL_PTR
,
NULL_TREE
);
return
handle_pragma_token
(
NULL_PTR
,
NULL_TREE
);
return
1
;
}
}
token
=
real_yylex
();
token
=
real_yylex
();
}
}
...
...
gcc/f/ChangeLog
View file @
ae4d12ca
Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
* lex.c (ffe_lex_hash): Change how HANDLE_PRAGMA and
HANDLE_SYSV_PRAGMA would be called if they pragma parsing was
enabled in this code.
Generate warning messages if unknown pragmas are encountered.
(pragma_getc): New function: retrieves characters from the
input stream. Defined when HANDLE_PRAGMA is defined.
(pragma_ungetc): New function: replaces characters back into the
input stream. Defined when HANDLE_PRAGMA is defined.
Tue Sep 1 10:00:21 1998 Craig Burley <burley@gnu.org>
Tue Sep 1 10:00:21 1998 Craig Burley <burley@gnu.org>
* bugs.texi, g77.1, g77.texi, intdoc.in, news.texi: Doc updates
* bugs.texi, g77.1, g77.texi, intdoc.in, news.texi: Doc updates
...
...
gcc/f/lex.c
View file @
ae4d12ca
/* Implementation of Fortran lexer
/* Implementation of Fortran lexer
Copyright (C) 1995-199
7
Free Software Foundation, Inc.
Copyright (C) 1995-199
8
Free Software Foundation, Inc.
Contributed by James Craig Burley (burley@gnu.org).
Contributed by James Craig Burley (burley@gnu.org).
This file is part of GNU Fortran.
This file is part of GNU Fortran.
...
@@ -1077,6 +1077,23 @@ ffelex_get_directive_line_ (char **text, FILE *finput)
...
@@ -1077,6 +1077,23 @@ ffelex_get_directive_line_ (char **text, FILE *finput)
Returns the next character unhandled, which is always newline or EOF. */
Returns the next character unhandled, which is always newline or EOF. */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
#if FFECOM_targetCURRENT == FFECOM_targetGCC
#if defined HANDLE_PRAGMA
/* Local versions of these macros, that can be passed as function pointers. */
static
int
pragma_getc
()
{
return
getc
(
finput
);
}
static
void
pragma_ungetc
(
arg
)
int
arg
;
{
ungetc
(
arg
,
finput
);
}
#endif
/* HANDLE_PRAGMA */
static
int
static
int
ffelex_hash_
(
FILE
*
finput
)
ffelex_hash_
(
FILE
*
finput
)
{
{
...
@@ -1105,17 +1122,42 @@ ffelex_hash_ (FILE *finput)
...
@@ -1105,17 +1122,42 @@ ffelex_hash_ (FILE *finput)
&&
((
c
=
getc
(
finput
))
==
' '
||
c
==
'\t'
||
c
==
'\n'
&&
((
c
=
getc
(
finput
))
==
' '
||
c
==
'\t'
||
c
==
'\n'
||
c
==
EOF
))
||
c
==
EOF
))
{
{
goto
skipline
;
#if 0 /* g77 doesn't handle pragmas, so ignores them FOR NOW. */
#if 0 /* g77 doesn't handle pragmas, so ignores them FOR NOW. */
#ifdef HANDLE_SYSV_PRAGMA
static char buffer [128];
return handle_sysv_pragma (finput, c);
char * buff = buffer;
#else /* !HANDLE_SYSV_PRAGMA */
/* Read the pragma name into a buffer. */
while (isspace (c = getc (finput)))
continue;
do
{
* buff ++ = c;
c = getc (finput);
}
while (c != EOF && ! isspace (c) && c != '\n'
&& buff < buffer + 128);
pragma_ungetc (c);
* -- buff = 0;
#ifdef HANDLE_PRAGMA
#ifdef HANDLE_PRAGMA
HANDLE_PRAGMA (finput);
if (HANDLE_PRAGMA (pragma_getc, pragma_ungetc, buffer))
goto skipline;
#endif /* HANDLE_PRAGMA */
#endif /* HANDLE_PRAGMA */
goto skipline;
#ifdef HANDLE_SYSV_PRAGMA
if (handle_sysv_pragma (buffer))
goto skipline;
#endif /* !HANDLE_SYSV_PRAGMA */
#endif /* !HANDLE_SYSV_PRAGMA */
/* Issue a warning message if we have been asked to do so.
Ignoring unknown pragmas in system header file unless
an explcit -Wunknown-pragmas has been given. */
if (warn_unknown_pragmas > 1
|| (warn_unknown_pragmas && ! in_system_header))
warning ("ignoring pragma: %s", token_buffer);
#endif /* 0 */
#endif /* 0 */
goto
skipline
;
}
}
}
}
...
...
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