github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/ssa/compile.go (about) 1 // Copyright 2015 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package ssa 6 7 import ( 8 "github.com/shogo82148/std/io" 9 ) 10 11 // Compile is the main entry point for this package. 12 // Compile modifies f so that on return: 13 // - all Values in f map to 0 or 1 assembly instructions of the target architecture 14 // - the order of f.Blocks is the order to emit the Blocks 15 // - the order of b.Values is the order to emit the Values in each Block 16 // - f has a non-nil regAlloc field 17 func Compile(f *Func) 18 19 // DumpFileForPhase creates a file from the function name and phase name, 20 // warning and returning nil if this is not possible. 21 func (f *Func) DumpFileForPhase(phaseName string) io.WriteCloser 22 23 // Debug output 24 var IntrinsicsDebug int 25 var IntrinsicsDisable bool 26 27 var BuildDebug int 28 var BuildTest int 29 var BuildStats int 30 var BuildDump map[string]bool = make(map[string]bool) 31 32 var GenssaDump map[string]bool = make(map[string]bool) 33 34 // PhaseOption sets the specified flag in the specified ssa phase, 35 // returning empty string if this was successful or a string explaining 36 // the error if it was not. 37 // A version of the phase name with "_" replaced by " " is also checked for a match. 38 // If the phase name begins a '~' then the rest of the underscores-replaced-with-blanks 39 // version is used as a regular expression to match the phase name(s). 40 // 41 // Special cases that have turned out to be useful: 42 // - ssa/check/on enables checking after each phase 43 // - ssa/all/time enables time reporting for all phases 44 // 45 // See gc/lex.go for dissection of the option string. 46 // Example uses: 47 // 48 // GO_GCFLAGS=-d=ssa/generic_cse/time,ssa/generic_cse/stats,ssa/generic_cse/debug=3 ./make.bash 49 // 50 // BOOT_GO_GCFLAGS=-d='ssa/~^.*scc$/off' GO_GCFLAGS='-d=ssa/~^.*scc$/off' ./make.bash 51 func PhaseOption(phase, flag string, val int, valString string) string