clang-tools  7.0.0
TemporaryObjectsCheck.h
Go to the documentation of this file.
1 //===--- TemporaryObjectsCheck.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_ZIRCON_TEMPORARYOBJECTSCHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ZIRCON_TEMPORARYOBJECTSCHECK_H
12 
13 #include "../ClangTidy.h"
14 #include "../utils/OptionsUtils.h"
15 
16 namespace clang {
17 namespace tidy {
18 namespace zircon {
19 
20 /// Construction of specific temporary objects in the Zircon kernel is
21 /// discouraged.
22 ///
23 /// For the user-facing documentation see:
24 /// http://clang.llvm.org/extra/clang-tidy/checks/zircon-temporary-objects.html
26 public:
28  : ClangTidyCheck(Name, Context),
29  Names(utils::options::parseStringList(Options.get("Names", ""))) {}
30  void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
31  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
32  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
33 
34 private:
35  std::vector<std::string> Names;
36 };
37 
38 } // namespace zircon
39 } // namespace tidy
40 } // namespace clang
41 
42 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ZIRCON_TEMPORARYOBJECTSCHECK_H
llvm::StringRef Name
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
std::vector< std::string > parseStringList(StringRef Option)
Parse a semicolon separated list of strings.
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
std::map< std::string, std::string > OptionMap
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
TemporaryObjectsCheck(StringRef Name, ClangTidyContext *Context)
Construction of specific temporary objects in the Zircon kernel is discouraged.