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

@ -67,7 +67,7 @@ func (ms *MyStruct) MethodOnPointerToStruct() { }
func _deploy(data interface{}, isUpdate bool) { x := 1; _ = x }
`
buf, d, err := CompileWithOptions("foo.go", strings.NewReader(src), nil)
ne, d, err := CompileWithOptions("foo.go", strings.NewReader(src), nil)
require.NoError(t, err)
require.NotNil(t, d)
@ -162,8 +162,8 @@ func _deploy(data interface{}, isUpdate bool) { x := 1; _ = x }
// basic check that last instruction of every method is indeed RET
for i := range d.Methods {
index := d.Methods[i].Range.End
require.True(t, int(index) < len(buf))
require.EqualValues(t, opcode.RET, buf[index])
require.True(t, int(index) < len(ne.Script))
require.EqualValues(t, opcode.RET, ne.Script[index])
}
t.Run("convert to Manifest", func(t *testing.T) {
@ -365,7 +365,7 @@ func TestManifestOverload(t *testing.T) {
return 4
}`
_, di, err := CompileWithDebugInfo("foo", strings.NewReader(src))
_, di, err := CompileWithOptions("foo", strings.NewReader(src), nil)
require.NoError(t, err)
m, err := di.ConvertToManifest(&Options{Overloads: map[string]string{"add3Aux": "add3"}})