[llvm] 56fa1b4 - [llvm-reduce] Add header guards and fix clang-tidy warnings
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 1 20:42:55 PDT 2021
Author: Samuel
Date: 2021-04-01T20:38:49-07:00
New Revision: 56fa1b4ff2b67f8cdcb38763df51d407ba4814d5
URL: https://github.com/llvm/llvm-project/commit/56fa1b4ff2b67f8cdcb38763df51d407ba4814d5
DIFF: https://github.com/llvm/llvm-project/commit/56fa1b4ff2b67f8cdcb38763df51d407ba4814d5.diff
LOG: [llvm-reduce] Add header guards and fix clang-tidy warnings
Add header guards and fix other clang-tidy warnings in .h files.
Also align misaligned header docs
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D99634
Added:
llvm/tools/llvm-reduce/DeltaManager.cpp
Modified:
llvm/tools/llvm-reduce/CMakeLists.txt
llvm/tools/llvm-reduce/DeltaManager.h
llvm/tools/llvm-reduce/TestRunner.h
llvm/tools/llvm-reduce/deltas/Delta.cpp
llvm/tools/llvm-reduce/deltas/Delta.h
llvm/tools/llvm-reduce/deltas/ReduceAliases.h
llvm/tools/llvm-reduce/deltas/ReduceArguments.h
llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp
llvm/tools/llvm-reduce/deltas/ReduceAttributes.h
llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.h
llvm/tools/llvm-reduce/deltas/ReduceFunctionBodies.h
llvm/tools/llvm-reduce/deltas/ReduceFunctions.h
llvm/tools/llvm-reduce/deltas/ReduceGlobalVarInitializers.h
llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp
llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.h
llvm/tools/llvm-reduce/deltas/ReduceInstructions.h
llvm/tools/llvm-reduce/deltas/ReduceMetadata.h
llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.h
llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.h
llvm/tools/llvm-reduce/llvm-reduce.cpp
llvm/utils/gn/secondary/llvm/tools/llvm-reduce/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/tools/llvm-reduce/CMakeLists.txt b/llvm/tools/llvm-reduce/CMakeLists.txt
index 0f91677770e74..4b37ff622bbfe 100644
--- a/llvm/tools/llvm-reduce/CMakeLists.txt
+++ b/llvm/tools/llvm-reduce/CMakeLists.txt
@@ -11,6 +11,7 @@ set(LLVM_LINK_COMPONENTS
)
add_llvm_tool(llvm-reduce
+ DeltaManager.cpp
TestRunner.cpp
deltas/Delta.cpp
deltas/ReduceAliases.cpp
diff --git a/llvm/tools/llvm-reduce/DeltaManager.cpp b/llvm/tools/llvm-reduce/DeltaManager.cpp
new file mode 100644
index 0000000000000..797b6802d0e79
--- /dev/null
+++ b/llvm/tools/llvm-reduce/DeltaManager.cpp
@@ -0,0 +1,50 @@
+//===- DeltaManager.cpp - Runs Delta Passes to reduce Input ---------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file calls each specialized Delta pass in order to reduce the input IR
+// file.
+//
+//===----------------------------------------------------------------------===//
+
+#include "DeltaManager.h"
+#include "TestRunner.h"
+#include "deltas/Delta.h"
+#include "deltas/ReduceAliases.h"
+#include "deltas/ReduceArguments.h"
+#include "deltas/ReduceAttributes.h"
+#include "deltas/ReduceBasicBlocks.h"
+#include "deltas/ReduceFunctionBodies.h"
+#include "deltas/ReduceFunctions.h"
+#include "deltas/ReduceGlobalValues.h"
+#include "deltas/ReduceGlobalVarInitializers.h"
+#include "deltas/ReduceGlobalVars.h"
+#include "deltas/ReduceInstructions.h"
+#include "deltas/ReduceMetadata.h"
+#include "deltas/ReduceOperandBundles.h"
+#include "deltas/ReduceSpecialGlobals.h"
+
+namespace llvm {
+
+// TODO: Add CLI option to run only specified Passes (for unit tests)
+void runDeltaPasses(TestRunner &Tester) {
+ reduceSpecialGlobalsDeltaPass(Tester);
+ reduceAliasesDeltaPass(Tester);
+ reduceFunctionBodiesDeltaPass(Tester);
+ reduceFunctionsDeltaPass(Tester);
+ reduceBasicBlocksDeltaPass(Tester);
+ reduceGlobalValuesDeltaPass(Tester);
+ reduceGlobalsInitializersDeltaPass(Tester);
+ reduceGlobalsDeltaPass(Tester);
+ reduceMetadataDeltaPass(Tester);
+ reduceArgumentsDeltaPass(Tester);
+ reduceInstructionsDeltaPass(Tester);
+ reduceOperandBundesDeltaPass(Tester);
+ reduceAttributesDeltaPass(Tester);
+ // TODO: Implement the remaining Delta Passes
+}
+} // namespace llvm
\ No newline at end of file
diff --git a/llvm/tools/llvm-reduce/DeltaManager.h b/llvm/tools/llvm-reduce/DeltaManager.h
index 5970a3ae460bf..b310f898f27a9 100644
--- a/llvm/tools/llvm-reduce/DeltaManager.h
+++ b/llvm/tools/llvm-reduce/DeltaManager.h
@@ -11,40 +11,13 @@
//
//===----------------------------------------------------------------------===//
+#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"
-#include "deltas/ReduceArguments.h"
-#include "deltas/ReduceAttributes.h"
-#include "deltas/ReduceBasicBlocks.h"
-#include "deltas/ReduceFunctionBodies.h"
-#include "deltas/ReduceFunctions.h"
-#include "deltas/ReduceGlobalValues.h"
-#include "deltas/ReduceGlobalVarInitializers.h"
-#include "deltas/ReduceGlobalVars.h"
-#include "deltas/ReduceInstructions.h"
-#include "deltas/ReduceMetadata.h"
-#include "deltas/ReduceOperandBundles.h"
-#include "deltas/ReduceSpecialGlobals.h"
namespace llvm {
-
-// TODO: Add CLI option to run only specified Passes (for unit tests)
-inline void runDeltaPasses(TestRunner &Tester) {
- reduceSpecialGlobalsDeltaPass(Tester);
- reduceAliasesDeltaPass(Tester);
- reduceFunctionBodiesDeltaPass(Tester);
- reduceFunctionsDeltaPass(Tester);
- reduceBasicBlocksDeltaPass(Tester);
- reduceGlobalValuesDeltaPass(Tester);
- reduceGlobalsInitializersDeltaPass(Tester);
- reduceGlobalsDeltaPass(Tester);
- reduceMetadataDeltaPass(Tester);
- reduceArgumentsDeltaPass(Tester);
- reduceInstructionsDeltaPass(Tester);
- reduceOperandBundesDeltaPass(Tester);
- reduceAttributesDeltaPass(Tester);
- // TODO: Implement the remaining Delta Passes
-}
-
+void runDeltaPasses(TestRunner &Tester);
} // namespace llvm
+
+#endif
diff --git a/llvm/tools/llvm-reduce/TestRunner.h b/llvm/tools/llvm-reduce/TestRunner.h
index 2270d6bd90b27..b7fb44e820628 100644
--- 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.cpp b/llvm/tools/llvm-reduce/deltas/Delta.cpp
index 9b0969e936751..75d927955e8af 100644
--- a/llvm/tools/llvm-reduce/deltas/Delta.cpp
+++ b/llvm/tools/llvm-reduce/deltas/Delta.cpp
@@ -24,7 +24,7 @@ using namespace llvm;
void writeOutput(llvm::Module *M, llvm::StringRef Message);
-bool IsReduced(Module &M, TestRunner &Test, SmallString<128> &CurrentFilepath) {
+bool isReduced(Module &M, TestRunner &Test, SmallString<128> &CurrentFilepath) {
// Write Module to tmp file
int FD;
std::error_code EC =
@@ -66,12 +66,12 @@ static bool increaseGranularity(std::vector<Chunk> &Chunks) {
bool SplitOne = false;
for (auto &C : Chunks) {
- if (C.end - C.begin == 0)
+ if (C.End - C.Begin == 0)
NewChunks.push_back(C);
else {
- int Half = (C.begin + C.end) / 2;
- NewChunks.push_back({C.begin, Half});
- NewChunks.push_back({Half + 1, C.end});
+ int Half = (C.Begin + C.End) / 2;
+ NewChunks.push_back({C.Begin, Half});
+ NewChunks.push_back({Half + 1, C.End});
SplitOne = true;
}
}
@@ -102,7 +102,7 @@ void llvm::runDeltaPass(
if (Module *Program = Test.getProgram()) {
SmallString<128> CurrentFilepath;
- if (!IsReduced(*Program, Test, CurrentFilepath)) {
+ if (!isReduced(*Program, Test, CurrentFilepath)) {
errs() << "\nInput isn't interesting! Verify interesting-ness test\n";
exit(1);
}
@@ -152,7 +152,7 @@ void llvm::runDeltaPass(
C.print();
SmallString<128> CurrentFilepath;
- if (!IsReduced(*Clone, Test, CurrentFilepath)) {
+ if (!isReduced(*Clone, Test, CurrentFilepath)) {
// Program became non-reduced, so this chunk appears to be interesting.
errs() << "\n";
continue;
diff --git a/llvm/tools/llvm-reduce/deltas/Delta.h b/llvm/tools/llvm-reduce/deltas/Delta.h
index 7da3c79c958eb..69bd4d2cad503 100644
--- 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 @@ class Oracle {
ArrayRef<Chunk> ChunksToKeep;
public:
- explicit Oracle(ArrayRef<Chunk> ChunksToKeep_)
- : ChunksToKeep(ChunksToKeep_) {}
+ explicit Oracle(ArrayRef<Chunk> 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 @@ class Oracle {
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
index 0c2886e0c2257..0660efe5e9d5b 100644
--- 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
index d9682b44f74d7..228409d3ca3c1 100644
--- 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.cpp b/llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp
index cbaf5d5efd346..26b77bfd5aba5 100644
--- 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/ReduceAttributes.h b/llvm/tools/llvm-reduce/deltas/ReduceAttributes.h
index f8deb045560ff..375e764df0342 100644
--- 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/ReduceBasicBlocks.cpp b/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
index 8c0832dd884ac..5a1905d842af0 100644
--- a/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
+++ b/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
@@ -26,9 +26,9 @@ using namespace llvm;
/// Replaces BB Terminator with one that only contains Chunk BBs
static void replaceBranchTerminator(BasicBlock &BB,
std::set<BasicBlock *> BBsToKeep) {
- auto Term = BB.getTerminator();
+ auto *Term = BB.getTerminator();
std::vector<BasicBlock *> ChunkSucessors;
- for (auto Succ : successors(&BB))
+ for (auto *Succ : successors(&BB))
if (BBsToKeep.count(Succ))
ChunkSucessors.push_back(Succ);
@@ -38,7 +38,7 @@ static void replaceBranchTerminator(BasicBlock &BB,
bool IsBranch = isa<BranchInst>(Term) || isa<InvokeInst>(Term);
Value *Address = nullptr;
- if (auto IndBI = dyn_cast<IndirectBrInst>(Term))
+ if (auto *IndBI = dyn_cast<IndirectBrInst>(Term))
Address = IndBI->getAddress();
Term->replaceAllUsesWith(UndefValue::get(Term->getType()));
@@ -56,9 +56,9 @@ static void replaceBranchTerminator(BasicBlock &BB,
BranchInst::Create(ChunkSucessors[0], &BB);
if (Address) {
- auto NewIndBI =
+ auto *NewIndBI =
IndirectBrInst::Create(Address, ChunkSucessors.size(), &BB);
- for (auto Dest : ChunkSucessors)
+ for (auto *Dest : ChunkSucessors)
NewIndBI->addDestination(Dest);
}
}
diff --git a/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.h b/llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.h
index cf76a0abbcd7a..49385527cb808 100644
--- 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
index 8c06c2e4a1a93..bfe701b588b61 100644
--- 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
index 7c2cd3f33e9f2..f5bc83b9a1e20 100644
--- 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
index 39288adce88c0..0f5f22ad43afd 100644
--- 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.cpp b/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp
index 4b184e5b3eadf..525eff99b863a 100644
--- a/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp
+++ b/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp
@@ -33,7 +33,7 @@ static void extractGVsFromModule(std::vector<Chunk> ChunksToKeep,
std::vector<WeakVH> InstToRemove;
for (auto &GV : Program->globals())
if (!GVsToKeep.count(&GV)) {
- for (auto U : GV.users())
+ for (auto *U : GV.users())
if (auto *Inst = dyn_cast<Instruction>(U))
InstToRemove.push_back(Inst);
diff --git a/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.h b/llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.h
index c8ba7eacb84cd..fe7813c538533 100644
--- 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
index a9266acd051a3..be568f184969b 100644
--- 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
index 275b44c2aa7de..6efc3f5598d69 100644
--- 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
index 382c5cb5691d5..d07e0218595b0 100644
--- 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
diff --git a/llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.h b/llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.h
index 52ecaed4cd910..c0f3f9ee337d8 100644
--- 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
diff --git a/llvm/tools/llvm-reduce/llvm-reduce.cpp b/llvm/tools/llvm-reduce/llvm-reduce.cpp
index 376826b8b9e7b..0499d4961a05c 100644
--- a/llvm/tools/llvm-reduce/llvm-reduce.cpp
+++ b/llvm/tools/llvm-reduce/llvm-reduce.cpp
@@ -96,10 +96,10 @@ void writeOutput(Module *M, StringRef Message) {
errs() << Message << OutputFilename << "\n";
}
-int main(int argc, char **argv) {
- InitLLVM X(argc, argv);
+int main(int Argc, char **Argv) {
+ InitLLVM X(Argc, Argv);
- cl::ParseCommandLineOptions(argc, argv, "LLVM automatic testcase reducer.\n");
+ cl::ParseCommandLineOptions(Argc, Argv, "LLVM automatic testcase reducer.\n");
LLVMContext Context;
std::unique_ptr<Module> OriginalProgram =
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-reduce/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-reduce/BUILD.gn
index a00f00c2639bd..eb1492b6f03d1 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-reduce/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-reduce/BUILD.gn
@@ -9,6 +9,7 @@ executable("llvm-reduce") {
]
include_dirs = [ "." ]
sources = [
+ "DeltaManager.cpp",
"TestRunner.cpp",
"deltas/Delta.cpp",
"deltas/ReduceAliases.cpp",
More information about the llvm-commits
mailing list