[clang-tidy] Allows the prevailing include header guard in Flang to be recognized rather than flagged as a violation in phabricator.

Differential revision: https://reviews.llvm.org/D82807
This commit is contained in:
Eric Schweitz 2020-06-29 14:15:59 -07:00
parent 51e92b223b
commit e158154087
1 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,10 @@ std::string LLVMHeaderGuardCheck::getHeaderGuard(StringRef Filename,
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();
}