diff options
| author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-06-17 16:06:00 +0000 |
|---|---|---|
| committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-06-17 16:06:00 +0000 |
| commit | 34667519dc199d58b4556cfdc4e3ecb04365e53e (patch) | |
| tree | bdfc15117967634c7f53fce1020b3910baadfc40 /clang/lib/CodeGen | |
| parent | 77bc3b65424afc42031a0859c91154acdc54feaa (diff) | |
| download | bcm5719-llvm-34667519dc199d58b4556cfdc4e3ecb04365e53e.tar.gz bcm5719-llvm-34667519dc199d58b4556cfdc4e3ecb04365e53e.zip | |
[Remarks] Extend -fsave-optimization-record to specify the format
Use -fsave-optimization-record=<format> to specify a different format
than the default, which is YAML.
For now, only YAML is supported.
llvm-svn: 363573
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 1 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 46b075ff126..2a904d54346 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -1428,6 +1428,7 @@ static void runThinLTOBackend(ModuleSummaryIndex *CombinedIndex, Module *M, Conf.RemarksWithHotness = CGOpts.DiagnosticsWithHotness; Conf.RemarksFilename = CGOpts.OptRecordFile; Conf.RemarksPasses = CGOpts.OptRecordPasses; + Conf.RemarksFormat = CGOpts.OptRecordFormat; Conf.SplitDwarfFile = CGOpts.SplitDwarfFile; Conf.SplitDwarfOutput = CGOpts.SplitDwarfOutput; switch (Action) { diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index e8022c0e637..0ae9ea427d6 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -266,6 +266,7 @@ namespace clang { Expected<std::unique_ptr<llvm::ToolOutputFile>> OptRecordFileOrErr = setupOptimizationRemarks(Ctx, CodeGenOpts.OptRecordFile, CodeGenOpts.OptRecordPasses, + CodeGenOpts.OptRecordFormat, CodeGenOpts.DiagnosticsWithHotness, CodeGenOpts.DiagnosticsHotnessThreshold); @@ -279,6 +280,10 @@ namespace clang { [&](const RemarkSetupPatternError &E) { Diags.Report(diag::err_drv_optimization_remark_pattern) << E.message() << CodeGenOpts.OptRecordPasses; + }, + [&](const RemarkSetupFormatError &E) { + Diags.Report(diag::err_drv_optimization_remark_format) + << CodeGenOpts.OptRecordFormat; }); return; } |

