teak-llvm/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.h
Don Hinton b75e7eae17 [clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_check'
Summary:
Change the namespace for llvm checkers from 'llvm' to
'llvm_check', and modify add_new_check.py and rename_check.py to
support the new namespace. Checker, file, and directory names remain
unchanged.

Used new version of rename_check.py to make the change in existing
llvm checkers, but had to fix LLVMTidyModule.cpp and
LLVMModuleTest.cpp by hand.

The changes made by rename_check.py are idempotent, so if accidentally
run multiple times, it won't do anything.

Reviewed By: aaron.ballman

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D60629

llvm-svn: 360450
2019-05-10 18:27:09 +00:00

40 lines
1.6 KiB
C++

//===--- HeaderGuardCheck.h - clang-tidy ------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H
#include "../utils/HeaderGuard.h"
namespace clang {
namespace tidy {
namespace llvm_check {
/// Finds and fixes header guards that do not adhere to LLVM style.
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/llvm-header-guard.html
/// The check supports these options:
/// - `HeaderFileExtensions`: a comma-separated list of filename extensions of
/// header files (The filename extension should not contain "." prefix).
/// ",h,hh,hpp,hxx" by default.
/// For extension-less header files, using an empty string or leaving an
/// empty string between "," if there are other filename extensions.
class LLVMHeaderGuardCheck : public utils::HeaderGuardCheck {
public:
LLVMHeaderGuardCheck(StringRef Name, ClangTidyContext *Context);
bool shouldSuggestEndifComment(StringRef Filename) override { return false; }
std::string getHeaderGuard(StringRef Filename, StringRef OldGuard) override;
};
} // namespace llvm_check
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H