[PATCH] D70691: Optimization record for bytecode input missing- PR44000

Zahira Ammarguellat via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 07:30:08 PST 2019


zahiraam added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenAction.cpp:1119
+        CI.setASTConsumer(std::move(Consumer));
+        if (!CI.hasASTConsumer())
+          return;
----------------
craig.topper wrote:
> I don't work in the frontend. Can setASTConsumer fail somehow or would hasASTConsumer always return true.
setASTConsumer can return a nullptr.


================
Comment at: llvm/lib/IR/LLVMContext.cpp:118
+void LLVMContext::
+setBiteCodeDiagnosticHandler(std::unique_ptr<DiagnosticHandler>&&DH, bool RespectFilters)
+{
----------------
craig.topper wrote:
> Why do we need a separate entry point that does the same thing as setDiagnosticHandler?
setDiagnosticHandler calls builds an object of class ClangDiagnosticHandler that is a base class for diagnostic handling in LLVM. 
The handleDiagnostics method must be overriden by the subclasses to handle the diagnistic. For bitecode input, the derived class
doesn't exist. So it needs to be created.


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

https://reviews.llvm.org/D70691





More information about the llvm-commits mailing list