#include "Delta.h"
#include "llvm/ADT/STLExtras.h"
+using namespace llvm;
+
/// Writes IR code to the given Filepath
static bool writeProgramToFile(StringRef Filepath, int FD, const Module &M) {
ToolOutputFile Out(Filepath, FD);
if (ReducedProgram)
Test.setProgram(std::move(ReducedProgram));
errs() << "Couldn't increase anymore.\n";
-}
\ No newline at end of file
+}
#include <set>
#include <vector>
-using namespace llvm;
+namespace llvm {
struct Chunk {
unsigned begin;
}
};
-namespace llvm {
-
/// This function implements the Delta Debugging algorithm, it receives a
/// number of Targets (e.g. Functions, Instructions, Basic Blocks, etc.) and
/// splits them in half; these chunks of targets are then tested while ignoring
//===----------------------------------------------------------------------===//
#include "ReduceFunctions.h"
+#include "Delta.h"
+
+using namespace llvm;
/// Removes all the Defined Functions (as well as their calls)
/// that aren't inside any of the desired Chunks.
unsigned Functions = countFunctions(Test.getProgram());
runDeltaPass(Test, Functions, extractFunctionsFromModule);
errs() << "----------------------------\n";
-}
\ No newline at end of file
+}
#include "ReduceGlobalVars.h"
+using namespace llvm;
+
/// Removes all the Initialized GVs that aren't inside the desired Chunks.
static void extractGVsFromModule(std::vector<Chunk> ChunksToKeep,
Module *Program) {