Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions llvm/tools/bugpoint/BugDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
#include <memory>
using namespace llvm;

namespace llvm {
Triple TargetTriple;
}
Triple llvm::TargetTriple;

DiscardTemp::~DiscardTemp() {
if (SaveTemps) {
Expand All @@ -41,18 +39,14 @@ DiscardTemp::~DiscardTemp() {
errs() << "Failed to delete temp file " << toString(std::move(E)) << '\n';
}

// Anonymous namespace to define command line options for debugging.
//
namespace {
// Output - The user can specify a file containing the expected output of the
// program. If this filename is set, it is used as the reference diff source,
// otherwise the raw input run through an interpreter is used as the reference
// source.
//
cl::opt<std::string> OutputFile("output",
cl::desc("Specify a reference program output "
"(for miscompilation detection)"));
}
static cl::opt<std::string>
OutputFile("output", cl::desc("Specify a reference program output "
"(for miscompilation detection)"));

/// If we reduce or update the program somehow, call this method to update
/// bugdriver with it. This deletes the old module and sets the specified one
Expand Down Expand Up @@ -238,7 +232,7 @@ Error BugDriver::run() {
return Error::success();
}

void llvm::PrintFunctionList(const std::vector<Function *> &Funcs) {
void llvm::printFunctionList(const std::vector<Function *> &Funcs) {
unsigned NumPrint = Funcs.size();
if (NumPrint > 10)
NumPrint = 10;
Expand All @@ -249,7 +243,7 @@ void llvm::PrintFunctionList(const std::vector<Function *> &Funcs) {
outs().flush();
}

void llvm::PrintGlobalVariableList(const std::vector<GlobalVariable *> &GVs) {
void llvm::printGlobalVariableList(const std::vector<GlobalVariable *> &GVs) {
unsigned NumPrint = GVs.size();
if (NumPrint > 10)
NumPrint = 10;
Expand Down
37 changes: 13 additions & 24 deletions llvm/tools/bugpoint/BugDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class BugDriver {

// FIXME: sort out public/private distinctions...
friend class ReducePassList;
friend class ReduceMisCodegenFunctions;

public:
BugDriver(const char *toolname, bool find_bugs, unsigned timeout,
Expand All @@ -76,7 +75,7 @@ class BugDriver {
void setPassesToRun(const std::vector<std::string> &PTR) {
PassesToRun = PTR;
}
const std::vector<std::string> &getPassesToRun() const { return PassesToRun; }
ArrayRef<std::string> getPassesToRun() const { return PassesToRun; }

/// run - The top level method that is invoked after all of the instance
/// variables are set up from command line arguments. The \p as_child argument
Expand Down Expand Up @@ -111,7 +110,6 @@ class BugDriver {
Error debugCodeGenerator();

/// isExecutingJIT - Returns true if bugpoint is currently testing the JIT
///
bool isExecutingJIT();

Module &getProgram() const { return *Program; }
Expand Down Expand Up @@ -167,7 +165,7 @@ class BugDriver {
bool RemoveBitcode = false) const;

/// This function is used to output M to a file named "bugpoint-ID.bc".
void EmitProgressBitcode(const Module &M, const std::string &ID,
void emitProgressBitcode(const Module &M, const std::string &ID,
bool NoFlyer = false) const;

/// This method clones the current Program and deletes the specified
Expand Down Expand Up @@ -214,7 +212,6 @@ class BugDriver {
/// outs() a single line message indicating whether compilation was successful
/// or failed, unless Quiet is set. ExtraArgs specifies additional arguments
/// to pass to the child bugpoint instance.
///
bool runPasses(Module &Program, const std::vector<std::string> &PassesToRun,
std::string &OutputFilename, bool DeleteOutput = false,
bool Quiet = false,
Expand All @@ -223,7 +220,6 @@ class BugDriver {
/// runPasses - Just like the method above, but this just returns true or
/// false indicating whether or not the optimizer crashed on the specified
/// input (true = crashed). Does not produce any output.
///
bool runPasses(Module &M, const std::vector<std::string> &PassesToRun) const {
std::string Filename;
return runPasses(M, PassesToRun, Filename, true);
Expand All @@ -247,7 +243,6 @@ class BugDriver {
private:
/// initializeExecutionEnvironment - This method is used to set up the
/// environment for executing LLVM programs.
///
Error initializeExecutionEnvironment();
};

Expand All @@ -258,37 +253,31 @@ struct DiscardTemp {

/// Given a bitcode or assembly input filename, parse and return it, or return
/// null if not possible.
///
std::unique_ptr<Module> parseInputFile(StringRef InputFilename,
LLVMContext &ctxt);

/// getPassesString - Turn a list of passes into a string which indicates the
/// command line options that must be passed to add the passes.
///
std::string getPassesString(const std::vector<std::string> &Passes);

/// PrintFunctionList - prints out list of problematic functions
///
void PrintFunctionList(const std::vector<Function *> &Funcs);
/// Prints out list of problematic functions
void printFunctionList(const std::vector<Function *> &Funcs);

/// PrintGlobalVariableList - prints out list of problematic global variables
///
void PrintGlobalVariableList(const std::vector<GlobalVariable *> &GVs);
/// Prints out list of problematic global variables
void printGlobalVariableList(const std::vector<GlobalVariable *> &GVs);

// DeleteGlobalInitializer - "Remove" the global variable by deleting its
// initializer, making it external.
//
void DeleteGlobalInitializer(GlobalVariable *GV);
/// "Remove" the global variable by deleting its initializer, making it
/// external.
void deleteGlobalInitializer(GlobalVariable *GV);

// DeleteFunctionBody - "Remove" the function by deleting all of it's basic
// blocks, making it external.
//
void DeleteFunctionBody(Function *F);
/// "Remove" the function by deleting all of it's basic blocks, making it
/// external.
void deleteFunctionBody(Function *F);

/// Given a module and a list of functions in the module, split the functions
/// OUT of the specified module, and place them in the new module.
std::unique_ptr<Module>
SplitFunctionsOutOfModule(Module *M, const std::vector<Function *> &F,
splitFunctionsOutOfModule(Module *M, const std::vector<Function *> &F,
ValueToValueMapTy &VMap);

} // End llvm namespace
Expand Down
Loading