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
28ed4616
Commit
28ed4616
authored
Jan 20, 1995
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bool changes
From-SVN: r8775
parent
46299de9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
22 deletions
+6
-22
gcc/cp/cp-tree.h
+1
-1
gcc/cp/cvt.c
+5
-21
No files found.
gcc/cp/cp-tree.h
View file @
28ed4616
...
...
@@ -1439,7 +1439,7 @@ extern tree delta_type_node;
extern
tree
long_long_integer_type_node
,
long_long_unsigned_type_node
;
/* For building calls to `delete'. */
extern
tree
integer_two_node
,
integer_three_node
;
extern
tree
bool
_type_node
,
true_node
,
false_node
;
extern
tree
bool
ean_type_node
,
boolean_true_node
,
boolean_
false_node
;
/* in pt.c */
/* PARM_VEC is a vector of template parameters, either IDENTIFIER_NODEs or
...
...
gcc/cp/cvt.c
View file @
28ed4616
...
...
@@ -1246,23 +1246,7 @@ cp_convert (type, expr, convtype, flags)
return
error_mark_node
;
}
if
(
code
==
BOOLEAN_TYPE
)
{
tree
newe
=
truthvalue_conversion
(
e
);
/* Avoid stupid (infinite) recursion from backend. */
if
(
TREE_CODE
(
newe
)
!=
NOP_EXPR
||
e
!=
TREE_OPERAND
(
newe
,
0
))
e
=
newe
;
if
(
TREE_TYPE
(
e
)
==
bool_type_node
)
return
e
;
else
if
(
TREE_CODE
(
e
)
==
INTEGER_CST
)
{
if
(
e
==
integer_zero_node
)
e
=
false_node
;
else
e
=
true_node
;
}
else
return
build1
(
NOP_EXPR
,
bool_type_node
,
e
);
}
return
truthvalue_conversion
(
e
);
return
fold
(
convert_to_integer
(
type
,
e
));
}
if
(
code
==
POINTER_TYPE
)
...
...
@@ -1907,8 +1891,8 @@ build_default_binary_type_conversion (code, arg1, arg2)
if
(
code
==
TRUTH_ANDIF_EXPR
||
code
==
TRUTH_ORIF_EXPR
)
{
*
arg1
=
convert
(
bool_type_node
,
*
arg1
);
*
arg2
=
convert
(
bool_type_node
,
*
arg2
);
*
arg1
=
convert
(
bool
ean
_type_node
,
*
arg1
);
*
arg2
=
convert
(
bool
ean
_type_node
,
*
arg2
);
}
else
if
(
TYPE_HAS_INT_CONVERSION
(
type1
))
{
...
...
@@ -1971,7 +1955,7 @@ build_default_unary_type_conversion (code, arg)
}
if
(
code
==
TRUTH_NOT_EXPR
)
*
arg
=
convert
(
bool_type_node
,
*
arg
);
*
arg
=
convert
(
bool
ean
_type_node
,
*
arg
);
else
if
(
TYPE_HAS_INT_CONVERSION
(
type
))
{
if
(
TYPE_HAS_REAL_CONVERSION
(
type
))
...
...
@@ -2006,7 +1990,7 @@ type_promotes_to (type)
/* bool always promotes to int (not unsigned), even if it's the same
size. */
if
(
type
==
bool_type_node
)
if
(
type
==
bool
ean
_type_node
)
type
=
integer_type_node
;
/* Normally convert enums to int, but convert wide enums to something
...
...
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