mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #84622 from gottesmm/pr-7065a633780e3a54b56563650e321ec0801bcb45
[sil-llvm-gen] Run Sema before we attempt to emit IR.
This commit is contained in:
@@ -469,6 +469,15 @@ int sil_llvm_gen_main(ArrayRef<const char *> argv, void *MainAddr) {
|
||||
desc.out = &outFile->getOS();
|
||||
|
||||
if (options.OutputKind == IRGenOutputKind::LLVMAssemblyBeforeOptimization) {
|
||||
// We need to perform Sema here since IRGenRequest itself does not perform
|
||||
// Sema (unlike OptimizedIRRequest).
|
||||
CI.performSema();
|
||||
|
||||
// If Sema produced an error, exit early.
|
||||
bool HadError = CI.getASTContext().hadError();
|
||||
if (HadError)
|
||||
exit(-1);
|
||||
|
||||
auto generatedMod = evaluateOrFatal(eval, IRGenRequest{desc});
|
||||
if (!generatedMod)
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user