[PATCH] D20512: [PATCH] Bug 27475 - Request header guard check processes .hpp files as well as .h files

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon May 23 07:31:04 PDT 2016


hokein added a subscriber: hokein.

================
Comment at: clang-tidy/llvm/HeaderGuardCheck.h:19
@@ -18,3 +18,3 @@
 
 /// Finds and fixes header guards that do not adhere to LLVM style.
 class LLVMHeaderGuardCheck : public utils::HeaderGuardCheck {
----------------
You should add a document for the option `HeaderFileExtensions` here.

================
Comment at: clang-tidy/utils/HeaderGuard.cpp:300
@@ +299,3 @@
+                                            ',');
+  StringRef extension = ::llvm::sys::path::extension(FileName);
+  if (extension.size() > 0 && extension.front() == '.') {
----------------
To avoid the redundant code, you can put this kind of code to `utls::HeaderFileExtensionsUtils` (something like `isHeaderFileExtension`).



================
Comment at: clang-tidy/utils/HeaderGuard.h:15
@@ -14,1 +14,3 @@
+#include "../utils/HeaderFileExtensionsUtils.h"
+#include "llvm/Support/Path.h"
 
----------------
seems not needed?

================
Comment at: clang-tidy/utils/HeaderGuard.h:45
@@ -42,1 +44,3 @@
+private:
+  utils::HeaderFileExtensionsSet HeaderFileExtensions;
 };
----------------
Not needed to be a member variable.


http://reviews.llvm.org/D20512





More information about the cfe-commits mailing list