[Mlir-commits] [mlir] fd1d157 - [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in mlir-rewrite.cpp (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Fri Oct 3 03:18:24 PDT 2025
Author: Mehdi Amini
Date: 2025-10-03T03:16:39-07:00
New Revision: fd1d157f2bf7c3ca1480f708004f35a882b639e9
URL: https://github.com/llvm/llvm-project/commit/fd1d157f2bf7c3ca1480f708004f35a882b639e9
DIFF: https://github.com/llvm/llvm-project/commit/fd1d157f2bf7c3ca1480f708004f35a882b639e9.diff
LOG: [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in mlir-rewrite.cpp (NFC)
Added:
Modified:
mlir/tools/mlir-rewrite/mlir-rewrite.cpp
Removed:
################################################################################
diff --git a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
index fd8ae7e0ca89b..795766f933ddc 100644
--- a/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
+++ b/mlir/tools/mlir-rewrite/mlir-rewrite.cpp
@@ -35,7 +35,7 @@ namespace mlir {
using OperationDefinition = AsmParserState::OperationDefinition;
/// Return the source code associated with the OperationDefinition.
-SMRange getOpRange(const OperationDefinition &op) {
+static SMRange getOpRange(const OperationDefinition &op) {
const char *startOp = op.scopeLoc.Start.getPointer();
const char *endOp = op.scopeLoc.End.getPointer();
@@ -187,15 +187,15 @@ std::unique_ptr<RewritePad> RewritePad::init(StringRef inputFilename,
}
/// Return the source code associated with the operation name.
-SMRange getOpNameRange(const OperationDefinition &op) { return op.loc; }
+static SMRange getOpNameRange(const OperationDefinition &op) { return op.loc; }
/// Return whether the operation was printed using generic syntax in original
/// buffer.
-bool isGeneric(const OperationDefinition &op) {
+static bool isGeneric(const OperationDefinition &op) {
return op.loc.Start.getPointer()[0] == '"';
}
-inline int asMainReturnCode(LogicalResult r) {
+static inline int asMainReturnCode(LogicalResult r) {
return r.succeeded() ? EXIT_SUCCESS : EXIT_FAILURE;
}
@@ -293,7 +293,7 @@ static llvm::cl::opt<std::string> simpleRenameReplace{
llvm::cl::cat(clSimpleRenameCategory)};
// Rewriter that does simple renames.
-LogicalResult simpleRename(RewritePad &rewriteState, raw_ostream &os) {
+static LogicalResult simpleRename(RewritePad &rewriteState, raw_ostream &os) {
StringRef opName = simpleRenameOpName;
StringRef match = simpleRenameMatch;
StringRef replace = simpleRenameReplace;
@@ -317,7 +317,7 @@ static mlir::RewriterRegistration rewriteSimpleRename("simple-rename",
simpleRename);
// Rewriter that insert range markers.
-LogicalResult markRanges(RewritePad &rewriteState, raw_ostream &os) {
+static LogicalResult markRanges(RewritePad &rewriteState, raw_ostream &os) {
for (const auto &it : rewriteState.getOpDefs()) {
auto [startOp, endOp] = getOpRange(it);
More information about the Mlir-commits
mailing list