File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -350,6 +350,7 @@ int swift::RunImmediately(CompilerInstance &CI,
350
350
351
351
using MainFnTy = int (*)(int , char *[]);
352
352
353
+ LLVM_DEBUG (llvm::dbgs () << " Running static constructors\n " );
353
354
if (auto Err = JIT->runConstructors ()) {
354
355
llvm::logAllUnhandledErrors (std::move (Err), llvm::errs (), " " );
355
356
return -1 ;
@@ -363,11 +364,14 @@ int swift::RunImmediately(CompilerInstance &CI,
363
364
return -1 ;
364
365
}
365
366
366
- LLVM_DEBUG (llvm::dbgs () << " Running static constructors\n " );
367
- if (auto Err = JIT->runConstructors ()) {
367
+ LLVM_DEBUG (llvm::dbgs () << " Running main\n " );
368
+ int Result = llvm::orc::runAsMain (JITMain, CmdLine);
369
+
370
+ LLVM_DEBUG (llvm::dbgs () << " Running static destructors\n " );
371
+ if (auto Err = JIT->runDestructors ()) {
368
372
logAllUnhandledErrors (std::move (Err), llvm::errs (), " " );
369
373
return -1 ;
370
374
}
371
- LLVM_DEBUG ( llvm::dbgs () << " Running main \n " );
372
- return llvm::orc::runAsMain (JITMain, CmdLine) ;
375
+
376
+ return Result ;
373
377
}
You can’t perform that action at this time.
0 commit comments