blob: d91f67ac1485656ba7fefba658a27d9cd4005bde [file] [log] [blame]
Frank Derry Wanye156b1272020-09-08 09:35:14 -04001//===--- 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//===----------------------------------------------------------------------===//
8
9#include "../ClangTidy.h"
10#include "../ClangTidyModule.h"
11#include "../ClangTidyModuleRegistry.h"
12#include "StructPackAlignCheck.h"
13
14using namespace clang::ast_matchers;
15
16namespace clang {
17namespace tidy {
18namespace altera {
19
20class AlteraModule : public ClangTidyModule {
21public:
22 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
Frank Derry Wanye156b1272020-09-08 09:35:14 -040023 CheckFactories.registerCheck<StructPackAlignCheck>(
24 "altera-struct-pack-align");
25 }
26};
27
28} // namespace altera
29
30// Register the AlteraTidyModule using this statically initialized variable.
31static ClangTidyModuleRegistry::Add<altera::AlteraModule>
32 X("altera-module", "Adds Altera FPGA OpenCL lint checks.");
33
34// This anchor is used to force the linker to link in the generated object file
35// and thus register the AlteraModule.
36volatile int AlteraModuleAnchorSource = 0;
37
38} // namespace tidy
39} // namespace clang