clang-tools 22.0.0git
UseNewMLIROpBuilderCheck.h
Go to the documentation of this file.
1//===--- UseNewMLIROpBuilderCheck.h - clang-tidy ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_USENEWMLIROPBUILDERCHECK_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_USENEWMLIROPBUILDERCHECK_H
11
13
15
16/// Checks for uses of MLIR's old/to be deprecated `OpBuilder::create<T>` form
17/// and suggests using `T::create` instead.
19public:
20 UseNewMlirOpBuilderCheck(StringRef Name, ClangTidyContext *Context);
21
22 bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
23 return getLangOpts().CPlusPlus;
24 }
25};
26
27} // namespace clang::tidy::llvm_check
28
29#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_USENEWMLIROPBUILDERCHECK_H
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
UseNewMlirOpBuilderCheck(StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
A base class for defining a ClangTidy check based on a RewriteRule.