llvm.org GIT mirror llvm / 60e94e8
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270381 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 3 years ago
5 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
387387 // Code Generation
388388 //===----------------------------------------------------------------------===//
389389
390 static std::unique_ptr TheModule;
391390 static LLVMContext TheContext;
392391 static IRBuilder<> Builder(TheContext);
392 static std::unique_ptr TheModule;
393393 static std::map NamedValues;
394394
395395 Value *LogErrorV(const char *Str) {
396396 // Code Generation
397397 //===----------------------------------------------------------------------===//
398398
399 static std::unique_ptr TheModule;
400399 static LLVMContext TheContext;
401400 static IRBuilder<> Builder(TheContext);
401 static std::unique_ptr TheModule;
402402 static std::map NamedValues;
403403 static std::unique_ptr TheFPM;
404404 static std::unique_ptr TheJIT;
521521 // Code Generation
522522 //===----------------------------------------------------------------------===//
523523
524 static std::unique_ptr TheModule;
525524 static LLVMContext TheContext;
526525 static IRBuilder<> Builder(TheContext);
526 static std::unique_ptr TheModule;
527527 static std::map NamedValues;
528528 static std::unique_ptr TheFPM;
529529 static std::unique_ptr TheJIT;
612612 // Code Generation
613613 //===----------------------------------------------------------------------===//
614614
615 static std::unique_ptr TheModule;
616615 static LLVMContext TheContext;
617616 static IRBuilder<> Builder(TheContext);
617 static std::unique_ptr TheModule;
618618 static std::map NamedValues;
619619 static std::unique_ptr TheFPM;
620620 static std::unique_ptr TheJIT;
683683 // Code Generation
684684 //===----------------------------------------------------------------------===//
685685
686 static std::unique_ptr TheModule;
687686 static LLVMContext TheContext;
688687 static IRBuilder<> Builder(TheContext);
688 static std::unique_ptr TheModule;
689689 static std::map NamedValues;
690690 static std::unique_ptr TheFPM;
691691 static std::unique_ptr TheJIT;