[PATCH] D61508: [clang-tidy] misc-header-guard : a simple version of llvm-header-guard

Tom Rix via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 07:34:35 PDT 2019


trixirt created this revision.
trixirt added reviewers: alexfh, bkramer.
Herald added subscribers: cfe-commits, xazax.hun, mgorny.
Herald added a project: clang.

A general use, missing header guard finder and fixer.
No style checks.  If there is already a working header guard, it is used.
If the header guard is missing or broken, it is created from the path name
using this method.

<path-to>/foo.h ->

#ifndef FOO_H
 #define FOO_H

#endif

The motivation for this change is fixing a large, non llvm with many missing header guards.
As no style is checked, it should not conflict with llvm-header-guard.

The change is also in this dev branch
https://github.com/trixirt/clang-tools-extra/tree/misc-header-check


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D61508

Files:
  clang-tidy/misc/CMakeLists.txt
  clang-tidy/misc/HeaderGuardCheck.cpp
  clang-tidy/misc/HeaderGuardCheck.h
  clang-tidy/misc/MiscTidyModule.cpp
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/misc-header-guard.rst
  test/clang-tidy/misc-header-guard.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61508.198001.patch
Type: text/x-patch
Size: 6417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190503/b85761f9/attachment.bin>


More information about the cfe-commits mailing list