clang-tools 20.0.0git
AlteraTidyModule.cpp
Go to the documentation of this file.
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//===----------------------------------------------------------------------===//
8
9#include "../ClangTidy.h"
10#include "../ClangTidyModule.h"
11#include "../ClangTidyModuleRegistry.h"
16#include "UnrollLoopsCheck.h"
17
18using namespace clang::ast_matchers;
19
20namespace clang::tidy {
21namespace altera {
22
24public:
25 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
27 "altera-id-dependent-backward-branch");
29 "altera-kernel-name-restriction");
31 "altera-single-work-item-barrier");
32 CheckFactories.registerCheck<StructPackAlignCheck>(
33 "altera-struct-pack-align");
34 CheckFactories.registerCheck<UnrollLoopsCheck>("altera-unroll-loops");
35 }
36};
37
38} // namespace altera
39
40// Register the AlteraTidyModule using this statically initialized variable.
41static ClangTidyModuleRegistry::Add<altera::AlteraModule>
42 X("altera-module", "Adds Altera FPGA OpenCL lint checks.");
43
44// This anchor is used to force the linker to link in the generated object file
45// and thus register the AlteraModule.
46volatile int AlteraModuleAnchorSource = 0;
47
48} // namespace clang::tidy
int X
A collection of ClangTidyCheckFactory instances.
void registerCheck(llvm::StringRef CheckName)
Registers the CheckType with the name Name.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module.
Finds ID-dependent variables and fields used within loops, and warns of their usage.
Finds kernel files and include directives whose filename is kernel.cl, Verilog.cl,...
Detects OpenCL kernel functions that call a barrier but do not call an ID-function function.
Finds structs that are inefficiently packed or aligned, and recommends packing and/or aligning of sai...
Finds inner loops that have not been unrolled, as well as fully unrolled loops with unknown loop boun...
volatile int AlteraModuleAnchorSource