diff --git a/llvm/tools/llvm-reduce/DeltaManager.h b/llvm/tools/llvm-reduce/DeltaManager.h --- a/llvm/tools/llvm-reduce/DeltaManager.h +++ b/llvm/tools/llvm-reduce/DeltaManager.h @@ -11,6 +11,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAMANAGER_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAMANAGER_H + #include "TestRunner.h" #include "deltas/Delta.h" #include "deltas/ReduceAliases.h" @@ -48,3 +51,5 @@ } } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/TestRunner.h b/llvm/tools/llvm-reduce/TestRunner.h --- a/llvm/tools/llvm-reduce/TestRunner.h +++ b/llvm/tools/llvm-reduce/TestRunner.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVMREDUCE_TESTRUNNER_H -#define LLVM_TOOLS_LLVMREDUCE_TESTRUNNER_H +#ifndef LLVM_TOOLS_LLVM_REDUCE_TESTRUNNER_H +#define LLVM_TOOLS_LLVM_REDUCE_TESTRUNNER_H #include "llvm/ADT/SmallString.h" #include "llvm/IR/Module.h" diff --git a/llvm/tools/llvm-reduce/deltas/Delta.h b/llvm/tools/llvm-reduce/deltas/Delta.h --- a/llvm/tools/llvm-reduce/deltas/Delta.h +++ b/llvm/tools/llvm-reduce/deltas/Delta.h @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVMREDUCE_LLVMREDUCE_DELTA_H -#define LLVM_TOOLS_LLVMREDUCE_LLVMREDUCE_DELTA_H +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_DELTA_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_DELTA_H #include "TestRunner.h" #include "llvm/ADT/ScopeExit.h" @@ -24,27 +24,27 @@ namespace llvm { struct Chunk { - int begin; - int end; + int Begin; + int End; /// Helper function to verify if a given Target-index is inside the Chunk - bool contains(int Index) const { return Index >= begin && Index <= end; } + bool contains(int Index) const { return Index >= Begin && Index <= End; } void print() const { - errs() << "[" << begin; - if (end - begin != 0) - errs() << "," << end; + errs() << "[" << Begin; + if (End - Begin != 0) + errs() << "," << End; errs() << "]"; } /// Operator when populating CurrentChunks in Generic Delta Pass friend bool operator!=(const Chunk &C1, const Chunk &C2) { - return C1.begin != C2.begin || C1.end != C2.end; + return C1.Begin != C2.Begin || C1.End != C2.End; } /// Operator used for sets friend bool operator<(const Chunk &C1, const Chunk &C2) { - return std::tie(C1.begin, C1.end) < std::tie(C2.begin, C2.end); + return std::tie(C1.Begin, C1.End) < std::tie(C2.Begin, C2.End); } }; @@ -60,8 +60,7 @@ ArrayRef ChunksToKeep; public: - explicit Oracle(ArrayRef ChunksToKeep_) - : ChunksToKeep(ChunksToKeep_) {} + explicit Oracle(ArrayRef ChunksToKeep) : ChunksToKeep(ChunksToKeep) {} /// Should be called for each feature on which we are operating. /// Name is self-explanatory - if returns true, then it should be preserved. @@ -74,7 +73,7 @@ auto _ = make_scope_exit([&]() { ++Index; }); // Next time - next feature. // Is this the last feature in the chunk? - if (ChunksToKeep.front().end == Index) + if (ChunksToKeep.front().End == Index) ChunksToKeep = ChunksToKeep.drop_front(); // Onto next chunk. return ShouldKeep; diff --git a/llvm/tools/llvm-reduce/deltas/ReduceAliases.h b/llvm/tools/llvm-reduce/deltas/ReduceAliases.h --- a/llvm/tools/llvm-reduce/deltas/ReduceAliases.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceAliases.h @@ -11,8 +11,13 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEALIASES_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEALIASES_H + #include "Delta.h" namespace llvm { void reduceAliasesDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceArguments.h b/llvm/tools/llvm-reduce/deltas/ReduceArguments.h --- a/llvm/tools/llvm-reduce/deltas/ReduceArguments.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceArguments.h @@ -11,6 +11,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEARGUMENTS_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEARGUMENTS_H + #include "Delta.h" #include "llvm/IR/Argument.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" @@ -19,3 +22,5 @@ namespace llvm { void reduceArgumentsDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceAttributes.h b/llvm/tools/llvm-reduce/deltas/ReduceAttributes.h --- a/llvm/tools/llvm-reduce/deltas/ReduceAttributes.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceAttributes.h @@ -11,10 +11,12 @@ // //===----------------------------------------------------------------------===// -namespace llvm { +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEATTRIBUTES_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEATTRIBUTES_H +namespace llvm { class TestRunner; - void reduceAttributesDeltaPass(TestRunner &Test); - } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp b/llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp --- a/llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp +++ b/llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp @@ -1,4 +1,4 @@ -//===- ReduceAttributes.cpp - Specialized Delta Pass -------------------===// +//===- ReduceAttributes.cpp - Specialized Delta Pass ----------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.h b/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.h --- a/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.h @@ -10,6 +10,8 @@ // to reduce uninteresting Arguments from defined functions. // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEBASICBLOCKS_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEBASICBLOCKS_H #include "Delta.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" @@ -18,3 +20,5 @@ namespace llvm { void reduceBasicBlocksDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceFunctionBodies.h b/llvm/tools/llvm-reduce/deltas/ReduceFunctionBodies.h --- a/llvm/tools/llvm-reduce/deltas/ReduceFunctionBodies.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceFunctionBodies.h @@ -11,8 +11,13 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEFUNCTIONBODIES_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEFUNCTIONBODIES_H + #include "Delta.h" namespace llvm { void reduceFunctionBodiesDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceFunctions.h b/llvm/tools/llvm-reduce/deltas/ReduceFunctions.h --- a/llvm/tools/llvm-reduce/deltas/ReduceFunctions.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceFunctions.h @@ -11,6 +11,8 @@ // Module. // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEFUNCTIONS_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEFUNCTIONS_H #include "Delta.h" #include "llvm/Transforms/Utils/Cloning.h" @@ -18,3 +20,5 @@ namespace llvm { void reduceFunctionsDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceGlobalVarInitializers.h b/llvm/tools/llvm-reduce/deltas/ReduceGlobalVarInitializers.h --- a/llvm/tools/llvm-reduce/deltas/ReduceGlobalVarInitializers.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceGlobalVarInitializers.h @@ -1,5 +1,4 @@ -//===- reduceGlobalsInitializersDeltaPass.h - Specialized Delta Pass -//-------===// +//===- reduceGlobalsInitializersDeltaPass.h - Specialized Delta Pass ------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -12,6 +11,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEGLOBALVARINITIALIZERS_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEGLOBALVARINITIALIZERS_H + #include "Delta.h" #include "llvm/IR/Value.h" #include "llvm/Transforms/Utils/Cloning.h" @@ -19,3 +21,5 @@ namespace llvm { void reduceGlobalsInitializersDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.h b/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.h --- a/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.h @@ -11,6 +11,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEGLOBALVARS_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEGLOBALVARS_H + #include "Delta.h" #include "llvm/IR/Value.h" #include "llvm/Transforms/Utils/Cloning.h" @@ -18,3 +21,5 @@ namespace llvm { void reduceGlobalsDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceInstructions.h b/llvm/tools/llvm-reduce/deltas/ReduceInstructions.h --- a/llvm/tools/llvm-reduce/deltas/ReduceInstructions.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceInstructions.h @@ -11,6 +11,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEINSTRUCTIONS_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEINSTRUCTIONS_H + #include "Delta.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" @@ -18,3 +21,5 @@ namespace llvm { void reduceInstructionsDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceMetadata.h b/llvm/tools/llvm-reduce/deltas/ReduceMetadata.h --- a/llvm/tools/llvm-reduce/deltas/ReduceMetadata.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceMetadata.h @@ -1,4 +1,4 @@ -//===- ReduceMetadata.h - Specialized Delta Pass ------------------------===// +//===- ReduceMetadata.h - Specialized Delta Pass --------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -11,8 +11,13 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEMETADATA_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEMETADATA_H + #include "TestRunner.h" namespace llvm { void reduceMetadataDeltaPass(TestRunner &Test); } // namespace llvm + +#endif diff --git a/llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.h b/llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.h --- a/llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.h @@ -11,10 +11,12 @@ // //===----------------------------------------------------------------------===// -namespace llvm { +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEOPERANDBUNDLES_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCEOPERANDBUNDLES_H +namespace llvm { class TestRunner; - void reduceOperandBundesDeltaPass(TestRunner &Test); - } // namespace llvm + +#endif \ No newline at end of file diff --git a/llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.h b/llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.h --- a/llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.h +++ b/llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.h @@ -14,8 +14,13 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCESPECIALGLOBALS_H +#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_REDUCESPECIALGLOBALS_H + #include "Delta.h" namespace llvm { void reduceSpecialGlobalsDeltaPass(TestRunner &Test); } // namespace llvm + +#endif