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
3ed8294e
Commit
3ed8294e
authored
Mar 23, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r574
parent
36d747f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
gcc/cccp.c
+24
-14
No files found.
gcc/cccp.c
View file @
3ed8294e
...
...
@@ -201,6 +201,7 @@ static void pfatal_with_name ();
static
void
perror_with_name
();
static
void
print_containing_files
();
static
int
lookup_import
();
static
int
lookup_include
();
static
int
check_preconditions
();
static
void
pcfinclude
();
static
void
pcstring_used
();
...
...
@@ -3730,25 +3731,13 @@ get_filename:
fname
=
(
char
*
)
xmalloc
(
max_include_len
+
flen
+
2
);
/* + 2 above for slash and terminating null. */
/* See if we already included this file and we can tell in advance
(from a #ifndef around its contents last time)
that there is no need to include it again. */
{
struct
file_name_list
*
l
=
all_include_files
;
strncpy
(
fname
,
fbeg
,
flen
);
fname
[
flen
]
=
0
;
for
(;
l
;
l
=
l
->
next
)
if
(
!
strcmp
(
fname
,
l
->
fname
)
&&
l
->
control_macro
&&
lookup
(
l
->
control_macro
,
-
1
,
-
1
))
return
0
;
}
/* If specified file name is absolute, just open it. */
if
(
*
fbeg
==
'/'
)
{
strncpy
(
fname
,
fbeg
,
flen
);
fname
[
flen
]
=
0
;
if
(
lookup_include
(
fname
))
return
0
;
if
(
importing
)
f
=
lookup_import
(
fname
);
else
...
...
@@ -3791,6 +3780,10 @@ get_filename:
f
=
open
(
fname
,
O_RDONLY
,
0666
);
if
(
f
==
-
2
)
return
0
;
/* Already included this file */
if
(
lookup_include
(
fname
))
{
close
(
f
);
return
0
;
}
if
(
f
>=
0
)
break
;
}
...
...
@@ -3921,6 +3914,23 @@ get_filename:
return
0
;
}
/* Return nonzero if there is no need to include file NAME
because it has already been included and it contains a conditional
to make a repeated include do nothing. */
static
int
lookup_include
(
name
)
char
*
name
;
{
struct
file_name_list
*
l
=
all_include_files
;
for
(;
l
;
l
=
l
->
next
)
if
(
!
strcmp
(
name
,
l
->
fname
)
&&
l
->
control_macro
&&
lookup
(
l
->
control_macro
,
-
1
,
-
1
))
return
1
;
return
0
;
}
/* Process the contents of include file FNAME, already open on descriptor F,
with output to OP.
SYSTEM_HEADER_P is 1 if this file was specified using <...>.
...
...
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