mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.cc] cmd/internal/obj, cmd/internal/gc, new6g: reconvert
Reconvert using rsc.io/c2go rev 27b3f59. Changes to converter: - fatal does not return, so no fallthrough after fatal in switch - many more function results and variables identified as bool - simplification of negated boolean expressions Change-Id: I3bc67da5e46cb7ee613e230cf7e9533036cc870b Reviewed-on: https://go-review.googlesource.com/5171 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
786825c5e8
commit
dc7b54bed2
67 changed files with 2410 additions and 2509 deletions
|
|
@ -272,7 +272,7 @@ func allocauto(ptxt *obj.Prog) {
|
|||
ll = Curfn.Dcl
|
||||
|
||||
n = ll.N
|
||||
if n.Class == PAUTO && n.Op == ONAME && !(n.Used != 0) {
|
||||
if n.Class == PAUTO && n.Op == ONAME && n.Used == 0 {
|
||||
// No locals used at all
|
||||
Curfn.Dcl = nil
|
||||
|
||||
|
|
@ -282,7 +282,7 @@ func allocauto(ptxt *obj.Prog) {
|
|||
|
||||
for ll = Curfn.Dcl; ll.Next != nil; ll = ll.Next {
|
||||
n = ll.Next.N
|
||||
if n.Class == PAUTO && n.Op == ONAME && !(n.Used != 0) {
|
||||
if n.Class == PAUTO && n.Op == ONAME && n.Used == 0 {
|
||||
ll.Next = nil
|
||||
Curfn.Dcl.End = ll
|
||||
break
|
||||
|
|
@ -360,12 +360,12 @@ func Cgen_checknil(n *Node) {
|
|||
}
|
||||
|
||||
// Ideally we wouldn't see any integer types here, but we do.
|
||||
if n.Type == nil || (!(Isptr[n.Type.Etype] != 0) && !(Isint[n.Type.Etype] != 0) && n.Type.Etype != TUNSAFEPTR) {
|
||||
if n.Type == nil || (Isptr[n.Type.Etype] == 0 && Isint[n.Type.Etype] == 0 && n.Type.Etype != TUNSAFEPTR) {
|
||||
Dump("checknil", n)
|
||||
Fatal("bad checknil")
|
||||
}
|
||||
|
||||
if ((Thearch.Thechar == '5' || Thearch.Thechar == '9') && n.Op != OREGISTER) || !(n.Addable != 0) || n.Op == OLITERAL {
|
||||
if ((Thearch.Thechar == '5' || Thearch.Thechar == '9') && n.Op != OREGISTER) || n.Addable == 0 || n.Op == OLITERAL {
|
||||
Thearch.Regalloc(®, Types[Tptr], n)
|
||||
Thearch.Cgen(n, ®)
|
||||
Thearch.Gins(obj.ACHECKNIL, ®, nil)
|
||||
|
|
@ -478,7 +478,7 @@ func compile(fn *Node) {
|
|||
if fn.Wrapper != 0 {
|
||||
ptxt.From3.Offset |= obj.WRAPPER
|
||||
}
|
||||
if fn.Needctxt != 0 {
|
||||
if fn.Needctxt {
|
||||
ptxt.From3.Offset |= obj.NEEDCTXT
|
||||
}
|
||||
if fn.Nosplit {
|
||||
|
|
@ -557,7 +557,7 @@ func compile(fn *Node) {
|
|||
Pc.Lineno = lineno
|
||||
|
||||
fixjmp(ptxt)
|
||||
if !(Debug['N'] != 0) || Debug['R'] != 0 || Debug['P'] != 0 {
|
||||
if Debug['N'] == 0 || Debug['R'] != 0 || Debug['P'] != 0 {
|
||||
regopt(ptxt)
|
||||
nilopt(ptxt)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue