]> granicus.if.org Git - llvm/commitdiff
Added Tool as Dependency to tests & fixed warnings
authorDiego Trevino Ferrer <diegof30@gmail.com>
Wed, 7 Aug 2019 01:51:56 +0000 (01:51 +0000)
committerDiego Trevino Ferrer <diegof30@gmail.com>
Wed, 7 Aug 2019 01:51:56 +0000 (01:51 +0000)
Summary: Fixes http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/14002 and http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/35392/steps/build_Lld/logs/stdio

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368117 91177308-0d34-0410-b5e6-96231b3b80d8

test/CMakeLists.txt
tools/llvm-reduce/deltas/Delta.cpp
tools/llvm-reduce/deltas/Delta.h
tools/llvm-reduce/deltas/RemoveFunctions.cpp
tools/llvm-reduce/deltas/RemoveGlobalVars.cpp

index 03d154e39d02b064b9ec9321e46688a0ed8f3a47..a409cd31af54d8410197bdff635a1edd9c0c4e14 100644 (file)
@@ -89,6 +89,7 @@ set(LLVM_TEST_DEPENDS
           llvm-rc
           llvm-readobj
           llvm-readelf
+          llvm-reduce
           llvm-rtdyld
           llvm-size
           llvm-split
index 203b70ef333321125fd8e35b3c8231e4d110fec8..2b0a2ddc84effba84ebde362a85c57f40536f20f 100644 (file)
@@ -85,7 +85,7 @@ static bool increaseGranularity(std::vector<Chunk> &Chunks) {
     if (C.end - C.begin == 0)
       NewChunks.push_back(C);
     else {
-      int Half = (C.begin + C.end) / 2;
+      unsigned Half = (C.begin + C.end) / 2;
       NewChunks.push_back({C.begin, Half});
       NewChunks.push_back({Half + 1, C.end});
       SplitOne = true;
@@ -100,7 +100,7 @@ static bool increaseGranularity(std::vector<Chunk> &Chunks) {
 }
 
 void llvm::runDeltaPass(
-    TestRunner &Test, int Targets,
+    TestRunner &Test, unsigned Targets,
     std::function<std::unique_ptr<Module>(std::vector<Chunk>, Module *)>
         ExtractChunksFromModule) {
   if (!Targets)
index 9c2b61b0a4bd0f2ae8bb284bce22d16dedc76e2a..3c807321967d28672619ef52033362dd4e10d04f 100644 (file)
@@ -28,8 +28,8 @@
 using namespace llvm;
 
 struct Chunk {
-  int begin;
-  int end;
+  unsigned begin;
+  unsigned end;
 
   /// Operator when populating CurrentChunks in Generic Delta Pass
   friend bool operator!=(const Chunk &C1, const Chunk &C2) {
@@ -66,7 +66,7 @@ namespace llvm {
 /// Other implementations of the Delta Debugging algorithm can also be found in
 /// the CReduce, Delta, and Lithium projects.
 void runDeltaPass(
-    TestRunner &Test, int Targets,
+    TestRunner &Test, unsigned Targets,
     std::function<std::unique_ptr<Module>(std::vector<Chunk>, Module *)>
         ExtractChunksFromModule);
 
index e08c7b99f3893fab8bc2322c2e68912b125246a9..bed8e2b792f848c96510ff22e2dcca8d75cab657 100644 (file)
@@ -23,7 +23,7 @@ extractFunctionsFromModule(std::vector<Chunk> ChunksToKeep, Module *Program) {
 
   // Get functions inside desired chunks
   std::set<Function *> FuncsToKeep;
-  int I = 0, FunctionCount = 1;
+  unsigned I = 0, FunctionCount = 1;
   for (auto &F : *Clone) {
     if (!F.isDeclaration() && I < ChunksToKeep.size()) {
       if (FunctionCount >= ChunksToKeep[I].begin &&
index 28d501d4d834203a700d9d2988052d74c25f0294..cd1690739923180d22bebae0b19def6e18a48a60 100644 (file)
@@ -21,7 +21,7 @@ extractGVsFromModule(std::vector<Chunk> ChunksToKeep, Module *Program) {
 
   // Get GVs inside desired chunks
   std::set<GlobalVariable *> GVsToKeep;
-  int I = 0, GVCount = 1;
+  unsigned I = 0, GVCount = 1;
   for (auto &GV : Clone->globals()) {
     if (GV.hasInitializer() && I < ChunksToKeep.size()) {
       if (GVCount >= ChunksToKeep[I].begin && GVCount <= ChunksToKeep[I].end)