Skip to content

Commit

Permalink
[build][tir] suppress -Woverloaded-virtual warning
Browse files Browse the repository at this point in the history
Suppress clang-15.0.3 warning regarding the
`tvm::tir::DataTypeRewriter` class.
  • Loading branch information
Christian Convey committed Nov 4, 2022
1 parent de8a79d commit 6b3e9c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/tir/transforms/narrow_datatype.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ class DataTypeVisitor final : public StmtExprVisitor {
arith::ConstIntBoundAnalyzer::BoundMapType bound_;
};

// DataTypeRewriter defines some overloads of VisitStmt_ and
// VisitExpr_ that aren't present in DataTypeLegalizer.
// This is intentional, so suppress the warning.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif

class DataTypeRewriter : public DataTypeLegalizer {
using Parent = DataTypeLegalizer;

Expand All @@ -206,6 +214,7 @@ class DataTypeRewriter : public DataTypeLegalizer {
return VisitStmt(s);
}

protected:
Stmt VisitStmt_(const StoreNode* op) final {
LOG(FATAL) << "Unexpected use of deprecated StoreNode. Please use BufferStoreNode instead.";
return Stmt();
Expand Down Expand Up @@ -326,6 +335,10 @@ class DataTypeRewriter : public DataTypeLegalizer {
bool is_condition_{false};
};

#if __clang__
#pragma clang diagnostic pop
#endif

#define DEFINE_CMPOP_EXPR_MUTATE_WITH_TYPE_MATCH(OP, FUNC) \
PrimExpr DataTypeRewriter::VisitExpr_(const OP* op) { \
bool is_index = is_index_; \
Expand Down

0 comments on commit 6b3e9c8

Please sign in to comment.