From b3775b5e4e150439276ad3d34f1bb564b28e8ef5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 6 Oct 2023 16:41:13 -0700 Subject: Automatically discard global effects in the rare passes that add effects (#5999) All logging/instrumentation passes need to do this, to avoid us using stale global effects that are too low (too high is not optimal either, but at least it cannot cause bugs). --- src/passes/Asyncify.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/passes/Asyncify.cpp') diff --git a/src/passes/Asyncify.cpp b/src/passes/Asyncify.cpp index d0674d97c..2412a754a 100644 --- a/src/passes/Asyncify.cpp +++ b/src/passes/Asyncify.cpp @@ -870,6 +870,8 @@ struct InstrumentedProxy : public Pass { bool invalidatesDWARF() override { return pass->invalidatesDWARF(); } + bool addsEffects() override { return pass->addsEffects(); } + bool requiresNonNullableLocalFixups() override { return pass->requiresNonNullableLocalFixups(); } @@ -1610,6 +1612,9 @@ static std::string getFullImportName(Name module, Name base) { } struct Asyncify : public Pass { + // Adds calls. + bool addsEffects() override { return true; } + void run(Module* module) override { auto& options = getPassOptions(); bool optimize = options.optimizeLevel > 0; -- cgit v1.2.3