diff options
author | Derek Schuff <dschuff@chromium.org> | 2017-09-12 13:46:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 13:46:53 -0700 |
commit | 40f52f2ca41822e9dc47ff57239cdf299f7e1ce5 (patch) | |
tree | 2c3b399aab435f4368e0890ed0581f63ab28c8a8 /src/passes/ReReloop.cpp | |
parent | 6977feb0f371c31f35ab8b1304c97dc3ac155d92 (diff) | |
download | binaryen-40f52f2ca41822e9dc47ff57239cdf299f7e1ce5.tar.gz binaryen-40f52f2ca41822e9dc47ff57239cdf299f7e1ce5.tar.bz2 binaryen-40f52f2ca41822e9dc47ff57239cdf299f7e1ce5.zip |
Make several derived classes final (#1180)
Recent versions of clang turn on -Wdelete-non-virtual-dtor at our warning
level, which fires when deleting a non-final class that has virtual functions
but a non-virtual destructor. Pre-C++11 standard rule of thumb is to just always
have a virtual destructor if there are virtual functions, but C++11 final is
even better since it may allow for devirtualization optimizations.
Diffstat (limited to 'src/passes/ReReloop.cpp')
-rw-r--r-- | src/passes/ReReloop.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/passes/ReReloop.cpp b/src/passes/ReReloop.cpp index db2ec5698..2c212e628 100644 --- a/src/passes/ReReloop.cpp +++ b/src/passes/ReReloop.cpp @@ -32,7 +32,7 @@ namespace wasm { -struct ReReloop : public Pass { +struct ReReloop final : public Pass { bool isFunctionParallel() override { return true; } Pass* create() override { return new ReReloop; } @@ -110,7 +110,7 @@ struct ReReloop : public Pass { typedef std::shared_ptr<Task> TaskPtr; std::vector<TaskPtr> stack; - struct TriageTask : public Task { + struct TriageTask final : public Task { Expression* curr; TriageTask(ReReloop& parent, Expression* curr) : Task(parent), curr(curr) {} @@ -120,7 +120,7 @@ struct ReReloop : public Pass { } }; - struct BlockTask : public Task { + struct BlockTask final : public Task { Block* curr; CFG::Block* later; @@ -149,7 +149,7 @@ struct ReReloop : public Pass { } }; - struct LoopTask : public Task { + struct LoopTask final : public Task { static void handle(ReReloop& parent, Loop* curr) { parent.stack.push_back(std::make_shared<TriageTask>(parent, curr->body)); if (curr->name.is()) { @@ -162,7 +162,7 @@ struct ReReloop : public Pass { } }; - struct IfTask : public Task { + struct IfTask final : public Task { If* curr; CFG::Block* condition; CFG::Block* ifTrueEnd; @@ -325,4 +325,3 @@ Pass *createReReloopPass() { } } // namespace wasm - |