cl: LLGO_TRACE

This commit is contained in:
Li Jie
2025-02-10 22:28:25 +08:00
parent 43175bb642
commit 5b216153e9
4 changed files with 31 additions and 0 deletions

View File

@@ -142,6 +142,7 @@ func Do(args []string, conf *Config) ([]Package, error) {
}
cl.EnableDebugSymbols(IsDebugEnabled())
cl.EnableTrace(IsTraceEnabled())
llssa.Initialize(llssa.InitAll)
target := &llssa.Target{
@@ -731,6 +732,7 @@ var (
)
const llgoDebug = "LLGO_DEBUG"
const llgoTrace = "LLGO_TRACE"
const llgoOptimize = "LLGO_OPTIMIZE"
const llgoCheck = "LLGO_CHECK"
@@ -742,6 +744,10 @@ func isEnvOn(env string, defVal bool) bool {
return envVal == "1" || envVal == "true" || envVal == "on"
}
func IsTraceEnabled() bool {
return isEnvOn(llgoTrace, false)
}
func IsDebugEnabled() bool {
return isEnvOn(llgoDebug, false)
}