alexfh requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: clang-tidy/llvm/HeaderGuardCheck.cpp:18
@@ +17,3 @@
+  StringRef extension = ::llvm::sys::path::extension(Filename);
+  if (extension.size() > 0 && extension.front() == '.') {
+    extension = extension.substr(1);
----------------
nit: In LLVM/Clang code it's not common to enclose single-line if/while/for 
bodies in braces.

================
Comment at: clang-tidy/llvm/HeaderGuardCheck.cpp:18
@@ +17,3 @@
+  StringRef extension = ::llvm::sys::path::extension(Filename);
+  if (extension.size() > 0 && extension.front() == '.') {
+    extension = extension.substr(1);
----------------
alexfh wrote:
> nit: In LLVM/Clang code it's not common to enclose single-line if/while/for 
> bodies in braces.
`if (extension.startswith("."))`

================
Comment at: clang-tidy/llvm/HeaderGuardCheck.cpp:22
@@ +21,3 @@
+
+  if (HeaderFileExtensions.count(extension))
+    return true;
----------------
`return HeaderFileExtensions.count(extension) > 0;`

================
Comment at: clang-tidy/llvm/HeaderGuardCheck.cpp:26
@@ -18,2 +25,3 @@
+  return false;
 }
 
----------------
Were you going to use `isHeaderFileExtension`, btw?

================
Comment at: clang-tidy/utils/HeaderFileExtensionsUtils.cpp:64
@@ -63,1 +63,3 @@
 
+bool isHeaderFileExtension(StringRef FileName, HeaderFileExtensionsSet 
HeaderFileExtensions) {
+  StringRef extension = ::llvm::sys::path::extension(FileName);
----------------
1. clang-format the code
2. see comments for `LLVMHeaderGuardCheck::shouldFixHeaderGuard` above


https://reviews.llvm.org/D20512



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to