[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang-tools-extra / clang-tidy / altera / AlteraTidyModule.cpp
blob17458771d635862c09ce8a4fd32172f9671006e1
1 //===--- AlteraTidyModule.cpp - clang-tidy --------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #include "../ClangTidy.h"
10 #include "../ClangTidyModule.h"
11 #include "../ClangTidyModuleRegistry.h"
12 #include "IdDependentBackwardBranchCheck.h"
13 #include "KernelNameRestrictionCheck.h"
14 #include "SingleWorkItemBarrierCheck.h"
15 #include "StructPackAlignCheck.h"
16 #include "UnrollLoopsCheck.h"
18 using namespace clang::ast_matchers;
20 namespace clang {
21 namespace tidy {
22 namespace altera {
24 class AlteraModule : public ClangTidyModule {
25 public:
26 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
27 CheckFactories.registerCheck<IdDependentBackwardBranchCheck>(
28 "altera-id-dependent-backward-branch");
29 CheckFactories.registerCheck<KernelNameRestrictionCheck>(
30 "altera-kernel-name-restriction");
31 CheckFactories.registerCheck<SingleWorkItemBarrierCheck>(
32 "altera-single-work-item-barrier");
33 CheckFactories.registerCheck<StructPackAlignCheck>(
34 "altera-struct-pack-align");
35 CheckFactories.registerCheck<UnrollLoopsCheck>("altera-unroll-loops");
39 } // namespace altera
41 // Register the AlteraTidyModule using this statically initialized variable.
42 static ClangTidyModuleRegistry::Add<altera::AlteraModule>
43 X("altera-module", "Adds Altera FPGA OpenCL lint checks.");
45 // This anchor is used to force the linker to link in the generated object file
46 // and thus register the AlteraModule.
47 volatile int AlteraModuleAnchorSource = 0;
49 } // namespace tidy
50 } // namespace clang