mirror of https://github.com/golang/go.git
cmd/compile/internal/importer: clean up support.go
This commit is contained in:
parent
3cefe69c5a
commit
89eb0c0fc4
|
|
@ -8,6 +8,7 @@ package importer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"cmd/compile/internal/base"
|
"cmd/compile/internal/base"
|
||||||
|
"cmd/compile/internal/types"
|
||||||
"cmd/compile/internal/types2"
|
"cmd/compile/internal/types2"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/token"
|
"go/token"
|
||||||
|
|
@ -23,8 +24,6 @@ func errorf(format string, args ...interface{}) {
|
||||||
panic(fmt.Sprintf(format, args...))
|
panic(fmt.Sprintf(format, args...))
|
||||||
}
|
}
|
||||||
|
|
||||||
const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go
|
|
||||||
|
|
||||||
// Synthesize a token.Pos
|
// Synthesize a token.Pos
|
||||||
type fakeFileSet struct {
|
type fakeFileSet struct {
|
||||||
fset *token.FileSet
|
fset *token.FileSet
|
||||||
|
|
@ -67,13 +66,12 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func chanDir(d int) types2.ChanDir {
|
func chanDir(d int) types2.ChanDir {
|
||||||
// tag values must match the constants in cmd/compile/internal/gc/go.go
|
switch types.ChanDir(d) {
|
||||||
switch d {
|
case types.Crecv:
|
||||||
case 1 /* Crecv */ :
|
|
||||||
return types2.RecvOnly
|
return types2.RecvOnly
|
||||||
case 2 /* Csend */ :
|
case types.Csend:
|
||||||
return types2.SendOnly
|
return types2.SendOnly
|
||||||
case 3 /* Cboth */ :
|
case types.Cboth:
|
||||||
return types2.SendRecv
|
return types2.SendRecv
|
||||||
default:
|
default:
|
||||||
errorf("unexpected channel dir %d", d)
|
errorf("unexpected channel dir %d", d)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue