mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
transform: modify output format from the -print-allocs flag to be the same as expected by the go coverage tool
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -88,7 +88,11 @@ func Optimize(mod llvm.Module, config *compileopts.Config) []error {
|
||||
|
||||
// Run TinyGo-specific interprocedural optimizations.
|
||||
OptimizeAllocs(mod, config.Options.PrintAllocs, maxStackSize, func(pos token.Position, msg string) {
|
||||
fmt.Fprintln(os.Stderr, pos.String()+": "+msg)
|
||||
if pos.Filename != "" {
|
||||
fmt.Fprintf(os.Stderr, "%s:%d:%d: %s\n", pos.Filename, pos.Line, pos.Column, msg)
|
||||
} else {
|
||||
fmt.Fprintln(os.Stderr, msg) // No prefix!
|
||||
}
|
||||
})
|
||||
OptimizeStringToBytes(mod)
|
||||
OptimizeStringEqual(mod)
|
||||
|
||||
Reference in New Issue
Block a user