summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-stress/llvm-stress.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-stress/llvm-stress.cpp')
-rw-r--r--llvm/tools/llvm-stress/llvm-stress.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvm-stress/llvm-stress.cpp b/llvm/tools/llvm-stress/llvm-stress.cpp
index 99d2afdcd30..d4549e5d95e 100644
--- a/llvm/tools/llvm-stress/llvm-stress.cpp
+++ b/llvm/tools/llvm-stress/llvm-stress.cpp
@@ -43,6 +43,8 @@ static cl::opt<std::string>
OutputFilename("o", cl::desc("Override output filename"),
cl::value_desc("filename"));
+static LLVMContext Context;
+
namespace cl {
template <> class parser<Type*> final : public basic_parser<Type*> {
public:
@@ -50,7 +52,6 @@ public:
// Parse options as IR types. Return true on error.
bool parse(Option &O, StringRef, StringRef Arg, Type *&Value) {
- auto &Context = getGlobalContext();
if (Arg == "half") Value = Type::getHalfTy(Context);
else if (Arg == "fp128") Value = Type::getFP128Ty(Context);
else if (Arg == "x86_fp80") Value = Type::getX86_FP80Ty(Context);
@@ -687,7 +688,7 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, "llvm codegen stress-tester\n");
llvm_shutdown_obj Y;
- auto M = make_unique<Module>("/tmp/autogen.bc", getGlobalContext());
+ auto M = make_unique<Module>("/tmp/autogen.bc", Context);
Function *F = GenEmptyFunction(M.get());
// Pick an initial seed value
OpenPOWER on IntegriCloud