Skip to content

Commit 512079e

Browse files
Stefan Telemanvjayathirtha-nv
authored andcommitted
Port to AArch64. Initial source code checkin from Cavium.
1 parent 2525eb2 commit 512079e

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
@@ -1033,10 +1033,37 @@ void CodeGenAction::ExecuteAction() {
10331033
Ctx.setInlineAsmDiagnosticHandler(BitcodeInlineAsmDiagHandler,
10341034
&CI.getDiagnostics());
10351035

1036+
const CodeGenOptions &CodeGenOpts = CI.getCodeGenOpts();
1037+
DiagnosticsEngine &Diags = CI.getDiagnostics();
1038+
std::unique_ptr<llvm::ToolOutputFile> OptRecordFile;
1039+
1040+
if (!CodeGenOpts.OptRecordFile.empty()) {
1041+
std::error_code EC;
1042+
OptRecordFile =
1043+
llvm::make_unique<llvm::ToolOutputFile>(CodeGenOpts.OptRecordFile,
1044+
EC, sys::fs::F_None);
1045+
1046+
if (EC) {
1047+
Diags.Report(diag::err_cannot_open_file) <<
1048+
CodeGenOpts.OptRecordFile << EC.message();
1049+
return;
1050+
}
1051+
1052+
Ctx.setDiagnosticsOutputFile(
1053+
llvm::make_unique<yaml::Output>(OptRecordFile->os()));
1054+
1055+
if (CodeGenOpts.getProfileUse() != CodeGenOptions::ProfileNone)
1056+
Ctx.setDiagnosticsHotnessRequested(true);
1057+
}
1058+
10361059
EmitBackendOutput(CI.getDiagnostics(), CI.getHeaderSearchOpts(),
10371060
CI.getCodeGenOpts(), TargetOpts, CI.getLangOpts(),
10381061
CI.getTarget().getDataLayout(), TheModule.get(), BA,
10391062
std::move(OS));
1063+
1064+
if (OptRecordFile)
1065+
OptRecordFile->keep();
1066+
10401067
return;
10411068
}
10421069

0 commit comments

Comments
 (0)