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
67988bd2
Commit
67988bd2
authored
Sep 02, 1998
by
Nick Clifton
Committed by
Nick Clifton
Sep 02, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update definitions of HANDLE_PRAGMA macro in order to conform to new spec.
From-SVN: r22168
parent
c5168e64
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
137 additions
and
121 deletions
+137
-121
gcc/ChangeLog
+14
-1
gcc/config/h8300/h8300.c
+4
-8
gcc/config/h8300/h8300.h
+11
-5
gcc/config/i960/i960.c
+66
-69
gcc/config/i960/i960.h
+2
-1
gcc/config/nextstep.c
+4
-9
gcc/config/nextstep.h
+36
-28
No files found.
gcc/ChangeLog
View file @
67988bd2
Wed Sep 2 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
Wed Sep 2 10:06:07 1998 Nick Clifton <nickc@cygnus.com>
* config/nextstep.h: Update HANDLE_PRAGMA macro.
* config/h8300/h8300.h: Update HANDLE_PRAGMA macro.
* config/i960/i960.h: Update HANDLE_PRAGMA macro.
* config/nextstep.c (handle_pragma): Take three arguments, as per
the new HANDLE_PRAGMA macro specification.
* config/h8300/h8300.c (handle_pragma): Take three arguments, as
per the new HANDLE_PRAGMA macro specification.
* config/i960/i960.c (process_pragma): Take three arguments, as
per the new HANDLE_PRAGMA macro specification.
Wed Sep 2 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
* c-lex.c (check_newline): Call HANDLE_PRAGMA before
HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
...
...
gcc/config/h8300/h8300.c
View file @
67988bd2
...
...
@@ -856,17 +856,13 @@ eq_operator (x, mode)
with this attribute may be safely used in an interrupt vector. */
int
handle_pragma
(
file
,
t
)
FILE
*
file
;
tree
t
;
handle_pragma
(
p_getc
,
p_ungetc
,
name
)
int
(
*
p_getc
)
PROTO
((
void
));
void
(
*
p_ungetc
)
PROTO
((
int
));
char
*
pname
;
{
int
retval
=
0
;
register
char
*
pname
;
if
(
TREE_CODE
(
t
)
!=
IDENTIFIER_NODE
)
return
0
;
pname
=
IDENTIFIER_POINTER
(
t
);
if
(
strcmp
(
pname
,
"interrupt"
)
==
0
)
interrupt_handler
=
retval
=
1
;
else
if
(
strcmp
(
pname
,
"saveall"
)
==
0
)
...
...
gcc/config/h8300/h8300.h
View file @
67988bd2
...
...
@@ -1358,11 +1358,17 @@ do { char dstr[30]; \
/* Define this macro if you want to implement any pragmas. If defined, it
should be a C expression to be executed when #pragma is seen. The
argument STREAM is the stdio input stream from which the source
text can be read. CH is the first character after the #pragma. The
result of the expression is the terminating character found
(newline or EOF). */
#define HANDLE_PRAGMA(FILE, NODE) handle_pragma (FILE, NODE)
argument GETC is a function which will return the next character in the
input stream, or EOF if no characters are left. The argument UNGETC is
a function which will push a character back into the input stream. The
argument NAME is the word following #pragma in the input stream. The input
stream pointer will be pointing just beyond the end of this word. The
expression should return true if it handled the pragma, false otherwise.
The input stream should be left undistrubed if false is returned, otherwise
it should be pointing at the last character after the end of the pragma
(newline or end-of-file). */
#define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME)
extern
int
handle_pragma
();
#define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop)
...
...
gcc/config/i960/i960.c
View file @
67988bd2
...
...
@@ -89,86 +89,83 @@ static int ret_label = 0;
intel compilers understand. */
int
process_pragma
(
finput
,
t
)
FILE
*
finput
;
tree
t
;
process_pragma
(
p_getc
,
p_ungetc
,
pname
)
int
(
*
p_getc
)
PROTO
((
void
));
void
(
*
p_ungetc
)
PROTO
((
int
));
char
*
pname
;
{
int
i
;
register
int
c
;
register
char
*
pname
;
char
buf
[
20
];
char
*
s
=
buf
;
int
align
;
if
(
TREE_CODE
(
t
)
!=
IDENTIFIER_NODE
)
/* Should be pragma 'far' or equivalent for callx/balx here. */
if
(
strcmp
(
pname
,
"align"
)
!=
0
)
return
0
;
pname
=
IDENTIFIER_POINTER
(
t
);
if
(
strcmp
(
pname
,
"align"
)
==
0
)
do
{
char
buf
[
20
];
char
*
s
=
buf
;
int
align
;
do
{
c
=
getc
(
finput
);
}
while
(
c
==
' '
||
c
==
'\t'
);
if
(
c
==
'('
)
c
=
getc
(
finput
);
while
(
c
>=
'0'
&&
c
<=
'9'
)
{
if
(
s
<
buf
+
sizeof
buf
-
1
)
*
s
++
=
c
;
c
=
getc
(
finput
);
}
*
s
=
'\0'
;
/* We had to read a non-numerical character to get out of the
while loop---often a newline. So, we have to put it back to
make sure we continue to parse everything properly. */
ungetc
(
c
,
finput
);
align
=
atoi
(
buf
);
switch
(
align
)
{
case
0
:
/* Return to last alignment. */
align
=
i960_last_maxbitalignment
/
8
;
/* Fall through. */
case
16
:
case
8
:
case
4
:
case
2
:
case
1
:
i960_last_maxbitalignment
=
i960_maxbitalignment
;
i960_maxbitalignment
=
align
*
8
;
break
;
default
:
/* Silently ignore bad values. */
break
;
}
/* NOTE: ic960 R3.0 pragma align definition:
#pragma align [(size)] | (identifier=size[,...])
#pragma noalign [(identifier)[,...]]
c
=
p_getc
();
}
while
(
c
==
' '
||
c
==
'\t'
);
(all parens are optional)
if
(
c
==
'('
)
c
=
p_getc
();
while
(
c
>=
'0'
&&
c
<=
'9'
)
{
if
(
s
<
buf
+
sizeof
buf
-
1
)
*
s
++
=
c
;
c
=
p_getc
();
}
*
s
=
'\0'
;
- size is [1,2,4,8,16]
- noalign means size==1
- applies only to component elements of a struct (and union?)
- identifier applies to structure tag (only)
- missing identifier means next struct
/* We had to read a non-numerical character to get out of the
while loop---often a newline. So, we have to put it back to
make sure we continue to parse everything properly. */
p_ungetc
(
c
);
- alignment rules for bitfields need more investigation */
align
=
atoi
(
buf
);
return
1
;
switch
(
align
)
{
case
0
:
/* Return to last alignment. */
align
=
i960_last_maxbitalignment
/
8
;
/* Fall through. */
case
16
:
case
8
:
case
4
:
case
2
:
case
1
:
i960_last_maxbitalignment
=
i960_maxbitalignment
;
i960_maxbitalignment
=
align
*
8
;
break
;
default
:
/* Silently ignore bad values. */
break
;
}
/* Should be pragma 'far' or equivalent for callx/balx here. */
return
0
;
/* NOTE: ic960 R3.0 pragma align definition:
#pragma align [(size)] | (identifier=size[,...])
#pragma noalign [(identifier)[,...]]
(all parens are optional)
- size is [1,2,4,8,16]
- noalign means size==1
- applies only to component elements of a struct (and union?)
- identifier applies to structure tag (only)
- missing identifier means next struct
- alignment rules for bitfields need more investigation */
return
1
;
}
/* Initialize variables before compiling any files. */
...
...
gcc/config/i960/i960.h
View file @
67988bd2
...
...
@@ -122,7 +122,8 @@ Boston, MA 02111-1307, USA. */
fprintf (asm_out_file, "\t.type\t0x%x;", A)
/* Handle pragmas for compatibility with Intel's compilers. */
#define HANDLE_PRAGMA(FILE, NODE) process_pragma (FILE, NODE)
#define HANDLE_PRAGMA(GET, UNGET, NAME) process_pragma (GET, UNGET, NAME)
extern
int
process_pragma
();
/* Run-time compilation parameters selecting different hardware subsets. */
...
...
gcc/config/nextstep.c
View file @
67988bd2
...
...
@@ -45,12 +45,12 @@ extern char *get_directive_line ();
The result is 1 if the pragma was handled. */
int
handle_pragma
(
finput
,
node
)
FILE
*
finput
;
tree
node
;
handle_pragma
(
p_getc
,
p_ungetc
,
name
)
int
(
*
p_getc
)
PROTO
((
void
));
void
(
*
p_ungetc
)
PROTO
((
int
));
char
*
pname
;
{
int
retval
=
0
;
register
char
*
pname
;
/* Record initial setting of optimize flag, so we can restore it. */
if
(
!
pragma_initialized
)
...
...
@@ -59,11 +59,6 @@ handle_pragma (finput, node)
initial_optimize_flag
=
optimize
;
}
if
(
TREE_CODE
(
node
)
!=
IDENTIFIER_NODE
)
return
0
;
pname
=
IDENTIFIER_POINTER
(
node
);
if
(
strcmp
(
pname
,
"CC_OPT_ON"
)
==
0
)
{
optimize
=
1
,
obey_regdecls
=
0
;
...
...
gcc/config/nextstep.h
View file @
67988bd2
...
...
@@ -27,42 +27,43 @@ Boston, MA 02111-1307, USA. */
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \
{ \
{ GPLUSPLUS_INCLUDE_DIR,
1, 1 },
\
{ LOCAL_INCLUDE_DIR, 0, 1 }, \
{ TOOL_INCLUDE_DIR,
0, 1 },
\
{ GCC_INCLUDE_DIR,
0, 0 },
\
{ GPLUSPLUS_INCLUDE_DIR,
"G++", 1, 1 },
\
{ LOCAL_INCLUDE_DIR, 0,
0,
1 }, \
{ TOOL_INCLUDE_DIR,
"BINUTILS", 0, 1 },
\
{ GCC_INCLUDE_DIR,
"GCC", 0, 0 },
\
/* These are for fixincludes-fixed ansi/bsd headers \
which wouldn't be found otherwise. \
(The use of string catenation here is OK since \
NeXT's native compiler is derived from GCC.) */
\
{ GCC_INCLUDE_DIR "/ansi", 0, 0
},
\
{ GCC_INCLUDE_DIR "/bsd", 0, 0
},
\
{ "/NextDeveloper/Headers", 0, 0
},
\
{ "/NextDeveloper/Headers/ansi", 0, 0 }, \
{ "/NextDeveloper/Headers/bsd", 0, 0 }, \
{ "/LocalDeveloper/Headers", 0, 0 }, \
{ "/LocalDeveloper/Headers/ansi", 0, 0
},
\
{ "/LocalDeveloper/Headers/bsd", 0, 0 }, \
{ "/NextDeveloper/2.0CompatibleHeaders", 0, 0 }, \
{ STANDARD_INCLUDE_DIR, 0, 0
},
\
{ "/usr/include/bsd", 0, 0 }, \
{ 0, 0, 0
}
\
{ GCC_INCLUDE_DIR "/ansi", 0, 0
, 0 },
\
{ GCC_INCLUDE_DIR "/bsd", 0, 0
, 0 },
\
{ "/NextDeveloper/Headers", 0, 0
, 0 },
\
{ "/NextDeveloper/Headers/ansi", 0, 0
, 0
}, \
{ "/NextDeveloper/Headers/bsd", 0, 0
, 0
}, \
{ "/LocalDeveloper/Headers", 0, 0
, 0
}, \
{ "/LocalDeveloper/Headers/ansi", 0, 0
, 0 },
\
{ "/LocalDeveloper/Headers/bsd", 0, 0
, 0
}, \
{ "/NextDeveloper/2.0CompatibleHeaders", 0, 0
, 0
}, \
{ STANDARD_INCLUDE_DIR, 0, 0
, 0 },
\
{ "/usr/include/bsd", 0, 0
, 0
}, \
{ 0, 0, 0
, 0 }
\
}
#else
/* CROSS_COMPILE */
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \
{ \
{ GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \
{ LOCAL_INCLUDE_DIR, 0, 1 }, \
{ GCC_INCLUDE_DIR, 0, 0 }, \
{ GCC_INCLUDE_DIR "/ansi", 0, 0 }, \
{ GCC_INCLUDE_DIR "/bsd", 0, 0 }, \
{ TOOL_INCLUDE_DIR, 0, 1 }, \
{ TOOL_INCLUDE_DIR "/ansi", 0, 0 }, \
{ TOOL_INCLUDE_DIR "/bsd", 0, 0 }, \
{ STANDARD_INCLUDE_DIR, 0, 0 }, \
{ "/usr/include/bsd", 0, 0 }, \
{ 0, 0, 0 } \
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \
{ GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 }, \
{ LOCAL_INCLUDE_DIR, 0, 0, 1 }, \
{ GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
{ GCC_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
{ GCC_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
{ TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, \
{ TOOL_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
{ TOOL_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
{ STANDARD_INCLUDE_DIR, 0, 0, 0 }, \
{ "/usr/include/bsd", 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
}
#endif
/* CROSS_COMPILE */
...
...
@@ -251,7 +252,8 @@ Boston, MA 02111-1307, USA. */
/* How to parse #pragma's */
#undef HANDLE_PRAGMA
#define HANDLE_PRAGMA(FINPUT, NODE) handle_pragma (FINPUT, NODE)
#define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME)
extern
int
handle_pragma
();
/* Give methods pretty symbol names on NeXT. */
...
...
@@ -581,3 +583,9 @@ objc_section_init () \
const_section (); \
} \
while (0)
#ifdef ASM_COMMENT_START
# undef ASM_COMMENT_START
#endif
#define ASM_COMMENT_START ";#"
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