X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/cmd/compile/internal/typecheck
opt
/
golang
/
1.19.4
/
src
/
cmd
/
compile
/
internal
/
typecheck
/
📁
..
📄
bexport.go
(2.05 KB)
📁
builtin
📄
builtin.go
(15.47 KB)
📄
builtin_test.go
(624 B)
📄
const.go
(20.73 KB)
📄
crawler.go
(11.82 KB)
📄
dcl.go
(8.26 KB)
📄
export.go
(2.24 KB)
📄
expr.go
(22.15 KB)
📄
func.go
(22.75 KB)
📄
iexport.go
(53.48 KB)
📄
iimport.go
(44.98 KB)
📄
mkbuiltin.go
(5.96 KB)
📄
stmt.go
(15.65 KB)
📄
subr.go
(44.91 KB)
📄
syms.go
(2.87 KB)
📄
target.go
(312 B)
📄
type.go
(178 B)
📄
typecheck.go
(43.16 KB)
📄
universe.go
(5.19 KB)
Editing: export.go
// Copyright 2009 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. package typecheck import ( "go/constant" "cmd/compile/internal/base" "cmd/compile/internal/ir" "cmd/compile/internal/types" "cmd/internal/src" ) // importalias declares symbol s as an imported type alias with type t. // ipkg is the package being imported func importalias(pos src.XPos, s *types.Sym, t *types.Type) *ir.Name { return importobj(pos, s, ir.OTYPE, ir.PEXTERN, t) } // importconst declares symbol s as an imported constant with type t and value val. // ipkg is the package being imported func importconst(pos src.XPos, s *types.Sym, t *types.Type, val constant.Value) *ir.Name { n := importobj(pos, s, ir.OLITERAL, ir.PEXTERN, t) n.SetVal(val) return n } // importfunc declares symbol s as an imported function with type t. // ipkg is the package being imported func importfunc(pos src.XPos, s *types.Sym, t *types.Type) *ir.Name { n := importobj(pos, s, ir.ONAME, ir.PFUNC, t) n.Func = ir.NewFunc(pos) n.Func.Nname = n return n } // importobj declares symbol s as an imported object representable by op. // ipkg is the package being imported func importobj(pos src.XPos, s *types.Sym, op ir.Op, ctxt ir.Class, t *types.Type) *ir.Name { n := importsym(pos, s, op, ctxt) n.SetType(t) if ctxt == ir.PFUNC { n.Sym().SetFunc(true) } return n } func importsym(pos src.XPos, s *types.Sym, op ir.Op, ctxt ir.Class) *ir.Name { if n := s.PkgDef(); n != nil { base.Fatalf("importsym of symbol that already exists: %v", n) } n := ir.NewDeclNameAt(pos, op, s) n.Class = ctxt // TODO(mdempsky): Move this into NewDeclNameAt too? s.SetPkgDef(n) return n } // importtype returns the named type declared by symbol s. // If no such type has been declared yet, a forward declaration is returned. // ipkg is the package being imported func importtype(pos src.XPos, s *types.Sym) *ir.Name { n := importsym(pos, s, ir.OTYPE, ir.PEXTERN) n.SetType(types.NewNamed(n)) return n } // importvar declares symbol s as an imported variable with type t. // ipkg is the package being imported func importvar(pos src.XPos, s *types.Sym, t *types.Type) *ir.Name { return importobj(pos, s, ir.ONAME, ir.PEXTERN, t) }
Upload File
Create Folder