If TheModule is declared before LLVMContext then it will be destructed after it,
crashing when it tries to deregister itself from the destructed context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270381
91177308-0d34-0410-b5e6-
96231b3b80d8
// Code Generation
//===----------------------------------------------------------------------===//
-static std::unique_ptr<Module> TheModule;
static LLVMContext TheContext;
static IRBuilder<> Builder(TheContext);
+static std::unique_ptr<Module> TheModule;
static std::map<std::string, Value *> NamedValues;
Value *LogErrorV(const char *Str) {
// Code Generation
//===----------------------------------------------------------------------===//
-static std::unique_ptr<Module> TheModule;
static LLVMContext TheContext;
static IRBuilder<> Builder(TheContext);
+static std::unique_ptr<Module> TheModule;
static std::map<std::string, Value *> NamedValues;
static std::unique_ptr<legacy::FunctionPassManager> TheFPM;
static std::unique_ptr<KaleidoscopeJIT> TheJIT;
// Code Generation
//===----------------------------------------------------------------------===//
-static std::unique_ptr<Module> TheModule;
static LLVMContext TheContext;
static IRBuilder<> Builder(TheContext);
+static std::unique_ptr<Module> TheModule;
static std::map<std::string, Value *> NamedValues;
static std::unique_ptr<legacy::FunctionPassManager> TheFPM;
static std::unique_ptr<KaleidoscopeJIT> TheJIT;
// Code Generation
//===----------------------------------------------------------------------===//
-static std::unique_ptr<Module> TheModule;
static LLVMContext TheContext;
static IRBuilder<> Builder(TheContext);
+static std::unique_ptr<Module> TheModule;
static std::map<std::string, Value *> NamedValues;
static std::unique_ptr<legacy::FunctionPassManager> TheFPM;
static std::unique_ptr<KaleidoscopeJIT> TheJIT;
// Code Generation
//===----------------------------------------------------------------------===//
-static std::unique_ptr<Module> TheModule;
static LLVMContext TheContext;
static IRBuilder<> Builder(TheContext);
+static std::unique_ptr<Module> TheModule;
static std::map<std::string, AllocaInst *> NamedValues;
static std::unique_ptr<legacy::FunctionPassManager> TheFPM;
static std::unique_ptr<KaleidoscopeJIT> TheJIT;