Codegen struct fini and destroy functions