[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
Wed Jul 1 12:59:46 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe1581540876f: [clang-tidy] Allows the prevailing include header guard in Flang to be… (authored by schweitz).

Repository:
  rG LLVM Github Monorepo

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.274896.patch
Type: text/x-patch
Size: 548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200701/41c8ae9c/attachment.bin>


More information about the cfe-commits mailing list