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
6be492ab
Commit
6be492ab
authored
Mar 21, 1995
by
Per Bothner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged in earlier cccp.c changes
From-SVN: r9218
parent
7e127823
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
24 deletions
+46
-24
gcc/cpplib.c
+46
-22
gcc/cpplib.h
+0
-2
No files found.
gcc/cpplib.c
View file @
6be492ab
...
...
@@ -291,7 +291,7 @@ static void pcstring_used ();
static
int
check_macro_name
();
static
int
compare_defs
();
static
int
compare_token_lists
();
static
int
eval_if_expression
();
static
HOST_WIDE_INT
eval_if_expression
();
static
int
change_newlines
();
static
int
line_for_error
();
extern
int
hashf
();
...
...
@@ -313,6 +313,8 @@ enum file_change_code {same_file, enter_file, leave_file};
/* External declarations. */
extern
HOST_WIDE_INT
cpp_parse_expr
PARAMS
((
cpp_reader
*
));
extern
char
*
getenv
();
extern
FILE
*
fdopen
();
extern
char
*
version_string
;
...
...
@@ -1696,9 +1698,31 @@ create_definition (buf, limit, pfile, predefinition)
defn
->
args
.
argnames
[
i
]
=
0
;
}
}
else
{
/* simple expansion or empty definition; gobble it */
if
(
is_hor_space
[
*
bp
])
++
bp
;
/* skip exactly one blank/tab char */
/* Simple expansion or empty definition. */
if
(
bp
<
limit
)
{
if
(
is_hor_space
[
*
bp
])
{
bp
++
;
SKIP_WHITE_SPACE
(
bp
);
}
else
{
switch
(
*
bp
)
{
case
'!'
:
case
'"'
:
case
'#'
:
case
'%'
:
case
'&'
:
case
'\''
:
case
')'
:
case
'*'
:
case
'+'
:
case
','
:
case
'-'
:
case
'.'
:
case
'/'
:
case
':'
:
case
';'
:
case
'<'
:
case
'='
:
case
'>'
:
case
'?'
:
case
'['
:
case
'\\'
:
case
']'
:
case
'^'
:
case
'{'
:
case
'|'
:
case
'}'
:
case
'~'
:
cpp_warning
(
pfile
,
"missing white space after `#define %.*s'"
,
sym_length
,
symname
);
break
;
default
:
cpp_pedwarn
(
pfile
,
"missing white space after `#define %.*s'"
,
sym_length
,
symname
);
break
;
}
}
}
/* now everything from bp before limit is the definition. */
defn
=
collect_expansion
(
pfile
,
bp
,
limit
,
-
1
,
NULL_PTR
);
defn
->
args
.
argnames
=
(
U_CHAR
*
)
""
;
...
...
@@ -3184,7 +3208,7 @@ do_include (pfile, keyword, unused1, unused2)
int
angle_brackets
=
0
;
/* 0 for "...", 1 for <...> */
int
pcf
=
-
1
;
char
*
pcfbuf
;
int
pcfbuflimit
;
char
*
pcfbuflimit
;
int
pcfnum
;
f
=
-
1
;
/* JF we iz paranoid! */
...
...
@@ -3383,6 +3407,11 @@ do_include (pfile, keyword, unused1, unused2)
}
}
#endif
/* VMS */
/* ??? There are currently 3 separate mechanisms for avoiding processing
of redundant include files: #import, #pragma once, and
redundant_include_p. It would be nice if they were unified. */
if
(
redundant_include_p
(
pfile
,
fname
))
return
0
;
if
(
importing
)
f
=
lookup_import
(
pfile
,
fname
,
searchptr
);
else
...
...
@@ -3394,10 +3423,6 @@ do_include (pfile, keyword, unused1, unused2)
cpp_warning
(
pfile
,
"Header file %s exists, but is not readable"
,
fname
);
#endif
if
(
redundant_include_p
(
pfile
,
fname
))
{
close
(
f
);
return
0
;
}
if
(
f
>=
0
)
break
;
}
...
...
@@ -3462,8 +3487,6 @@ do_include (pfile, keyword, unused1, unused2)
cpp_error
(
pfile
,
"No include path in which to find %s"
,
fname
);
}
else
{
struct
stat
stat_f
;
/* Check to see if this include file is a once-only include file.
If so, give up. */
...
...
@@ -3520,10 +3543,13 @@ do_include (pfile, keyword, unused1, unused2)
pcfbuf
=
0
;
pcfnum
=
0
;
fstat
(
f
,
&
stat_f
);
#if 0
if (!no_precomp)
{
struct stat stat_f;
fstat (f, &stat_f);
do {
sprintf (pcftry, "%s%d", fname, pcfnum++);
...
...
@@ -3533,7 +3559,8 @@ do_include (pfile, keyword, unused1, unused2)
struct stat s;
fstat (pcf, &s);
if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
if (bcmp ((char *) &stat_f.st_ino, (char *) &s.st_ino,
sizeof (s.st_ino))
|| stat_f.st_dev != s.st_dev)
{
pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
...
...
@@ -3548,6 +3575,7 @@ do_include (pfile, keyword, unused1, unused2)
}
}
} while (pcf != -1 && !pcfbuf);
}
#endif
/* Actually process the file */
...
...
@@ -4123,9 +4151,7 @@ do_if (pfile, keyword, buf, limit)
struct
directive
*
keyword
;
U_CHAR
*
buf
,
*
limit
;
{
int
value
;
value
=
eval_if_expression
(
pfile
,
buf
,
limit
-
buf
);
HOST_WIDE_INT
value
=
eval_if_expression
(
pfile
,
buf
,
limit
-
buf
);
conditional_skip
(
pfile
,
value
==
0
,
T_IF
,
NULL_PTR
);
return
0
;
}
...
...
@@ -4141,8 +4167,6 @@ do_elif (pfile, keyword, buf, limit)
struct
directive
*
keyword
;
U_CHAR
*
buf
,
*
limit
;
{
int
value
;
if
(
pfile
->
if_stack
==
CPP_BUFFER
(
pfile
)
->
if_stack
)
{
cpp_error
(
pfile
,
"`#elif' not within a conditional"
);
return
0
;
...
...
@@ -4164,7 +4188,7 @@ do_elif (pfile, keyword, buf, limit)
if
(
pfile
->
if_stack
->
if_succeeded
)
skip_if_group
(
pfile
,
0
);
else
{
value
=
eval_if_expression
(
pfile
,
buf
,
limit
-
buf
);
HOST_WIDE_INT
value
=
eval_if_expression
(
pfile
,
buf
,
limit
-
buf
);
if
(
value
==
0
)
skip_if_group
(
pfile
,
0
);
else
{
...
...
@@ -4179,14 +4203,14 @@ do_elif (pfile, keyword, buf, limit)
* evaluate a #if expression in BUF, of length LENGTH,
* then parse the result as a C expression and return the value as an int.
*/
static
int
static
HOST_WIDE_INT
eval_if_expression
(
pfile
,
buf
,
length
)
cpp_reader
*
pfile
;
U_CHAR
*
buf
;
int
length
;
{
HASHNODE
*
save_defined
;
int
value
;
HOST_WIDE_INT
value
;
long
old_written
=
CPP_WRITTEN
(
pfile
);
save_defined
=
install
(
"defined"
,
-
1
,
T_SPEC_DEFINED
,
0
,
0
,
-
1
);
...
...
gcc/cpplib.h
View file @
6be492ab
...
...
@@ -650,8 +650,6 @@ extern cpp_buffer* cpp_pop_buffer PARAMS ((cpp_reader *));
extern
cpp_hashnode
*
cpp_lookup
PARAMS
((
cpp_reader
*
,
const
U_CHAR
*
,
int
,
int
));
extern
long
cpp_parse_expr
PARAMS
((
cpp_reader
*
));
#ifdef __cplusplus
}
#endif
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