mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[Kaleidoscope] Fix static global ordering to prevent crash on exit.
If TheModule is declared before LLVMContext then it will be destructed after it, crashing when it tries to deregister itself from the destructed context. llvm-svn: 270381
This commit is contained in:
parent
6d1bf65d77
commit
c2f93ebd16
@ -388,9 +388,9 @@ static std::unique_ptr<PrototypeAST> ParseExtern() {
|
||||
// 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) {
|
||||
|
@ -397,9 +397,9 @@ static std::unique_ptr<PrototypeAST> ParseExtern() {
|
||||
// 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;
|
||||
|
@ -522,9 +522,9 @@ static std::unique_ptr<PrototypeAST> ParseExtern() {
|
||||
// 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;
|
||||
|
@ -613,9 +613,9 @@ static std::unique_ptr<PrototypeAST> ParseExtern() {
|
||||
// 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;
|
||||
|
@ -684,9 +684,9 @@ static std::unique_ptr<PrototypeAST> ParseExtern() {
|
||||
// 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user