From c30340b207493bc61acdea202dfda882be92df02 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Mon, 3 Sep 2018 16:22:05 +0000 Subject: [PATCH] Add header guards to some headers that are missing them Also adjust some of dsymutil's headers to put the header guards at the top, otherwise the compiler will not recognize them as header guards. llvm-svn: 341323 --- llvm/include/llvm/Analysis/IndirectCallSiteVisitor.h | 5 +++++ llvm/lib/Target/ARM/ARMMacroFusion.h | 5 +++++ llvm/lib/Target/X86/X86MacroFusion.h | 5 +++++ .../AggressiveInstCombine/AggressiveInstCombineInternal.h | 5 +++++ llvm/tools/dsymutil/CFBundle.h | 5 +++++ llvm/tools/dsymutil/CompileUnit.h | 6 +++--- llvm/tools/dsymutil/DeclContext.h | 6 +++--- llvm/tools/dsymutil/DwarfStreamer.h | 6 +++--- llvm/unittests/ADT/TestGraph.h | 6 +++--- llvm/unittests/tools/llvm-exegesis/Common/AssemblerUtils.h | 5 +++++ 10 files changed, 42 insertions(+), 12 deletions(-) diff --git a/llvm/include/llvm/Analysis/IndirectCallSiteVisitor.h b/llvm/include/llvm/Analysis/IndirectCallSiteVisitor.h index dde56a1..a30b59f 100644 --- a/llvm/include/llvm/Analysis/IndirectCallSiteVisitor.h +++ b/llvm/include/llvm/Analysis/IndirectCallSiteVisitor.h @@ -10,6 +10,9 @@ // This file implements defines a visitor class and a helper function that find // all indirect call-sites in a function. +#ifndef LLVM_ANALYSIS_INDIRECTCALLSITEVISITOR_H +#define LLVM_ANALYSIS_INDIRECTCALLSITEVISITOR_H + #include "llvm/IR/InstVisitor.h" #include @@ -33,3 +36,5 @@ inline std::vector findIndirectCallSites(Function &F) { return ICV.IndirectCallInsts; } } + +#endif diff --git a/llvm/lib/Target/ARM/ARMMacroFusion.h b/llvm/lib/Target/ARM/ARMMacroFusion.h index 1e4fc66..b3abd7b 100644 --- a/llvm/lib/Target/ARM/ARMMacroFusion.h +++ b/llvm/lib/Target/ARM/ARMMacroFusion.h @@ -12,6 +12,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_LIB_TARGET_ARM_ARMMACROFUSION_H +#define LLVM_LIB_TARGET_ARM_ARMMACROFUSION_H + #include "llvm/CodeGen/MachineScheduler.h" namespace llvm { @@ -22,3 +25,5 @@ namespace llvm { std::unique_ptr createARMMacroFusionDAGMutation(); } // llvm + +#endif diff --git a/llvm/lib/Target/X86/X86MacroFusion.h b/llvm/lib/Target/X86/X86MacroFusion.h index 13fa2d7..97ef1d6 100644 --- a/llvm/lib/Target/X86/X86MacroFusion.h +++ b/llvm/lib/Target/X86/X86MacroFusion.h @@ -12,6 +12,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_LIB_TARGET_X86_X86MACROFUSION_H +#define LLVM_LIB_TARGET_X86_X86MACROFUSION_H + #include "llvm/CodeGen/MachineScheduler.h" namespace llvm { @@ -23,3 +26,5 @@ std::unique_ptr createX86MacroFusionDAGMutation(); } // end namespace llvm + +#endif diff --git a/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombineInternal.h b/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombineInternal.h index 199374c..f3c8bde 100644 --- a/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombineInternal.h +++ b/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombineInternal.h @@ -13,6 +13,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_LIB_TRANSFORMS_AGGRESSIVEINSTCOMBINE_COMBINEINTERNAL_H +#define LLVM_LIB_TRANSFORMS_AGGRESSIVEINSTCOMBINE_COMBINEINTERNAL_H + #include "llvm/ADT/MapVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -119,3 +122,5 @@ private: void ReduceExpressionDag(Type *SclTy); }; } // end namespace llvm. + +#endif diff --git a/llvm/tools/dsymutil/CFBundle.h b/llvm/tools/dsymutil/CFBundle.h index bdbecb4..5f24184 100644 --- a/llvm/tools/dsymutil/CFBundle.h +++ b/llvm/tools/dsymutil/CFBundle.h @@ -7,6 +7,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_DSYMUTIL_CFBUNDLE_H +#define LLVM_TOOLS_DSYMUTIL_CFBUNDLE_H + #include "llvm/ADT/StringRef.h" #include @@ -24,3 +27,5 @@ CFBundleInfo getBundleInfo(llvm::StringRef ExePath); } // end namespace dsymutil } // end namespace llvm + +#endif diff --git a/llvm/tools/dsymutil/CompileUnit.h b/llvm/tools/dsymutil/CompileUnit.h index 0f5efdd..79b88fd 100644 --- a/llvm/tools/dsymutil/CompileUnit.h +++ b/llvm/tools/dsymutil/CompileUnit.h @@ -7,13 +7,13 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_DSYMUTIL_COMPILEUNIT_H +#define LLVM_TOOLS_DSYMUTIL_COMPILEUNIT_H + #include "llvm/ADT/IntervalMap.h" #include "llvm/CodeGen/DIE.h" #include "llvm/DebugInfo/DWARF/DWARFUnit.h" -#ifndef LLVM_TOOLS_DSYMUTIL_COMPILEUNIT_H -#define LLVM_TOOLS_DSYMUTIL_COMPILEUNIT_H - namespace llvm { namespace dsymutil { diff --git a/llvm/tools/dsymutil/DeclContext.h b/llvm/tools/dsymutil/DeclContext.h index 1fa6815..425c736 100644 --- a/llvm/tools/dsymutil/DeclContext.h +++ b/llvm/tools/dsymutil/DeclContext.h @@ -7,6 +7,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_DSYMUTIL_DECLCONTEXT_H +#define LLVM_TOOLS_DSYMUTIL_DECLCONTEXT_H + #include "CompileUnit.h" #include "NonRelocatableStringpool.h" #include "llvm/ADT/DenseMap.h" @@ -16,9 +19,6 @@ #include "llvm/DebugInfo/DWARF/DWARFDie.h" #include "llvm/Support/Path.h" -#ifndef LLVM_TOOLS_DSYMUTIL_DECLCONTEXT_H -#define LLVM_TOOLS_DSYMUTIL_DECLCONTEXT_H - namespace llvm { namespace dsymutil { diff --git a/llvm/tools/dsymutil/DwarfStreamer.h b/llvm/tools/dsymutil/DwarfStreamer.h index 74f0a09..679d124 100644 --- a/llvm/tools/dsymutil/DwarfStreamer.h +++ b/llvm/tools/dsymutil/DwarfStreamer.h @@ -7,6 +7,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_DSYMUTIL_DWARFSTREAMER_H +#define LLVM_TOOLS_DSYMUTIL_DWARFSTREAMER_H + #include "CompileUnit.h" #include "DebugMap.h" #include "LinkUtils.h" @@ -32,9 +35,6 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" -#ifndef LLVM_TOOLS_DSYMUTIL_DWARFSTREAMER_H -#define LLVM_TOOLS_DSYMUTIL_DWARFSTREAMER_H - namespace llvm { namespace dsymutil { diff --git a/llvm/unittests/ADT/TestGraph.h b/llvm/unittests/ADT/TestGraph.h index 1c495d2..4ddd14c 100644 --- a/llvm/unittests/ADT/TestGraph.h +++ b/llvm/unittests/ADT/TestGraph.h @@ -11,14 +11,14 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_UNITTESTS_ADT_TEST_GRAPH_H +#define LLVM_UNITTESTS_ADT_TEST_GRAPH_H + #include "llvm/ADT/GraphTraits.h" #include #include #include -#ifndef LLVM_UNITTESTS_ADT_TEST_GRAPH_H -#define LLVM_UNITTESTS_ADT_TEST_GRAPH_H - namespace llvm { /// Graph - A graph with N nodes. Note that N can be at most 8. diff --git a/llvm/unittests/tools/llvm-exegesis/Common/AssemblerUtils.h b/llvm/unittests/tools/llvm-exegesis/Common/AssemblerUtils.h index f055949..9265e3e 100644 --- a/llvm/unittests/tools/llvm-exegesis/Common/AssemblerUtils.h +++ b/llvm/unittests/tools/llvm-exegesis/Common/AssemblerUtils.h @@ -7,6 +7,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_UNITTESTS_TOOLS_LLVMEXEGESIS_ASSEMBLERUTILS_H +#define LLVM_UNITTESTS_TOOLS_LLVMEXEGESIS_ASSEMBLERUTILS_H + #include "Assembler.h" #include "BenchmarkRunner.h" #include "Target.h" @@ -85,3 +88,5 @@ private: }; } // namespace exegesis + +#endif -- 2.7.4