Skip to content

[CIR][MLIR] Fix overloaded virtual warnings #1439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ struct RemoveRedundantBranches : public OpRewritePattern<BrOp> {

return failure();
}

using mlir::OpRewritePattern<BrOp>::matchAndRewrite;
};

struct RemoveEmptyScope : public OpRewritePattern<ScopeOp> {
Expand All @@ -77,6 +79,9 @@ struct RemoveEmptyScope : public OpRewritePattern<ScopeOp> {
void rewrite(ScopeOp op, PatternRewriter &rewriter) const final {
rewriter.eraseOp(op);
}

using mlir::OpRewritePattern<ScopeOp>::match;
using mlir::OpRewritePattern<ScopeOp>::rewrite;
};

struct RemoveEmptySwitch : public OpRewritePattern<SwitchOp> {
Expand All @@ -90,6 +95,9 @@ struct RemoveEmptySwitch : public OpRewritePattern<SwitchOp> {
void rewrite(SwitchOp op, PatternRewriter &rewriter) const final {
rewriter.eraseOp(op);
}

using mlir::OpRewritePattern<SwitchOp>::match;
using mlir::OpRewritePattern<SwitchOp>::rewrite;
};

struct RemoveTrivialTry : public OpRewritePattern<TryOp> {
Expand All @@ -114,6 +122,9 @@ struct RemoveTrivialTry : public OpRewritePattern<TryOp> {
rewriter.inlineBlockBefore(tryBody, parentBlock, Block::iterator(op));
rewriter.eraseOp(op);
}

using mlir::OpRewritePattern<TryOp>::match;
using mlir::OpRewritePattern<TryOp>::rewrite;
};

// Remove call exception with empty cleanups
Expand All @@ -138,6 +149,9 @@ struct SimplifyCallOp : public OpRewritePattern<CallOp> {
rewriter.eraseOp(&b->back());
rewriter.eraseBlock(b);
}

using mlir::OpRewritePattern<CallOp>::match;
using mlir::OpRewritePattern<CallOp>::rewrite;
};

//===----------------------------------------------------------------------===//
Expand Down
4 changes: 4 additions & 0 deletions clang/lib/CIR/Dialect/Transforms/CIRSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ struct SimplifyTernary final : public OpRewritePattern<TernaryOp> {
return mlir::success();
}

using mlir::OpRewritePattern<TernaryOp>::matchAndRewrite;

private:
bool isSimpleTernaryBranch(mlir::Region &region) const {
if (!region.hasOneBlock())
Expand Down Expand Up @@ -139,6 +141,8 @@ struct SimplifySelect : public OpRewritePattern<SelectOp> {

return mlir::failure();
}

using mlir::OpRewritePattern<SelectOp>::matchAndRewrite;
};

//===----------------------------------------------------------------------===//
Expand Down
12 changes: 12 additions & 0 deletions clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ struct CIRIfFlattening : public OpRewritePattern<IfOp> {
rewriter.replaceOp(ifOp, continueBlock->getArguments());
return mlir::success();
}

using mlir::OpRewritePattern<IfOp>::matchAndRewrite;
};

class CIRScopeOpFlattening : public mlir::OpRewritePattern<cir::ScopeOp> {
Expand Down Expand Up @@ -168,6 +170,8 @@ class CIRScopeOpFlattening : public mlir::OpRewritePattern<cir::ScopeOp> {

return mlir::success();
}

using mlir::OpRewritePattern<cir::ScopeOp>::matchAndRewrite;
};

class CIRTryOpFlattening : public mlir::OpRewritePattern<cir::TryOp> {
Expand Down Expand Up @@ -548,6 +552,8 @@ class CIRTryOpFlattening : public mlir::OpRewritePattern<cir::TryOp> {
}
return mlir::success();
}

using mlir::OpRewritePattern<TryOp>::matchAndRewrite;
};

class CIRLoopOpInterfaceFlattening
Expand Down Expand Up @@ -628,6 +634,8 @@ class CIRLoopOpInterfaceFlattening
rewriter.eraseOp(op);
return mlir::success();
}

using mlir::OpInterfaceRewritePattern<cir::LoopOpInterface>::matchAndRewrite;
};

class CIRSwitchOpFlattening : public mlir::OpRewritePattern<cir::SwitchOp> {
Expand Down Expand Up @@ -854,6 +862,8 @@ class CIRSwitchOpFlattening : public mlir::OpRewritePattern<cir::SwitchOp> {

return mlir::success();
}

using mlir::OpRewritePattern<cir::SwitchOp>::matchAndRewrite;
};
class CIRTernaryOpFlattening : public mlir::OpRewritePattern<cir::TernaryOp> {
public:
Expand Down Expand Up @@ -904,6 +914,8 @@ class CIRTernaryOpFlattening : public mlir::OpRewritePattern<cir::TernaryOp> {
// Ok, we're done!
return mlir::success();
}

using mlir::OpRewritePattern<cir::TernaryOp>::matchAndRewrite;
};

void populateFlattenCFGPatterns(RewritePatternSet &patterns) {
Expand Down
4 changes: 4 additions & 0 deletions clang/lib/CIR/Dialect/Transforms/SCFPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ struct canonicalizeIVtoCmpLHS : public OpRewritePattern<ForOp> {

return failure();
}

using mlir::OpRewritePattern<ForOp>::matchAndRewrite;
};

// Hoist loop invariant operations in condition block out of loop
Expand Down Expand Up @@ -199,6 +201,8 @@ struct hoistLoopInvariantInCondBlock : public OpRewritePattern<ForOp> {

return failure();
}

using mlir::OpRewritePattern<ForOp>::matchAndRewrite;
};

//===----------------------------------------------------------------------===//
Expand Down
Loading
Loading