X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/cmd/compile/internal/ir
opt
/
golang
/
1.19.4
/
src
/
cmd
/
compile
/
internal
/
ir
/
📁
..
📄
bitset.go
(1.43 KB)
📄
cfg.go
(1.13 KB)
📄
class_string.go
(755 B)
📄
const.go
(2.15 KB)
📄
copy.go
(2.7 KB)
📄
dump.go
(6.21 KB)
📄
expr.go
(27.38 KB)
📄
fmt.go
(27.33 KB)
📄
func.go
(15.67 KB)
📄
ir.go
(171 B)
📄
mini.go
(2.8 KB)
📄
mknode.go
(5.09 KB)
📄
name.go
(17.32 KB)
📄
node.go
(17.99 KB)
📄
node_gen.go
(28.72 KB)
📄
op_string.go
(5.07 KB)
📄
package.go
(757 B)
📄
scc.go
(4.2 KB)
📄
sizeof_test.go
(804 B)
📄
stmt.go
(9.43 KB)
📄
symtab.go
(1.73 KB)
📄
type.go
(2.65 KB)
📄
val.go
(2.86 KB)
📄
visit.go
(5.41 KB)
Editing: mini.go
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run -mod=mod mknode.go // Note: see comment at top of mknode.go package ir import ( "cmd/compile/internal/types" "cmd/internal/src" "fmt" "go/constant" ) // A miniNode is a minimal node implementation, // meant to be embedded as the first field in a larger node implementation, // at a cost of 8 bytes. // // A miniNode is NOT a valid Node by itself: the embedding struct // must at the least provide: // // func (n *MyNode) String() string { return fmt.Sprint(n) } // func (n *MyNode) rawCopy() Node { c := *n; return &c } // func (n *MyNode) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) } // // The embedding struct should also fill in n.op in its constructor, // for more useful panic messages when invalid methods are called, // instead of implementing Op itself. type miniNode struct { pos src.XPos // uint32 op Op // uint8 bits bitset8 esc uint16 } // posOr returns pos if known, or else n.pos. // For use in DeepCopy. func (n *miniNode) posOr(pos src.XPos) src.XPos { if pos.IsKnown() { return pos } return n.pos } // op can be read, but not written. // An embedding implementation can provide a SetOp if desired. // (The panicking SetOp is with the other panics below.) func (n *miniNode) Op() Op { return n.op } func (n *miniNode) Pos() src.XPos { return n.pos } func (n *miniNode) SetPos(x src.XPos) { n.pos = x } func (n *miniNode) Esc() uint16 { return n.esc } func (n *miniNode) SetEsc(x uint16) { n.esc = x } const ( miniTypecheckShift = 0 miniWalked = 1 << 2 // to prevent/catch re-walking ) func (n *miniNode) Typecheck() uint8 { return n.bits.get2(miniTypecheckShift) } func (n *miniNode) SetTypecheck(x uint8) { if x > 2 { panic(fmt.Sprintf("cannot SetTypecheck %d", x)) } n.bits.set2(miniTypecheckShift, x) } func (n *miniNode) Walked() bool { return n.bits&miniWalked != 0 } func (n *miniNode) SetWalked(x bool) { n.bits.set(miniWalked, x) } // Empty, immutable graph structure. func (n *miniNode) Init() Nodes { return Nodes{} } // Additional functionality unavailable. func (n *miniNode) no(name string) string { return "cannot " + name + " on " + n.op.String() } func (n *miniNode) Type() *types.Type { return nil } func (n *miniNode) SetType(*types.Type) { panic(n.no("SetType")) } func (n *miniNode) Name() *Name { return nil } func (n *miniNode) Sym() *types.Sym { return nil } func (n *miniNode) Val() constant.Value { panic(n.no("Val")) } func (n *miniNode) SetVal(v constant.Value) { panic(n.no("SetVal")) } func (n *miniNode) NonNil() bool { return false } func (n *miniNode) MarkNonNil() { panic(n.no("MarkNonNil")) }
Upload File
Create Folder