llvm-mirror/tools/llvm-reduce/deltas/RemoveFunctions.h
Diego Trevino Ferrer 72f0bd49ad Added Delta IR Reduction Tool
Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

> llvm-svn: 368071

llvm-svn: 368112
2019-08-07 00:00:52 +00:00

29 lines
988 B
C++

//===- llvm-reduce.cpp - The LLVM Delta Reduction utility -----------------===//
//
// 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 is a Specialized Delta Pass, which removes the functions that are
// not in the provided function-chunks.
//
//===----------------------------------------------------------------------===//
#include "Delta.h"
#include "llvm/Transforms/Utils/Cloning.h"
namespace llvm {
class RemoveFunctions {
public:
/// Outputs the number of Functions in the given Module
static int getTargetCount(Module *Program);
/// Clones module and returns it with chunk functions only
static std::unique_ptr<Module>
extractChunksFromModule(std::vector<Chunk> ChunksToKeep, Module *Program);
};
} // namespace llvm