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
5 changes: 5 additions & 0 deletions llvm/tools/bugpoint/BugDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define LLVM_TOOLS_BUGPOINT_BUGDRIVER_H

#include "llvm/IR/ValueMap.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
Expand All @@ -41,6 +42,10 @@ extern bool DisableSimplifyCFG;
///
extern bool BugpointIsInterrupted;

/// Command line options used across files.
extern cl::list<std::string> InputArgv;
extern cl::opt<std::string> OutputPrefix;

class BugDriver {
LLVMContext &Context;
const char *ToolName; // argv[0] of bugpoint
Expand Down
4 changes: 1 addition & 3 deletions llvm/tools/bugpoint/CrashDebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ static bool isValidModule(std::unique_ptr<Module> &M,
return false;
}

namespace llvm {
// Note this class needs to be in llvm namespace since its declared as a friend
// of BugDriver.
class ReducePassList : public ListReducer<std::string> {
class llvm::ReducePassList : public ListReducer<std::string> {
BugDriver &BD;

public:
Expand All @@ -102,7 +101,6 @@ class ReducePassList : public ListReducer<std::string> {
Expected<TestResult> doTest(std::vector<std::string> &Removed,
std::vector<std::string> &Kept) override;
};
} // namespace llvm

Expected<ReducePassList::TestResult>
ReducePassList::doTest(std::vector<std::string> &Prefix,
Expand Down
17 changes: 7 additions & 10 deletions llvm/tools/bugpoint/ExecutionDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include "BugDriver.h"
#include "ToolRunner.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/Program.h"
Expand Down Expand Up @@ -102,15 +101,13 @@ static cl::opt<std::string> CustomExecCommand(

// Anything specified after the --args option are taken as arguments to the
// program being debugged.
namespace llvm {
cl::list<std::string> InputArgv("args", cl::Positional,
cl::desc("<program arguments>..."),
cl::PositionalEatsArgs);

cl::opt<std::string>
OutputPrefix("output-prefix", cl::init("bugpoint"),
cl::desc("Prefix to use for outputs (default: 'bugpoint')"));
} // namespace llvm
cl::list<std::string> llvm::InputArgv("args", cl::Positional,
cl::desc("<program arguments>..."),
cl::PositionalEatsArgs);

cl::opt<std::string> llvm::OutputPrefix(
"output-prefix", cl::init("bugpoint"),
cl::desc("Prefix to use for outputs (default: 'bugpoint')"));

static cl::list<std::string> ToolArgv("tool-args", cl::Positional,
cl::desc("<tool arguments>..."),
Expand Down
3 changes: 0 additions & 3 deletions llvm/tools/bugpoint/ExtractFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ using namespace llvm;
#define DEBUG_TYPE "bugpoint"

bool llvm::DisableSimplifyCFG = false;
namespace llvm {
extern cl::opt<std::string> OutputPrefix;
} // namespace llvm

static cl::opt<bool>
NoDCE("disable-dce",
Expand Down
5 changes: 0 additions & 5 deletions llvm/tools/bugpoint/Miscompilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@

using namespace llvm;

namespace llvm {
extern cl::opt<std::string> OutputPrefix;
extern cl::list<std::string> InputArgv;
} // end namespace llvm

static cl::opt<bool> DisableLoopExtraction(
"disable-loop-extraction",
cl::desc("Don't extract loops when searching for miscompilations"),
Expand Down
4 changes: 0 additions & 4 deletions llvm/tools/bugpoint/OptimizerDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ using namespace llvm;

#define DEBUG_TYPE "bugpoint"

namespace llvm {
extern cl::opt<std::string> OutputPrefix;
}

static cl::opt<std::string>
OptCmd("opt-command", cl::init(""),
cl::desc("Path to opt. (default: search path "
Expand Down