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(); }
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(); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits