diff options
Diffstat (limited to 'src/ir')
-rw-r--r-- | src/ir/flat.h | 4 | ||||
-rw-r--r-- | src/ir/hashed.h | 4 | ||||
-rw-r--r-- | src/ir/module-utils.h | 8 | ||||
-rw-r--r-- | src/ir/type-updating.cpp | 4 | ||||
-rw-r--r-- | src/ir/utils.h | 8 |
5 files changed, 20 insertions, 8 deletions
diff --git a/src/ir/flat.h b/src/ir/flat.h index 70a6beac7..1a8722726 100644 --- a/src/ir/flat.h +++ b/src/ir/flat.h @@ -118,7 +118,9 @@ inline void verifyFlatness(Module* module) { bool modifiesBinaryenIR() override { return false; } - VerifyFlatness* create() override { return new VerifyFlatness(); } + std::unique_ptr<Pass> create() override { + return std::make_unique<VerifyFlatness>(); + } void doVisitFunction(Function* func) { verifyFlatness(func); } }; diff --git a/src/ir/hashed.h b/src/ir/hashed.h index 060fea453..4e90951f5 100644 --- a/src/ir/hashed.h +++ b/src/ir/hashed.h @@ -38,8 +38,8 @@ struct FunctionHasher : public WalkerPass<PostWalker<FunctionHasher>> { FunctionHasher(Map* output) : output(output), customHasher(ExpressionAnalyzer::nothingHasher) {} - FunctionHasher* create() override { - return new FunctionHasher(output, customHasher); + std::unique_ptr<Pass> create() override { + return std::make_unique<FunctionHasher>(output, customHasher); } static Map createMap(Module* module) { diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h index 319f1a7a4..cdafa9c8c 100644 --- a/src/ir/module-utils.h +++ b/src/ir/module-utils.h @@ -201,7 +201,9 @@ template<typename T> inline void renameFunctions(Module& wasm, T& map) { Updater(T& map) : map(map) {} - Updater* create() override { return new Updater(map); } + std::unique_ptr<Pass> create() override { + return std::make_unique<Updater>(map); + } void visitCall(Call* curr) { maybeUpdate(curr->target); } @@ -392,7 +394,9 @@ struct ParallelFunctionAnalysis { Mapper(Module& module, Map& map, Func work) : module(module), map(map), work(work) {} - Mapper* create() override { return new Mapper(module, map, work); } + std::unique_ptr<Pass> create() override { + return std::make_unique<Mapper>(module, map, work); + } void doWalkFunction(Function* curr) { assert(map.count(curr)); diff --git a/src/ir/type-updating.cpp b/src/ir/type-updating.cpp index c560ce236..2d75f0951 100644 --- a/src/ir/type-updating.cpp +++ b/src/ir/type-updating.cpp @@ -113,7 +113,9 @@ void GlobalTypeRewriter::update() { CodeUpdater(OldToNewTypes& oldToNewTypes) : oldToNewTypes(oldToNewTypes) {} - CodeUpdater* create() override { return new CodeUpdater(oldToNewTypes); } + std::unique_ptr<Pass> create() override { + return std::make_unique<CodeUpdater>(oldToNewTypes); + } Type getNew(Type type) { if (type.isRef()) { diff --git a/src/ir/utils.h b/src/ir/utils.h index b7cd65e19..4f4e5657b 100644 --- a/src/ir/utils.h +++ b/src/ir/utils.h @@ -123,7 +123,9 @@ struct ReFinalize // preserved. bool requiresNonNullableLocalFixups() override { return false; } - Pass* create() override { return new ReFinalize; } + std::unique_ptr<Pass> create() override { + return std::make_unique<ReFinalize>(); + } ReFinalize() { name = "refinalize"; } @@ -189,7 +191,9 @@ struct ReFinalizeNode : public OverriddenVisitor<ReFinalizeNode> { struct AutoDrop : public WalkerPass<ExpressionStackWalker<AutoDrop>> { bool isFunctionParallel() override { return true; } - Pass* create() override { return new AutoDrop; } + std::unique_ptr<Pass> create() override { + return std::make_unique<AutoDrop>(); + } AutoDrop() { name = "autodrop"; } |