[flang-commits] [flang] [flang][NFC] Fix header guards (PR #85801)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Tue Mar 19 07:52:53 PDT 2024


https://github.com/tarunprabhu created https://github.com/llvm/llvm-project/pull/85801

Some header guards conflicted with clang. Fix a few others to follow the convention in the rest of the headers in flang.

Specifically the header guard in `flang/Frontend/CodeGenOptions.h` conflicted with that clang. I took the liberty of fixing a few others to make them consistent with the convention used in the rest of the repo.

>From ca923f4ca1688e460f8dbafb2e983aa2f73f5180 Mon Sep 17 00:00:00 2001
From: Tarun Prabhu <tarun at lanl.gov>
Date: Tue, 19 Mar 2024 08:46:21 -0600
Subject: [PATCH] [flang] Fix header guards

Some header guards conficted with clang i.e. a clang header file had exactly
the same guard. Fix a few others to follow the convention in the rest of the
headers.
---
 flang/include/flang/Common/Version.h          | 6 +++---
 flang/include/flang/Frontend/CodeGenOptions.h | 6 +++---
 flang/include/flang/Frontend/LangOptions.h    | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/flang/include/flang/Common/Version.h b/flang/include/flang/Common/Version.h
index b1bd2416a61840..3257d4a4f64593 100644
--- a/flang/include/flang/Common/Version.h
+++ b/flang/include/flang/Common/Version.h
@@ -12,8 +12,8 @@
 ///
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_FLANG_COMMON_VERSION_H
-#define LLVM_FLANG_COMMON_VERSION_H
+#ifndef FORTRAN_COMMON_VERSION_H
+#define FORTRAN_COMMON_VERSION_H
 
 #include "flang/Version.inc"
 #include "llvm/ADT/StringRef.h"
@@ -53,4 +53,4 @@ std::string getFlangFullVersion();
 std::string getFlangToolFullVersion(llvm::StringRef ToolName);
 } // namespace Fortran::common
 
-#endif // LLVM_FLANG_COMMON_VERSION_H
+#endif // FORTRAN_COMMON_VERSION_H
diff --git a/flang/include/flang/Frontend/CodeGenOptions.h b/flang/include/flang/Frontend/CodeGenOptions.h
index 0c318e4023af43..b0bbace82c0493 100644
--- a/flang/include/flang/Frontend/CodeGenOptions.h
+++ b/flang/include/flang/Frontend/CodeGenOptions.h
@@ -12,8 +12,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_BASIC_CODEGENOPTIONS_H
-#define LLVM_CLANG_BASIC_CODEGENOPTIONS_H
+#ifndef FORTRAN_FRONTEND_CODEGENOPTIONS_H
+#define FORTRAN_FRONTEND_CODEGENOPTIONS_H
 
 #include "llvm/Frontend/Debug/Options.h"
 #include "llvm/Frontend/Driver/CodeGenOptions.h"
@@ -141,4 +141,4 @@ class CodeGenOptions : public CodeGenOptionsBase {
 
 } // end namespace Fortran::frontend
 
-#endif
+#endif // FORTRAN_FRONTEND_CODEGENOPTIONS_H
diff --git a/flang/include/flang/Frontend/LangOptions.h b/flang/include/flang/Frontend/LangOptions.h
index 7adf2eec9ca3dc..7ab2195818863d 100644
--- a/flang/include/flang/Frontend/LangOptions.h
+++ b/flang/include/flang/Frontend/LangOptions.h
@@ -12,8 +12,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_FLANG_FRONTEND_LANGOPTIONS_H
-#define LLVM_FLANG_FRONTEND_LANGOPTIONS_H
+#ifndef FORTRAN_FRONTEND_LANGOPTIONS_H
+#define FORTRAN_FRONTEND_LANGOPTIONS_H
 
 #include <string>
 
@@ -63,4 +63,4 @@ class LangOptions : public LangOptionsBase {
 
 } // end namespace Fortran::frontend
 
-#endif
+#endif // FORTRAN_FRONTEND_LANGOPTIONS_H



More information about the flang-commits mailing list