[llvm] Fix include guards
authorElliot Goodrich <elliotgoodrich@gmail.com>
Tue, 13 Jun 2023 09:00:41 +0000 (10:00 +0100)
committerElliot Goodrich <elliotgoodrich@gmail.com>
Tue, 13 Jun 2023 09:47:18 +0000 (10:47 +0100)
Add missing include guards to LLVM header files that did not previously
have them and update existing include guards to ensure that they enclose
all non-whitespace, non-comment text to enable these headers for the
multiple-include optimization.

Differential Revision: https://reviews.llvm.org/D150511

llvm/lib/Support/DebugOptions.h
llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h
llvm/lib/Target/AMDGPU/AMDGPUCombinerHelper.h
llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.h
llvm/lib/Target/DirectX/DXILResourceAnalysis.h
llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.h
llvm/lib/Target/SystemZ/SystemZMachineScheduler.h

index 75e557d..db727d5 100644 (file)
@@ -11,6 +11,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_SUPPORT_DEBUGOPTIONS_H
+#define LLVM_SUPPORT_DEBUGOPTIONS_H
+
 namespace llvm {
 
 // These are invoked internally before parsing command line options.
@@ -27,3 +30,5 @@ void initDebugOptions();
 void initRandomSeedOptions();
 
 } // namespace llvm
+
+#endif // LLVM_SUPPORT_DEBUGOPTIONS_H
index 20ef240..1146fd4 100644 (file)
@@ -6,10 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/IR/Function.h"
-
 #ifndef LLVM_LIB_TARGET_AARCH64_UTILS_AARCH64SMEATTRIBUTES_H
 #define LLVM_LIB_TARGET_AARCH64_UTILS_AARCH64SMEATTRIBUTES_H
+
+#include "llvm/IR/Function.h"
+
 namespace llvm {
 
 class Function;
index a68a444..a933e85 100644 (file)
@@ -12,6 +12,9 @@
 ///
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUCOMBINERHELPER_H
+#define LLVM_LIB_TARGET_AMDGPU_AMDGPUCOMBINERHELPER_H
+
 #include "llvm/CodeGen/GlobalISel/Combiner.h"
 #include "llvm/CodeGen/GlobalISel/CombinerHelper.h"
 
@@ -29,3 +32,5 @@ public:
   void applyExpandPromotedF16FMed3(MachineInstr &MI, Register Src0,
                                    Register Src1, Register Src2);
 };
+
+#endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUCOMBINERHELPER_H
index e58925b..2fd98a2 100644 (file)
@@ -19,6 +19,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUUNIFYDIVERGENTEXITNODES_H
+#define LLVM_LIB_TARGET_AMDGPU_AMDGPUUNIFYDIVERGENTEXITNODES_H
+
 #include "AMDGPU.h"
 
 namespace llvm {
@@ -29,3 +32,5 @@ public:
 };
 
 } // end namespace llvm
+
+#endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUUNIFYDIVERGENTEXITNODES_H
index 1b46f8b..8ffa1d7 100644 (file)
@@ -10,6 +10,9 @@
 ///
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H
+#define LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H
+
 #include "DXILResource.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
@@ -54,3 +57,5 @@ public:
   void print(raw_ostream &O, const Module *M = nullptr) const override;
 };
 } // namespace llvm
+
+#endif // LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H
index 9e26cd6..cbf2148 100644 (file)
@@ -10,6 +10,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_DXILWRITER_DXILBITCODEWRITER_H
+#define LLVM_DXILWRITER_DXILBITCODEWRITER_H
+
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/MC/StringTableBuilder.h"
@@ -61,3 +64,5 @@ void WriteDXILToFile(const Module &M, raw_ostream &Out);
 } // namespace dxil
 
 } // namespace llvm
+
+#endif // LLVM_DXILWRITER_DXILBITCODEWRITER_H
index 0d5cc2e..e970924 100644 (file)
 // region of each MBB, so that a successor block can learn from it.
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINESCHEDULER_H
+#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINESCHEDULER_H
+
 #include "SystemZHazardRecognizer.h"
 #include "llvm/CodeGen/MachineScheduler.h"
 #include "llvm/CodeGen/ScheduleDAG.h"
 #include <set>
 
-#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINESCHEDULER_H
-#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZMACHINESCHEDULER_H
-
 using namespace llvm;
 
 namespace llvm {