Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/DriverTool/sil_llvm_gen_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,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;
Expand Down