From 9e2b914722b7a2021b8f4397f75137470ae19530 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Wed, 1 Jun 2022 16:40:29 -0600 Subject: [PATCH] Restore legacy interface for remap() Fixes ABI breakage caused by #2933 --- SPIRV/SPVRemapper.cpp | 9 +++++++++ SPIRV/SPVRemapper.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/SPIRV/SPVRemapper.cpp b/SPIRV/SPVRemapper.cpp index 28168822c6..6aca8cbcf0 100644 --- a/SPIRV/SPVRemapper.cpp +++ b/SPIRV/SPVRemapper.cpp @@ -1517,6 +1517,15 @@ namespace spv { spv.swap(in_spv); } + // remap from a memory image - legacy interface without white list + void spirvbin_t::remap(std::vector& in_spv, std::uint32_t opts) + { + stripWhiteList.clear(); + spv.swap(in_spv); + remap(opts); + spv.swap(in_spv); + } + } // namespace SPV #endif // defined (use_cpp11) diff --git a/SPIRV/SPVRemapper.h b/SPIRV/SPVRemapper.h index 2dfacd733b..d21694635a 100644 --- a/SPIRV/SPVRemapper.h +++ b/SPIRV/SPVRemapper.h @@ -121,6 +121,9 @@ class spirvbin_t : public spirvbin_base_t void remap(std::vector& spv, const std::vector& whiteListStrings, std::uint32_t opts = DO_EVERYTHING); + // remap on an existing binary in memory - legacy interface without white list + void remap(std::vector& spv, std::uint32_t opts = DO_EVERYTHING); + // Type for error/log handler functions typedef std::function errorfn_t; typedef std::function logfn_t;