llvm-reduce: Add missing consts
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 14 Jan 2023 20:15:44 +0000 (15:15 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 18 Jan 2023 03:33:56 +0000 (22:33 -0500)
llvm/tools/llvm-reduce/TestRunner.cpp
llvm/tools/llvm-reduce/deltas/Delta.cpp
llvm/tools/llvm-reduce/llvm-reduce.cpp

index 3a5483c..286eb2a 100644 (file)
@@ -69,7 +69,7 @@ void TestRunner::setProgram(std::unique_ptr<ReducerWorkItem> P) {
   Program = std::move(P);
 }
 
-void writeBitcode(ReducerWorkItem &M, raw_ostream &OutStream) {
+void writeBitcode(const ReducerWorkItem &M, raw_ostream &OutStream) {
   if (M.LTOInfo && M.LTOInfo->IsThinLTO && M.LTOInfo->EnableSplitLTOUnit) {
     PassBuilder PB;
     LoopAnalysisManager LAM;
index 0def68c..f1b342e 100644 (file)
@@ -60,12 +60,12 @@ static cl::opt<unsigned> NumJobs(
 unsigned NumJobs = 1;
 #endif
 
-void writeBitcode(ReducerWorkItem &M, raw_ostream &OutStream);
+void writeBitcode(const ReducerWorkItem &M, raw_ostream &OutStream);
 
 void readBitcode(ReducerWorkItem &M, MemoryBufferRef Data, LLVMContext &Ctx,
                  StringRef ToolName);
 
-bool isReduced(ReducerWorkItem &M, const TestRunner &Test) {
+bool isReduced(const ReducerWorkItem &M, const TestRunner &Test) {
   const bool UseBitcode = Test.inputIsBitcode() || TmpFilesAsBitcode;
 
   SmallString<128> CurrentFilepath;
@@ -188,10 +188,10 @@ CheckChunk(const Chunk &ChunkToCheckForUninterestingness,
 }
 
 static SmallString<0> ProcessChunkFromSerializedBitcode(
-    Chunk &ChunkToCheckForUninterestingness, TestRunner &Test,
-    ReductionFunc ExtractChunksFromModule, DenseSet<Chunk> &UninterestingChunks,
-    std::vector<Chunk> &ChunksStillConsideredInteresting,
-    SmallString<0> &OriginalBC, std::atomic<bool> &AnyReduced) {
+  const Chunk &ChunkToCheckForUninterestingness, const TestRunner &Test,
+    ReductionFunc ExtractChunksFromModule, const DenseSet<Chunk> &UninterestingChunks,
+    const std::vector<Chunk> &ChunksStillConsideredInteresting,
+    const SmallString<0> &OriginalBC, std::atomic<bool> &AnyReduced) {
   LLVMContext Ctx;
   auto CloneMMM = std::make_unique<ReducerWorkItem>();
   MemoryBufferRef Data(StringRef(OriginalBC), "<bc file>");
index 07a04a6..51371f9 100644 (file)
@@ -101,7 +101,7 @@ static cl::opt<int>
 
 static codegen::RegisterCodeGenFlags CGF;
 
-bool isReduced(ReducerWorkItem &M, const TestRunner &Test);
+bool isReduced(const ReducerWorkItem &M, const TestRunner &Test);
 
 /// Turn off crash debugging features
 ///