Reapply "[NFC][bugpoint] Namespace cleanup in bugpoint" (#168961) (#169055)

This reverts commit b83e458fe5.

Also undo the use of namespace qualifier for `ReducePassList` as that
seems to cause build failures.
This commit is contained in:
Rahul Joshi
2025-11-24 10:19:15 -08:00
committed by GitHub
parent 621cbcde01
commit a27bb38ee6
5 changed files with 11 additions and 21 deletions

View File

@@ -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"
@@ -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

View File

@@ -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"
@@ -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::list<std::string> llvm::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::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>..."),

View File

@@ -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",

View File

@@ -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"),

View File

@@ -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 "