Skip to content

Commit b83e458

Browse files
authored
Revert "[NFC][bugpoint] Namespace cleanup in bugpoint" (#168961)
Reverts #168921 Causes build failures.
1 parent bf91a62 commit b83e458

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

llvm/tools/bugpoint/BugDriver.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#define LLVM_TOOLS_BUGPOINT_BUGDRIVER_H
1717

1818
#include "llvm/IR/ValueMap.h"
19-
#include "llvm/Support/CommandLine.h"
2019
#include "llvm/Support/Error.h"
2120
#include "llvm/Support/FileSystem.h"
2221
#include "llvm/Transforms/Utils/ValueMapper.h"
@@ -42,10 +41,6 @@ extern bool DisableSimplifyCFG;
4241
///
4342
extern bool BugpointIsInterrupted;
4443

45-
/// Command line options used across files.
46-
extern cl::list<std::string> InputArgv;
47-
extern cl::opt<std::string> OutputPrefix;
48-
4944
class BugDriver {
5045
LLVMContext &Context;
5146
const char *ToolName; // argv[0] of bugpoint

llvm/tools/bugpoint/CrashDebugger.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ static bool isValidModule(std::unique_ptr<Module> &M,
8787
return false;
8888
}
8989

90+
namespace llvm {
9091
// Note this class needs to be in llvm namespace since its declared as a friend
9192
// of BugDriver.
92-
class llvm::ReducePassList : public ListReducer<std::string> {
93+
class ReducePassList : public ListReducer<std::string> {
9394
BugDriver &BD;
9495

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

105107
Expected<ReducePassList::TestResult>
106108
ReducePassList::doTest(std::vector<std::string> &Prefix,

llvm/tools/bugpoint/ExecutionDriver.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "BugDriver.h"
1515
#include "ToolRunner.h"
16+
#include "llvm/Support/CommandLine.h"
1617
#include "llvm/Support/Debug.h"
1718
#include "llvm/Support/FileUtilities.h"
1819
#include "llvm/Support/Program.h"
@@ -101,13 +102,15 @@ static cl::opt<std::string> CustomExecCommand(
101102

102103
// Anything specified after the --args option are taken as arguments to the
103104
// program being debugged.
104-
cl::list<std::string> llvm::InputArgv("args", cl::Positional,
105-
cl::desc("<program arguments>..."),
106-
cl::PositionalEatsArgs);
107-
108-
cl::opt<std::string> llvm::OutputPrefix(
109-
"output-prefix", cl::init("bugpoint"),
110-
cl::desc("Prefix to use for outputs (default: 'bugpoint')"));
105+
namespace llvm {
106+
cl::list<std::string> InputArgv("args", cl::Positional,
107+
cl::desc("<program arguments>..."),
108+
cl::PositionalEatsArgs);
109+
110+
cl::opt<std::string>
111+
OutputPrefix("output-prefix", cl::init("bugpoint"),
112+
cl::desc("Prefix to use for outputs (default: 'bugpoint')"));
113+
} // namespace llvm
111114

112115
static cl::list<std::string> ToolArgv("tool-args", cl::Positional,
113116
cl::desc("<tool arguments>..."),

llvm/tools/bugpoint/ExtractFunction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ using namespace llvm;
3636
#define DEBUG_TYPE "bugpoint"
3737

3838
bool llvm::DisableSimplifyCFG = false;
39+
namespace llvm {
40+
extern cl::opt<std::string> OutputPrefix;
41+
} // namespace llvm
3942

4043
static cl::opt<bool>
4144
NoDCE("disable-dce",

llvm/tools/bugpoint/Miscompilation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828

2929
using namespace llvm;
3030

31+
namespace llvm {
32+
extern cl::opt<std::string> OutputPrefix;
33+
extern cl::list<std::string> InputArgv;
34+
} // end namespace llvm
35+
3136
static cl::opt<bool> DisableLoopExtraction(
3237
"disable-loop-extraction",
3338
cl::desc("Don't extract loops when searching for miscompilations"),

llvm/tools/bugpoint/OptimizerDriver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ using namespace llvm;
3434

3535
#define DEBUG_TYPE "bugpoint"
3636

37+
namespace llvm {
38+
extern cl::opt<std::string> OutputPrefix;
39+
}
40+
3741
static cl::opt<std::string>
3842
OptCmd("opt-command", cl::init(""),
3943
cl::desc("Path to opt. (default: search path "

0 commit comments

Comments
 (0)