llvm.org GIT mirror llvm / 494d663
Make sure targets are initialized before we do anything, even command line processing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75888 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 10 years ago
2 changed file(s) with 9 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
209209 PrettyStackTraceProgram X(argc, argv);
210210 LLVMContext &Context = getGlobalContext();
211211 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
212 cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
213
212
213 // Initialize targets first.
214214 InitializeAllTargets();
215215 InitializeAllAsmPrinters();
216
217 cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
216218
217219 // Load the module to be compiled...
218220 std::string ErrorMessage;
9595
9696 LLVMContext &Context = getGlobalContext();
9797 atexit(do_shutdown); // Call llvm_shutdown() on exit.
98
99 // If we have a native target, initialize it to ensure it is linked in and
100 // usable by the JIT.
101 InitializeNativeTarget();
102
98103 cl::ParseCommandLineOptions(argc, argv,
99104 "llvm interpreter & dynamic compiler\n");
100105
141146 case '3': OLvl = CodeGenOpt::Aggressive; break;
142147 }
143148
144 // If we have a native target, initialize it to ensure it is linked in and
145 // usable by the JIT.
146 InitializeNativeTarget();
147
148149 EE = ExecutionEngine::create(MP, ForceInterpreter, &ErrorMsg, OLvl);
149150 if (!EE) {
150151 if (!ErrorMsg.empty())