[PATCH] D82807: [clang-tidy] Allows the prevailing include header guard in Flang ...
Eric Schweitz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 29 16:22:57 PDT 2020
schweitz updated this revision to Diff 274278.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82807/new/
https://reviews.llvm.org/D82807
Files:
clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp
Index: clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp
+++ clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp
@@ -54,6 +54,10 @@
if (StringRef(Guard).startswith("clang"))
Guard = "LLVM_" + Guard;
+ // The prevalent style in flang is FORTRAN_FOO_BAR_H
+ if (StringRef(Guard).startswith("flang"))
+ Guard = "FORTRAN" + Guard.substr(sizeof("flang") - 1);
+
return StringRef(Guard).upper();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82807.274278.patch
Type: text/x-patch
Size: 548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200629/fa3ae2ea/attachment.bin>
More information about the cfe-commits
mailing list