From: Francis Visoiu Mistrih Date: Wed, 6 Mar 2019 14:32:08 +0000 (+0000) Subject: [Remarks] Refactor remark diagnostic emission in a RemarkStreamer X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=007c2359d05ddef1fe74c5e94e6a454ef8f415d3;p=clang [Remarks] Refactor remark diagnostic emission in a RemarkStreamer This allows us to store more info about where we're emitting the remarks without cluttering LLVMContext. This is needed for future support for the remark section. Differential Revision: https://reviews.llvm.org/D58996 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355507 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index 0b631f72e6..f59adcd3fb 100644 --- a/lib/CodeGen/CodeGenAction.cpp +++ b/lib/CodeGen/CodeGenAction.cpp @@ -30,6 +30,7 @@ #include "llvm/IR/GlobalValue.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" +#include "llvm/IR/RemarkStreamer.h" #include "llvm/IRReader/IRReader.h" #include "llvm/Linker/Linker.h" #include "llvm/Pass.h" @@ -276,8 +277,8 @@ namespace clang { return; } - Ctx.setDiagnosticsOutputFile( - llvm::make_unique(OptRecordFile->os())); + Ctx.setRemarkStreamer(llvm::make_unique( + CodeGenOpts.OptRecordFile, OptRecordFile->os())); if (CodeGenOpts.getProfileUse() != CodeGenOptions::ProfileNone) Ctx.setDiagnosticsHotnessRequested(true);