clang-tools
17.0.0git
llvm-project
clang-tools-extra
clang-tidy
readability
ConstReturnTypeCheck.h
Go to the documentation of this file.
1
//===--- ConstReturnTypeCheck.h - clang-tidy --------------------*- C++ -*-===//
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
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONSTRETURNTYPECHECK_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONSTRETURNTYPECHECK_H
11
12
#include "../ClangTidyCheck.h"
13
14
namespace
clang::tidy::readability
{
15
16
/// For any function whose return type is const-qualified, suggests removal of
17
/// the `const` qualifier from that return type.
18
///
19
/// For the user-facing documentation see:
20
/// http://clang.llvm.org/extra/clang-tidy/checks/readability/const-return-type.html
21
class
ConstReturnTypeCheck
:
public
ClangTidyCheck
{
22
public
:
23
ConstReturnTypeCheck
(StringRef
Name
,
ClangTidyContext
*Context)
24
:
ClangTidyCheck
(
Name
, Context),
25
IgnoreMacros(
Options
.getLocalOrGlobal(
"IgnoreMacros"
, true)) {}
26
void
storeOptions
(
ClangTidyOptions::OptionMap
&Opts)
override
;
27
void
registerMatchers
(ast_matchers::MatchFinder *Finder)
override
;
28
void
check
(
const
ast_matchers::MatchFinder::MatchResult &Result)
override
;
29
30
private
:
31
const
bool
IgnoreMacros;
32
};
33
34
}
// namespace clang::tidy::readability
35
36
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONSTRETURNTYPECHECK_H
Name
Token Name
Definition:
MacroToEnumCheck.cpp:87
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition:
ClangTidyCheck.h:53
clang::tidy::ClangTidyCheck::Options
OptionsView Options
Definition:
ClangTidyCheck.h:414
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:69
clang::tidy::readability::ConstReturnTypeCheck
For any function whose return type is const-qualified, suggests removal of the const qualifier from t...
Definition:
ConstReturnTypeCheck.h:21
clang::tidy::readability::ConstReturnTypeCheck::storeOptions
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
Definition:
ConstReturnTypeCheck.cpp:106
clang::tidy::readability::ConstReturnTypeCheck::ConstReturnTypeCheck
ConstReturnTypeCheck(StringRef Name, ClangTidyContext *Context)
Definition:
ConstReturnTypeCheck.h:23
clang::tidy::readability::ConstReturnTypeCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition:
ConstReturnTypeCheck.cpp:110
clang::tidy::readability::ConstReturnTypeCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition:
ConstReturnTypeCheck.cpp:127
clang::tidy::readability
Definition:
AvoidConstParamsInDecls.cpp:17
clang::tidy::ClangTidyOptions::OptionMap
llvm::StringMap< ClangTidyValue > OptionMap
Definition:
ClangTidyOptions.h:122
Generated on Mon May 29 2023 20:22:31 for clang-tools by
1.9.6