Remove instructions instead of attempting to delete them.

Instructions are allocated using the ArenaAllocator which uses a
memory pool of "slabs", so we can't use the regular C++ delete to
deallocate them. Just remove them from the list. This change also
provides an override for Inst's operator delete to use the custom
allocator, which should currently not be called.

BUG=swiftshader:8

Change-Id: Ibb166910402a70e7d9276b28e19b15caf64422f2
Reviewed-on: https://chromium-review.googlesource.com/384336
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
2 files changed