clang-tools  8.0.0svn
TypeMismatchCheck.h
Go to the documentation of this file.
1 //===--- TypeMismatchCheck.h - clang-tidy------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
12 
13 #include "../ClangTidy.h"
14 #include "clang/ASTMatchers/ASTMatchFinder.h"
15 
16 namespace clang {
17 namespace tidy {
18 namespace mpi {
19 
20 /// This check verifies if buffer type and MPI (Message Passing Interface)
21 /// datatype pairs match. All MPI datatypes defined by the MPI standard (3.1)
22 /// are verified by this check. User defined typedefs, custom MPI datatypes and
23 /// null pointer constants are skipped, in the course of verification.
24 ///
25 /// For the user-facing documentation see:
26 /// http://clang.llvm.org/extra/clang-tidy/checks/mpi-type-mismatch.html
28 public:
30  : ClangTidyCheck(Name, Context) {}
31 
32  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
33  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
34 
35 private:
36  /// Check if the buffer type MPI datatype pairs match.
37  ///
38  /// \param BufferTypes buffer types
39  /// \param BufferExprs buffer arguments as expressions
40  /// \param MPIDatatypes MPI datatype
41  /// \param LO language options
42  void checkArguments(ArrayRef<const Type *> BufferTypes,
43  ArrayRef<const Expr *> BufferExprs,
44  ArrayRef<StringRef> MPIDatatypes, const LangOptions &LO);
45 };
46 
47 } // namespace mpi
48 } // namespace tidy
49 } // namespace clang
50 
51 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
Optional< Expected< tooling::AtomicChanges > > Result
This check verifies if buffer type and MPI (Message Passing Interface) datatype pairs match...
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
static constexpr llvm::StringLiteral Name
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
TypeMismatchCheck(StringRef Name, ClangTidyContext *Context)
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.