[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 14:25:28 PDT 2020
schweitz created this revision.
schweitz added reviewers: bkramer, hokein.
schweitz added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, xazax.hun.
Herald added a reviewer: DavidTruby.
Herald added a reviewer: sscalpone.
Herald added a project: clang.
to be recognized rather than flagged as a violation in phabricator.
Repository:
rG LLVM Github Monorepo
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.274235.patch
Type: text/x-patch
Size: 546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200629/09828a21/attachment.bin>
More information about the cfe-commits
mailing list