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
e3953a66
Commit
e3953a66
authored
Sep 28, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Fix handling of omitted expression in switch.
From-SVN: r191842
parent
ddd06f53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
19 deletions
+10
-19
gcc/go/gofrontend/statements.cc
+10
-19
No files found.
gcc/go/gofrontend/statements.cc
View file @
e3953a66
...
...
@@ -3313,16 +3313,10 @@ Case_clauses::Case_clause::lower(Block* b, Temporary_statement* val_temp,
p
!=
this
->
cases_
->
end
();
++
p
)
{
Expression
*
this_cond
;
if
(
val_temp
==
NULL
)
this_cond
=
*
p
;
else
{
Expression
*
ref
=
Expression
::
make_temporary_reference
(
val_temp
,
loc
);
this_cond
=
Expression
::
make_binary
(
OPERATOR_EQEQ
,
ref
,
*
p
,
loc
);
}
Expression
*
ref
=
Expression
::
make_temporary_reference
(
val_temp
,
loc
);
Expression
*
this_cond
=
Expression
::
make_binary
(
OPERATOR_EQEQ
,
ref
,
*
p
,
loc
);
if
(
cond
==
NULL
)
cond
=
this_cond
;
else
...
...
@@ -3866,15 +3860,12 @@ Switch_statement::do_lower(Gogo*, Named_object*, Block* enclosing,
return
Statement
::
make_statement
(
val
,
true
);
}
Temporary_statement
*
val_temp
;
if
(
this
->
val_
==
NULL
)
val_temp
=
NULL
;
else
{
// var val_temp VAL_TYPE = VAL
val_temp
=
Statement
::
make_temporary
(
NULL
,
this
->
val_
,
loc
);
b
->
add_statement
(
val_temp
);
}
// var val_temp VAL_TYPE = VAL
Expression
*
val
=
this
->
val_
;
if
(
val
==
NULL
)
val
=
Expression
::
make_boolean
(
true
,
loc
);
Temporary_statement
*
val_temp
=
Statement
::
make_temporary
(
NULL
,
val
,
loc
);
b
->
add_statement
(
val_temp
);
this
->
clauses_
->
lower
(
b
,
val_temp
,
this
->
break_label
());
...
...
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