compiler: remove CompileWithDebugInfo

It is a simple wrapper over `CompileWithOptions` which we don't really
need. Custom options can be specified explicitly instead of using some
random default. This default was introduced in 1578904da, however tests
written there use `CompileWithOptions` and all other tests
pass on that commit even without this default.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgeniy Stratonikov 2021-07-26 15:34:07 +03:00
parent 46f623a48f
commit 8af9c870b1
14 changed files with 26 additions and 33 deletions

View file

@ -160,7 +160,7 @@ func getBuildInfo(name string, src interface{}) (*buildInfo, error) {
// If `r != nil`, `name` is interpreted as a filename, and `r` as file contents.
// Otherwise `name` is either file name or name of the directory containing source files.
func Compile(name string, r io.Reader) ([]byte, error) {
f, _, err := CompileWithDebugInfo(name, r)
f, _, err := CompileWithOptions(name, r, nil)
if err != nil {
return nil, err
}
@ -168,13 +168,6 @@ func Compile(name string, r io.Reader) ([]byte, error) {
return f.Script, nil
}
// CompileWithDebugInfo compiles a Go program into bytecode and emits debug info.
func CompileWithDebugInfo(name string, r io.Reader) (*nef.File, *DebugInfo, error) {
return CompileWithOptions(name, r, &Options{
NoEventsCheck: true,
})
}
// CompileWithOptions compiles a Go program into bytecode with provided compiler options.
func CompileWithOptions(name string, r io.Reader, o *Options) (*nef.File, *DebugInfo, error) {
ctx, err := getBuildInfo(name, r)