mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
compiler, transform: remove runtime.isnil hack
This hack was originally introduced in https://github.com/tinygo-org/tinygo/pull/251 to fix an escape analysis regression after https://github.com/tinygo-org/tinygo/pull/222 introduced nil checks. Since a new optimization in LLVM (see https://reviews.llvm.org/D60047) this hack is not necessary anymore and can be removed. I've compared all regular tests and smoke tests before and after to check the size. In most cases this change was an improvement although there are a few regressions.
This commit is contained in:
committed by
Ron Evans
parent
bbfa601d27
commit
f8876ea245
@@ -27,14 +27,6 @@ func _recover() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
// See emitNilCheck in compiler/asserts.go.
|
||||
// This function is a dummy function that has its first and only parameter
|
||||
// marked 'nocapture' to work around a limitation in LLVM: a regular pointer
|
||||
// comparison captures the pointer.
|
||||
func isnil(ptr *uint8) bool {
|
||||
return ptr == nil
|
||||
}
|
||||
|
||||
// Panic when trying to dereference a nil pointer.
|
||||
func nilPanic() {
|
||||
runtimePanic("nil pointer dereference")
|
||||
|
||||
Reference in New Issue
Block a user