[PATCH] D58996: [Remarks] Refactor remark diagnostic emission in a RemarkStreamer

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 15:39:12 PST 2019


JDevlieghere requested changes to this revision.
JDevlieghere added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/CodeGen/CodeGenAction.cpp:279
 
-        Ctx.setDiagnosticsOutputFile(
-            llvm::make_unique<yaml::Output>(OptRecordFile->os()));
+        Ctx.setRemarkStreamer(CodeGenOpts.OptRecordFile, OptRecordFile->os());
 
----------------
This doesn't seem to "set a remark streamer", but rather create one. Shouldn't the method name reflect that, maybe something like `createRemarkStreamer`? Or is this a pattern used in the LLVMContext?


================
Comment at: llvm/include/llvm/IR/LLVMContext.h:258
+  /// for each diagnostic message.
+  void setRemarkStreamer(StringRef Filename, raw_ostream &OS);
 
----------------
You should probably mention that if a RemarkStreamer is set, it will be replaced.


================
Comment at: llvm/include/llvm/IR/RemarkStreamer.h:1
+//===- llvm/IR/RemarkStreamer.h - Remark Streamer ---------------*- C++ -*-===//
+//
----------------
Old license


================
Comment at: llvm/lib/IR/RemarkStreamer.cpp:1
+//===- llvm/IR/RemarkStreamer.cpp - Remark Streamer -*- C++ -------------*-===//
+//
----------------
Old license


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58996/new/

https://reviews.llvm.org/D58996





More information about the llvm-commits mailing list