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
c5d9004e
Commit
c5d9004e
authored
Jul 11, 2000
by
Bruce Korb
Committed by
Bruce Korb
Jul 11, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove obsolete fix tests
From-SVN: r34960
parent
b449f23a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
203 deletions
+5
-203
gcc/ChangeLog
+5
-0
gcc/fixinc/fixtests.c
+0
-203
No files found.
gcc/ChangeLog
View file @
c5d9004e
2000-07-11 Bruce Korb <bkorb@gnu.org>
* fixinc/fixtests.c(double_slash): obsolete
(else_endif_label): likewise
2000-07-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cpplex.c (T, I, S, C, N): Avoid non-constant initializers.
...
...
gcc/fixinc/fixtests.c
View file @
c5d9004e
...
...
@@ -56,8 +56,6 @@ typedef struct {
}
test_entry_t
;
#define FIX_TEST_TABLE \
_FT_( "double_slash", double_slash_test ) \
_FT_( "else_endif_label", else_endif_label_test ) \
_FT_( "machine_name", machine_name_test )
...
...
@@ -66,207 +64,6 @@ static apply_fix_p_t test ( fname, text ) \
tCC* fname; \
tCC* text;
/*
* Skip over a quoted string. Single quote strings may
* contain multiple characters if the first character is
* a backslash. Especially a backslash followed by octal digits.
* We are not doing a correctness syntax check here.
*/
static
tCC
*
skip_quote
(
q
,
text
)
char
q
;
char
*
text
;
{
for
(;;)
{
char
ch
=
*
(
text
++
);
switch
(
ch
)
{
case
'\\'
:
text
++
;
/* skip over whatever character follows */
break
;
case
'"'
:
case
'\''
:
if
(
ch
!=
q
)
break
;
/*FALLTHROUGH*/
case
'\n'
:
case
NUL
:
goto
skip_done
;
}
}
skip_done
:
;
return
text
;
}
TEST_FOR_FIX_PROC_HEAD
(
double_slash_test
)
{
if
(
is_cxx_header
(
fname
,
text
))
return
SKIP_FIX
;
/* Now look for the comment markers in the text */
for
(;;)
{
char
ch
=
*
(
text
++
);
switch
(
ch
)
{
case
'/'
:
switch
(
*
text
)
/* do not advance `text' here */
{
case
'/'
:
/*
We found a "//" pair in open text.
The fix must be applied
*/
return
APPLY_FIX
;
case
'*'
:
/* We found a C-style comment. Skip forward to the end */
text
=
strstr
(
text
+
1
,
"*/"
);
if
(
text
==
(
char
*
)
NULL
)
goto
test_done
;
text
+=
2
;
}
break
;
case
NUL
:
goto
test_done
;
case
'"'
:
case
'\''
:
text
=
skip_quote
(
ch
,
text
);
}
}
test_done
:
;
return
SKIP_FIX
;
}
TEST_FOR_FIX_PROC_HEAD
(
else_endif_label_test
)
{
static
int
compiled
=
0
;
tSCC
label_pat
[]
=
"^[
\t
]*#[
\t
]*(else|endif)"
;
static
regex_t
label_re
;
char
ch
;
tCC
*
pz_next
;
tCC
*
all_text
=
text
;
regmatch_t
match
[
2
];
/*
This routine may be run many times within a single execution.
Do the compile once only in that case. In the standalone case,
we waste 10 bytes of memory and a test, branch and increment delay. */
if
(
!
compiled
)
{
compiled
++
;
compile_re
(
label_pat
,
&
label_re
,
1
,
"label pattern"
,
"else_endif_label_test"
);
}
for
(;;)
/* entire file */
{
/* Find the next else or endif in the file. */
if
(
regexec
(
&
label_re
,
text
,
2
,
match
,
0
)
!=
0
)
break
;
pz_next
=
text
+
match
[
0
].
rm_eo
;
/* Scan from where we are up to that position, to make sure
we didn't find something in a string or comment. */
while
(
pz_next
>
text
)
{
/*
Advance the scanning pointer. If we are at the start
of a quoted string or a comment, then skip the entire unit */
ch
=
*
(
text
++
);
switch
(
ch
)
{
case
'/'
:
/*
Skip comments */
if
(
*
text
==
'*'
)
{
text
=
strstr
(
text
+
1
,
"*/"
);
if
(
text
==
(
char
*
)
NULL
)
return
SKIP_FIX
;
text
+=
2
;
continue
;
}
break
;
case
'"'
:
case
'\''
:
text
=
skip_quote
(
ch
,
text
);
break
;
}
}
if
(
pz_next
<
text
)
continue
;
/* We're at the end of a real directive. Check for bogons here. */
for
(;;)
{
char
ch
=
*
(
pz_next
++
);
switch
(
ch
)
{
case
'\n'
:
/* It is clean. No bogons on this directive. */
goto
next_directive
;
case
'\\'
:
/* Skip escaped newlines. Otherwise, we have a bogon. */
if
(
*
pz_next
!=
'\n'
)
return
APPLY_FIX
;
pz_next
++
;
break
;
case
'/'
:
/* Skip comments. Otherwise, we have a bogon */
switch
(
*
pz_next
)
{
case
'/'
:
/* // in a C header is a bogon. */
if
(
!
is_cxx_header
(
fname
,
all_text
))
return
APPLY_FIX
;
/* C++ comment is allowed in a C++ header.
Skip to newline and continue. */
pz_next
=
strchr
(
pz_next
+
1
,
'\n'
);
if
(
pz_next
==
(
char
*
)
NULL
)
return
SKIP_FIX
;
pz_next
++
;
goto
next_directive
;
case
'*'
:
/* A comment for either C++ or C. Skip over it. */
pz_next
=
strstr
(
pz_next
+
1
,
"*/"
);
if
(
pz_next
==
(
char
*
)
NULL
)
return
SKIP_FIX
;
pz_next
+=
2
;
break
;
default
:
return
APPLY_FIX
;
}
break
;
default
:
if
(
!
isspace
(
ch
))
return
APPLY_FIX
;
}
/* switch (ch) */
}
/* for (bogon check loop) */
next_directive
:
;
text
=
pz_next
;
}
/* for (entire file) loop */
return
SKIP_FIX
;
}
TEST_FOR_FIX_PROC_HEAD
(
machine_name_test
)
{
...
...
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