Skip to content

Commit

Permalink
Add using directives for otherwise hidden virtual functions, NFC (#12561
Browse files Browse the repository at this point in the history
)

This silences warning
```
warning: 'foo' hides overloaded virtual functions [-Woverloaded-virtual]
```
typically caused by overriding only some overloads of `VisitExpr_` from
a set defined in the base class.
  • Loading branch information
Krzysztof Parzyszek authored Aug 23, 2022
1 parent 13ebbfb commit 8174d08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/relay/backend/annotate_used_memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class AnnotateUsedMemoryMutator : public transform::DeviceAwareExprMutator {
/*!
* \brief Establish which let bindings have primitive function values.
*/
std::pair<Var, Expr> PreVisitLetBinding_(const Var& var, const Expr& value) {
std::pair<Var, Expr> PreVisitLetBinding_(const Var& var, const Expr& value) override {
if (const auto* func_node = value.as<FunctionNode>()) {
ICHECK(func_node->attrs.HasNonzeroAttr(attr::kPrimitive))
<< "Expect top-level functions to be primitive.";
Expand Down
4 changes: 4 additions & 0 deletions src/relay/transforms/annotate_texture_storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class StorageInfo : private transform::DeviceAwareExprVisitor {
}

private:
using transform::DeviceAwareExprVisitor::VisitExpr_;

void Visit(const Expr& expr) {
// Pre-order traversal to enable upward propagation
// of consumer storage scopes to producers when desirable.
Expand Down Expand Up @@ -426,6 +428,8 @@ class RewriteVDStorageScopes : public transform::DeviceAwareExprMutator {
using VarMap = std::unordered_map<Expr, Var, ObjectPtrHash, ObjectPtrEqual>;

public:
using transform::DeviceAwareExprMutator::VisitExpr_;

explicit RewriteVDStorageScopes(const Map<Expr, Map<Expr, Array<String>>>& storage_scope)
: transform::DeviceAwareExprMutator(Optional<IRModule>()), storage_scope_(storage_scope) {}

Expand Down
2 changes: 2 additions & 0 deletions src/relay/transforms/compiler_function_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const FunctionNode* AsFunctionNode(const Expr& expr, const std::string& compiler
*/
class Outliner : public MixedModeMutator {
public:
using MixedModeMutator::VisitExpr_;

Outliner(GlobalSymbolCache* cache, std::string compiler_filter, IRModule mod)
: cache_(cache), compiler_filter_(std::move(compiler_filter)), mod_(std::move(mod)) {}

Expand Down

0 comments on commit 8174d08

Please sign in to comment.