Restore legacy interface for remap()
authorGreg Fischer <greg@lunarg.com>
Wed, 1 Jun 2022 22:40:29 +0000 (16:40 -0600)
committerGreg Fischer <greg@lunarg.com>
Wed, 1 Jun 2022 22:40:29 +0000 (16:40 -0600)
Fixes ABI breakage caused by #2933

SPIRV/SPVRemapper.cpp
SPIRV/SPVRemapper.h

index 2816882..6aca8cb 100644 (file)
@@ -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<std::uint32_t>& in_spv, std::uint32_t opts)
+    {
+      stripWhiteList.clear();
+      spv.swap(in_spv);
+      remap(opts);
+      spv.swap(in_spv);
+    }
+
 } // namespace SPV
 
 #endif // defined (use_cpp11)
index 2dfacd7..d216946 100644 (file)
@@ -121,6 +121,9 @@ public:
    void remap(std::vector<std::uint32_t>& spv, const std::vector<std::string>& whiteListStrings,
               std::uint32_t opts = DO_EVERYTHING);
 
+   // remap on an existing binary in memory - legacy interface without white list
+   void remap(std::vector<std::uint32_t>& spv, std::uint32_t opts = DO_EVERYTHING);
+
    // Type for error/log handler functions
    typedef std::function<void(const std::string&)> errorfn_t;
    typedef std::function<void(const std::string&)> logfn_t;