30 lines · c
1//===----------------------------------------------------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_USENEWMLIROPBUILDERCHECK_H10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_USENEWMLIROPBUILDERCHECK_H11 12#include "../utils/TransformerClangTidyCheck.h"13 14namespace clang::tidy::llvm_check {15 16/// Checks for uses of MLIR's old/to be deprecated `OpBuilder::create<T>` form17/// and suggests using `T::create` instead.18class UseNewMlirOpBuilderCheck : public utils::TransformerClangTidyCheck {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_check28 29#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_USENEWMLIROPBUILDERCHECK_H30