Skip to content

Commit 4cd0029

Browse files
authored
Merge pull request #19 from flang-cavium/release_60
Port to AArch64. Initial source code checkin from Cavium.
2 parents e079fa6 + 91b46b7 commit 4cd0029

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

lib/CodeGen/CodeGenAction.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,10 +1020,37 @@ void CodeGenAction::ExecuteAction() {
10201020
Ctx.setInlineAsmDiagnosticHandler(BitcodeInlineAsmDiagHandler,
10211021
&CI.getDiagnostics());
10221022

1023+
const CodeGenOptions &CodeGenOpts = CI.getCodeGenOpts();
1024+
DiagnosticsEngine &Diags = CI.getDiagnostics();
1025+
std::unique_ptr<llvm::ToolOutputFile> OptRecordFile;
1026+
1027+
if (!CodeGenOpts.OptRecordFile.empty()) {
1028+
std::error_code EC;
1029+
OptRecordFile =
1030+
llvm::make_unique<llvm::ToolOutputFile>(CodeGenOpts.OptRecordFile,
1031+
EC, sys::fs::F_None);
1032+
1033+
if (EC) {
1034+
Diags.Report(diag::err_cannot_open_file) <<
1035+
CodeGenOpts.OptRecordFile << EC.message();
1036+
return;
1037+
}
1038+
1039+
Ctx.setDiagnosticsOutputFile(
1040+
llvm::make_unique<yaml::Output>(OptRecordFile->os()));
1041+
1042+
if (CodeGenOpts.getProfileUse() != CodeGenOptions::ProfileNone)
1043+
Ctx.setDiagnosticsHotnessRequested(true);
1044+
}
1045+
10231046
EmitBackendOutput(CI.getDiagnostics(), CI.getHeaderSearchOpts(),
10241047
CI.getCodeGenOpts(), TargetOpts, CI.getLangOpts(),
10251048
CI.getTarget().getDataLayout(), TheModule.get(), BA,
10261049
std::move(OS));
1050+
1051+
if (OptRecordFile)
1052+
OptRecordFile->keep();
1053+
10271054
return;
10281055
}
10291056

0 commit comments

Comments
 (0)