@@ -356,10 +356,8 @@ class GlobalTypeRewriter {
356356 // the module.
357357 //
358358 // This only operates on private types (so as not to modify the module's
359- // external ABI). It takes as a parameter a list of public types to consider
360- // private, which allows more flexibility (e.g. in closed world if a pass
361- // knows a type is safe to modify despite being public, it can add it).
362- void update (const std::vector<HeapType>& additionalPrivateTypes = {});
359+ // external ABI).
360+ void update ();
363361
364362 using TypeMap = std::unordered_map<HeapType, HeapType>;
365363
@@ -419,10 +417,7 @@ class GlobalTypeRewriter {
419417
420418 // Helper for the repeating pattern of just updating Signature types using a
421419 // map of old heap type => new Signature.
422- static void
423- updateSignatures (const SignatureUpdates& updates,
424- Module& wasm,
425- const std::vector<HeapType>& additionalPrivateTypes = {}) {
420+ static void updateSignatures (const SignatureUpdates& updates, Module& wasm) {
426421 if (updates.empty ()) {
427422 return ;
428423 }
@@ -431,11 +426,9 @@ class GlobalTypeRewriter {
431426 const SignatureUpdates& updates;
432427
433428 public:
434- SignatureRewriter (Module& wasm,
435- const SignatureUpdates& updates,
436- const std::vector<HeapType>& additionalPrivateTypes)
429+ SignatureRewriter (Module& wasm, const SignatureUpdates& updates)
437430 : GlobalTypeRewriter(wasm), updates(updates) {
438- update (additionalPrivateTypes );
431+ update ();
439432 }
440433
441434 void modifySignature (HeapType oldSignatureType, Signature& sig) override {
@@ -445,19 +438,16 @@ class GlobalTypeRewriter {
445438 sig.results = getTempType (iter->second .results );
446439 }
447440 }
448- } rewriter (wasm, updates, additionalPrivateTypes );
441+ } rewriter (wasm, updates);
449442 }
450443
451444protected:
452445 // Return the graph matching each private type to its private predecessors.
453- PredecessorGraph getPrivatePredecessors (
454- const std::vector<HeapType>& additionalPrivateTypes = {});
446+ PredecessorGraph getPrivatePredecessors ();
455447
456448 // Builds new types after updating their contents using the hooks below and
457449 // returns a map from the old types to the modified types. Used internally in
458450 // update().
459- //
460- // See above regarding private types.
461451 TypeMap rebuildTypes (std::vector<HeapType> types);
462452
463453private:
@@ -478,13 +468,10 @@ class TypeMapper : public GlobalTypeRewriter {
478468 TypeMapper (Module& wasm, const TypeUpdates& mapping)
479469 : GlobalTypeRewriter(wasm), mapping(mapping) {}
480470
481- // As rebuildTypes, this can take an optional set of additional types to
482- // consider private (and therefore to modify).
483- void map (const std::vector<HeapType>& additionalPrivateTypes = {}) {
471+ void map () {
484472 // Update the internals of types (struct fields, signatures, etc.) to
485473 // refer to the merged types.
486- auto newMapping = rebuildTypes (
487- getSortedTypes (getPrivatePredecessors (additionalPrivateTypes)));
474+ auto newMapping = rebuildTypes (getSortedTypes (getPrivatePredecessors ()));
488475
489476 // Compose the user-provided mapping from old types to other old types with
490477 // the new mapping from old types to new types. `newMapping` will become
0 commit comments