diff --git a/compiler/luci/pass/include/luci/ModulePass.h b/compiler/luci/pass/include/luci/ModulePass.h index 2b713ae47f5..3819d63a534 100644 --- a/compiler/luci/pass/include/luci/ModulePass.h +++ b/compiler/luci/pass/include/luci/ModulePass.h @@ -22,16 +22,28 @@ #include +#include + namespace luci { -class Pass : public logo::Pass +class ModulePass { public: // Run module pass and return false if there was nothing changed virtual bool run(luci::Module *) = 0; }; +class Pass : public logo::Pass, public ModulePass +{ +public: + // NOTE adding dummy run() to make compiler happy with "-Werror=overloaded-virtual=" + // clang-format off + bool run(loco::Graph *) override { throw std::runtime_error("Must inherit"); } + bool run(luci::Module *) override { throw std::runtime_error("Must inherit"); } + // clang-format on +}; + } // namespace luci #endif // __LUCI_PASS_MODULE_PASS_H__ diff --git a/compiler/luci/pass/src/VerifyQuantizedNodeType.h b/compiler/luci/pass/src/VerifyQuantizedNodeType.h index 15ec384413c..65a8c8b50bc 100644 --- a/compiler/luci/pass/src/VerifyQuantizedNodeType.h +++ b/compiler/luci/pass/src/VerifyQuantizedNodeType.h @@ -20,6 +20,8 @@ #include #include +#include + namespace luci { @@ -129,9 +131,12 @@ class VerifyQuantizedNodeTypeBase : public luci::CircleNodeVisitor, // NOTE below nodes has differnent implementation for Qtype/Btype and // implementations exist in VerifyQuantizedNodeU8Type, VerifyQuantizedNodeS16Type - // bool visit(const luci::CircleLogistic *node); - // bool visit(const luci::CircleSoftmax *node); - // bool visit(const luci::CircleTanh *node); + // NOTE adding dummy visit() to make compiler happy with "-Werror=overloaded-virtual=" + // clang-format off + bool visit(const luci::CircleLogistic *) { throw std::runtime_error("Must inherit"); } + bool visit(const luci::CircleSoftmax *) { throw std::runtime_error("Must inherit"); } + bool visit(const luci::CircleTanh *) { throw std::runtime_error("Must inherit"); } + // clang-format on // TODO: Implement more Ops