2015-02-13 14:40:36 -05:00
|
|
|
// 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 gc
|
|
|
|
|
|
|
|
|
|
import (
|
2016-03-12 14:07:40 -08:00
|
|
|
"cmd/compile/internal/ssa"
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
"cmd/compile/internal/types"
|
2016-04-06 21:45:29 -07:00
|
|
|
"cmd/internal/bio"
|
2015-02-13 14:40:36 -05:00
|
|
|
"cmd/internal/obj"
|
2016-12-06 17:08:06 -08:00
|
|
|
"cmd/internal/src"
|
2015-02-13 14:40:36 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
BADWIDTH = types.BADWIDTH
|
2015-03-05 10:39:23 -08:00
|
|
|
MaxStackVarSize = 10 * 1024 * 1024
|
|
|
|
|
)
|
|
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
// isRuntimePkg reports whether p is package runtime.
|
|
|
|
|
func isRuntimePkg(p *types.Pkg) bool {
|
2017-02-28 15:51:29 -08:00
|
|
|
if compiling_runtime && p == localpkg {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
return p.Path == "runtime"
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-26 14:57:36 -07:00
|
|
|
// The Class of a variable/function describes the "storage class"
|
|
|
|
|
// of a variable or function. During parsing, storage classes are
|
|
|
|
|
// called declaration contexts.
|
|
|
|
|
type Class uint8
|
|
|
|
|
|
2015-02-13 14:40:36 -05:00
|
|
|
const (
|
2017-04-26 10:18:41 -07:00
|
|
|
Pxxx Class = iota // no class; used during ssa conversion to indicate pseudo-variables
|
|
|
|
|
PEXTERN // global variable
|
|
|
|
|
PAUTO // local variables
|
|
|
|
|
PAUTOHEAP // local variable or parameter moved to heap
|
|
|
|
|
PPARAM // input arguments
|
|
|
|
|
PPARAMOUT // output results
|
|
|
|
|
PFUNC // global function
|
2015-03-05 13:57:36 -05:00
|
|
|
|
|
|
|
|
PDISCARD // discard during parse of duplicate import
|
2017-04-26 10:18:41 -07:00
|
|
|
// Careful: Class is stored in three bits in Node.flags.
|
|
|
|
|
// Adding a new Class will overflow that.
|
2015-02-13 14:40:36 -05:00
|
|
|
)
|
|
|
|
|
|
2017-04-26 10:18:41 -07:00
|
|
|
func init() {
|
|
|
|
|
if PDISCARD != 7 {
|
|
|
|
|
panic("PDISCARD changed; does all Class values still fit in three bits?")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-22 09:51:12 +09:00
|
|
|
// note this is the runtime representation
|
|
|
|
|
// of the compilers arrays.
|
|
|
|
|
//
|
|
|
|
|
// typedef struct
|
2017-01-11 11:24:35 -08:00
|
|
|
// { // must not move anything
|
2015-10-22 09:51:12 +09:00
|
|
|
// uchar array[8]; // pointer to data
|
|
|
|
|
// uchar nel[4]; // number of elements
|
|
|
|
|
// uchar cap[4]; // allocated number of elements
|
|
|
|
|
// } Array;
|
2016-09-16 00:33:29 +10:00
|
|
|
var array_array int // runtime offsetof(Array,array) - same for String
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-09-16 00:33:29 +10:00
|
|
|
var array_nel int // runtime offsetof(Array,nel) - same for String
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-09-16 00:33:29 +10:00
|
|
|
var array_cap int // runtime offsetof(Array,cap)
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
var sizeof_Array int // runtime sizeof(Array)
|
|
|
|
|
|
2015-10-22 09:51:12 +09:00
|
|
|
// note this is the runtime representation
|
|
|
|
|
// of the compilers strings.
|
|
|
|
|
//
|
|
|
|
|
// typedef struct
|
2017-01-11 11:24:35 -08:00
|
|
|
// { // must not move anything
|
2015-10-22 09:51:12 +09:00
|
|
|
// uchar array[8]; // pointer to data
|
|
|
|
|
// uchar nel[4]; // number of elements
|
|
|
|
|
// } String;
|
2015-02-13 14:40:36 -05:00
|
|
|
var sizeof_String int // runtime sizeof(String)
|
|
|
|
|
|
|
|
|
|
var pragcgobuf string
|
|
|
|
|
|
|
|
|
|
var outfile string
|
2016-04-26 21:50:59 -04:00
|
|
|
var linkobj string
|
cmd/compile: add -dolinkobj flag
When set to false, the -dolinkobj flag instructs the compiler
not to generate or emit linker information.
This is handy when you need the compiler's export data,
e.g. for use with go/importer,
but you want to avoid the cost of full compilation.
This must be used with care, since the resulting
files are unusable for linking.
This CL interacts with #18369,
where adding gcflags and ldflags to buildid has been mooted.
On the one hand, adding gcflags would make safe use of this
flag easier, since if the full object files were needed,
a simple 'go install' would fix it.
On the other hand, this would mean that
'go install -gcflags=-dolinkobj=false' would rebuild the object files,
although any existing object files would probably suffice.
Change-Id: I8dc75ab5a40095c785c1a4d2260aeb63c4d10f73
Reviewed-on: https://go-review.googlesource.com/37384
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-02-22 00:05:18 -08:00
|
|
|
var dolinkobj bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-04-08 19:14:03 +10:00
|
|
|
var bout *bio.Writer
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-11-11 16:56:07 -08:00
|
|
|
// nerrors is the number of compiler errors reported
|
|
|
|
|
// since the last call to saveerrors.
|
2015-02-13 14:40:36 -05:00
|
|
|
var nerrors int
|
|
|
|
|
|
2016-11-11 16:56:07 -08:00
|
|
|
// nsavederrors is the total number of compiler errors
|
|
|
|
|
// reported before the last call to saveerrors.
|
2015-02-13 14:40:36 -05:00
|
|
|
var nsavederrors int
|
|
|
|
|
|
|
|
|
|
var nsyntaxerrors int
|
|
|
|
|
|
2015-05-14 19:33:31 -07:00
|
|
|
var decldepth int32
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-04-13 18:37:18 -07:00
|
|
|
var safemode bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-04-13 18:37:18 -07:00
|
|
|
var nolocalimports bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
var Debug [256]int
|
|
|
|
|
|
|
|
|
|
var debugstr string
|
|
|
|
|
|
|
|
|
|
var Debug_checknil int
|
2015-03-20 00:06:10 -04:00
|
|
|
var Debug_typeassert int
|
2015-02-13 14:40:36 -05:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var localpkg *types.Pkg // package being compiled
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2017-03-23 17:39:28 -07:00
|
|
|
var inimport bool // set during import
|
2015-02-13 14:40:36 -05:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var itabpkg *types.Pkg // fake pkg for itab entries
|
2016-03-17 06:18:13 -07:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var itablinkpkg *types.Pkg // fake package for runtime itab entries
|
2016-03-17 06:18:13 -07:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var Runtimepkg *types.Pkg // fake package runtime
|
2015-02-13 14:40:36 -05:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var racepkg *types.Pkg // package runtime/race
|
2015-02-13 14:40:36 -05:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var msanpkg *types.Pkg // package runtime/msan
|
2015-10-21 07:04:10 -07:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var unsafepkg *types.Pkg // package unsafe
|
2015-02-13 14:40:36 -05:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var trackpkg *types.Pkg // fake package for field tracking
|
2015-02-13 14:40:36 -05:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var mappkg *types.Pkg // fake package for map zero value
|
2016-04-19 08:31:04 -07:00
|
|
|
var zerosize int64
|
|
|
|
|
|
2015-02-13 14:40:36 -05:00
|
|
|
var myimportpath string
|
|
|
|
|
|
|
|
|
|
var localimport string
|
|
|
|
|
|
|
|
|
|
var asmhdr string
|
|
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var simtype [NTYPE]types.EType
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2015-03-01 07:54:01 +00:00
|
|
|
var (
|
|
|
|
|
isforw [NTYPE]bool
|
2016-09-16 00:33:29 +10:00
|
|
|
isInt [NTYPE]bool
|
|
|
|
|
isFloat [NTYPE]bool
|
|
|
|
|
isComplex [NTYPE]bool
|
2015-03-01 07:54:01 +00:00
|
|
|
issimple [NTYPE]bool
|
|
|
|
|
)
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2015-03-01 07:54:01 +00:00
|
|
|
var (
|
|
|
|
|
okforeq [NTYPE]bool
|
|
|
|
|
okforadd [NTYPE]bool
|
|
|
|
|
okforand [NTYPE]bool
|
|
|
|
|
okfornone [NTYPE]bool
|
|
|
|
|
okforcmp [NTYPE]bool
|
|
|
|
|
okforbool [NTYPE]bool
|
|
|
|
|
okforcap [NTYPE]bool
|
|
|
|
|
okforlen [NTYPE]bool
|
|
|
|
|
okforarith [NTYPE]bool
|
|
|
|
|
okforconst [NTYPE]bool
|
|
|
|
|
)
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2015-03-01 07:54:01 +00:00
|
|
|
var (
|
|
|
|
|
okfor [OEND][]bool
|
|
|
|
|
iscmp [OEND]bool
|
|
|
|
|
)
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-09-16 00:33:29 +10:00
|
|
|
var minintval [NTYPE]*Mpint
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-09-16 00:33:29 +10:00
|
|
|
var maxintval [NTYPE]*Mpint
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
var minfltval [NTYPE]*Mpflt
|
|
|
|
|
|
|
|
|
|
var maxfltval [NTYPE]*Mpflt
|
|
|
|
|
|
2016-03-09 20:29:21 -08:00
|
|
|
var xtop []*Node
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2015-08-12 14:29:50 -07:00
|
|
|
var exportlist []*Node
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2015-09-06 22:38:49 +02:00
|
|
|
var importlist []*Node // imported functions and methods with inlinable bodies
|
2015-02-13 14:40:36 -05:00
|
|
|
|
cmd/compile: factor out Pkg, Sym, and Type into package types
- created new package cmd/compile/internal/types
- moved Pkg, Sym, Type to new package
- to break cycles, for now we need the (ugly) types/utils.go
file which contains a handful of functions that must be installed
early by the gc frontend
- to break cycles, for now we need two functions to convert between
*gc.Node and *types.Node (the latter is a dummy type)
- adjusted the gc's code to use the new package and the conversion
functions as needed
- made several Pkg, Sym, and Type methods functions as needed
- renamed constructors typ, typPtr, typArray, etc. to types.New,
types.NewPtr, types.NewArray, etc.
Passes toolstash-check -all.
Change-Id: I8adfa5e85c731645d0a7fd2030375ed6ebf54b72
Reviewed-on: https://go-review.googlesource.com/39855
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-04 17:54:02 -07:00
|
|
|
var funcsyms []*types.Sym
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2015-10-26 14:57:36 -07:00
|
|
|
var dclcontext Class // PEXTERN/PAUTO
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
var Curfn *Node
|
|
|
|
|
|
|
|
|
|
var Widthptr int
|
|
|
|
|
|
|
|
|
|
var Widthreg int
|
|
|
|
|
|
|
|
|
|
var nblank *Node
|
|
|
|
|
|
2015-08-30 23:56:40 +02:00
|
|
|
var typecheckok bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-04-13 18:37:18 -07:00
|
|
|
var compiling_runtime bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
var compiling_wrappers int
|
|
|
|
|
|
2016-04-13 18:37:18 -07:00
|
|
|
var use_writebarrier bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-04-13 18:37:18 -07:00
|
|
|
var pure_go bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
var flag_installsuffix string
|
|
|
|
|
|
2016-04-13 18:37:18 -07:00
|
|
|
var flag_race bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-04-13 18:37:18 -07:00
|
|
|
var flag_msan bool
|
2015-10-21 07:04:10 -07:00
|
|
|
|
2017-04-16 05:53:06 -07:00
|
|
|
var flagDWARF bool
|
|
|
|
|
|
2015-10-20 10:00:07 -07:00
|
|
|
// Whether we are adding any sort of code instrumentation, such as
|
|
|
|
|
// when the race detector is enabled.
|
|
|
|
|
var instrumenting bool
|
|
|
|
|
|
2015-02-13 14:40:36 -05:00
|
|
|
var debuglive int
|
|
|
|
|
|
|
|
|
|
var Ctxt *obj.Link
|
|
|
|
|
|
2016-04-13 18:37:18 -07:00
|
|
|
var writearchive bool
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
var Nacl bool
|
|
|
|
|
|
|
|
|
|
var nodfp *Node
|
|
|
|
|
|
2016-09-16 00:33:29 +10:00
|
|
|
var disable_checknil int
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2017-03-28 13:52:14 -07:00
|
|
|
var autogeneratedPos src.XPos
|
|
|
|
|
|
2015-10-22 09:51:12 +09:00
|
|
|
// interface to back end
|
2015-02-13 14:40:36 -05:00
|
|
|
|
|
|
|
|
type Arch struct {
|
2016-04-06 12:01:40 -07:00
|
|
|
LinkArch *obj.LinkArch
|
|
|
|
|
|
2016-09-15 16:33:11 -07:00
|
|
|
REGSP int
|
|
|
|
|
MAXWIDTH int64
|
2017-03-10 18:34:41 -08:00
|
|
|
Use387 bool // should 386 backend use 387 FP instructions instead of sse2.
|
2015-03-18 17:26:36 -04:00
|
|
|
|
2017-04-20 10:31:39 -07:00
|
|
|
PadFrame func(int64) int64
|
|
|
|
|
ZeroRange func(*Progs, *obj.Prog, int64, int64, *uint32) *obj.Prog
|
|
|
|
|
Ginsnop func(*Progs)
|
2016-03-12 14:07:40 -08:00
|
|
|
|
|
|
|
|
// SSAMarkMoves marks any MOVXconst ops that need to avoid clobbering flags.
|
|
|
|
|
SSAMarkMoves func(*SSAGenState, *ssa.Block)
|
|
|
|
|
|
|
|
|
|
// SSAGenValue emits Prog(s) for the Value.
|
|
|
|
|
SSAGenValue func(*SSAGenState, *ssa.Value)
|
|
|
|
|
|
|
|
|
|
// SSAGenBlock emits end-of-block Progs. SSAGenValue should be called
|
|
|
|
|
// for all values in the block before SSAGenBlock.
|
|
|
|
|
SSAGenBlock func(s *SSAGenState, b, next *ssa.Block)
|
2017-04-19 11:19:53 -07:00
|
|
|
|
|
|
|
|
// ZeroAuto emits code to zero the given auto stack variable.
|
|
|
|
|
// ZeroAuto must not use any non-temporary registers.
|
|
|
|
|
// ZeroAuto will only be called for variables which contain a pointer.
|
|
|
|
|
ZeroAuto func(*Progs, *Node)
|
2015-02-13 14:40:36 -05:00
|
|
|
}
|
|
|
|
|
|
2017-03-17 13:35:36 -07:00
|
|
|
var thearch Arch
|
2015-02-13 14:40:36 -05:00
|
|
|
|
2016-10-28 11:37:45 -07:00
|
|
|
var (
|
2017-01-21 19:52:09 -08:00
|
|
|
staticbytes,
|
2017-02-06 13:40:19 -08:00
|
|
|
zerobase *Node
|
|
|
|
|
|
2016-10-28 11:37:45 -07:00
|
|
|
Newproc,
|
|
|
|
|
Deferproc,
|
|
|
|
|
Deferreturn,
|
2017-02-06 14:46:48 -08:00
|
|
|
Duffcopy,
|
|
|
|
|
Duffzero,
|
2016-10-28 11:37:45 -07:00
|
|
|
panicindex,
|
|
|
|
|
panicslice,
|
|
|
|
|
panicdivide,
|
|
|
|
|
growslice,
|
2017-01-03 16:15:38 -08:00
|
|
|
panicdottypeE,
|
|
|
|
|
panicdottypeI,
|
2016-10-28 11:37:45 -07:00
|
|
|
panicnildottype,
|
|
|
|
|
assertE2I,
|
|
|
|
|
assertE2I2,
|
|
|
|
|
assertI2I,
|
2017-04-15 08:00:08 -07:00
|
|
|
assertI2I2,
|
|
|
|
|
goschedguarded,
|
|
|
|
|
writeBarrier,
|
|
|
|
|
writebarrierptr,
|
|
|
|
|
typedmemmove,
|
2017-04-20 07:50:17 -07:00
|
|
|
typedmemclr,
|
|
|
|
|
Udiv *obj.LSym
|
2016-10-28 11:37:45 -07:00
|
|
|
)
|