Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MapInitToVar map[*ir.Func]*ir.Name
MapInitToVar is the inverse of VarToMapInit; it maintains a mapping from a compiler-generated init function to the map the function is initializing.
Functions ¶
func AddKeepRelocations ¶ added in go1.21.0
func AddKeepRelocations()
AddKeepRelocations adds a dummy "R_KEEP" relocation from each global map variable V to its associated outlined init function. These relocation ensure that if the map var itself is determined to be reachable at link time, we also mark the init function as reachable.
func AnySideEffects ¶
AnySideEffects reports whether n contains any operations that could have observable side effects.
func OutlineMapInits ¶ added in go1.21.0
OutlineMapInits replaces global map initializers with outlined calls to separate "map init" functions (where possible and profitable), to facilitate better dead-code elimination by the linker.
Types ¶
type Schedule ¶
type Schedule struct { // Out is the ordered list of dynamic initialization // statements. Out []ir.Node Plans map[ir.Node]*Plan Temps map[ir.Node]*ir.Name // contains filtered or unexported fields }
An Schedule is used to decompose assignment statements into static and dynamic initialization parts. Static initializations are handled by populating variables' linker symbol data, while dynamic initializations are accumulated to be executed in order.
func (*Schedule) StaticAssign ¶
func (*Schedule) StaticInit ¶
StaticInit adds an initialization statement n to the schedule.