compiler: support basic inlining

This commit is contained in:
Evgeniy Stratonikov 2021-02-04 15:41:00 +03:00
parent 1f238ce6fd
commit 1ae0d022dd
9 changed files with 258 additions and 4 deletions

View file

@ -304,3 +304,11 @@ func canConvert(s string) bool {
}
return true
}
// canInline returns true if function is to be inlined.
// Currently there is a static list of function which are inlined,
// this may change in future.
func canInline(s string) bool {
return isNativeHelpersPath(s) ||
strings.HasPrefix(s, "github.com/nspcc-dev/neo-go/pkg/compiler/testdata/inline")
}