vivekvpandya added a comment.

Why? That was inside BackendConsumer.

I was getting incomplete type error.

You can just save the old DiagHandler object instead.
I don't think now we need to do that as per my understanding CodeGen i.e 
emitting LLVM IR is last phase in clang which will pass control to LLVMContext. 
LLVMContext will have Base class of DiagnosticHandler which will not handle 
diagnostic and return false so LLVMContext::diagnose() will print diagnostic 
with

DiagnosticPrinterRawOStream DP(errs());

  errs() << getDiagnosticMessagePrefix(DI.getSeverity()) << ": ";
  DI.print(DP);
  errs() << "\n";

and clang's diagnostic handler also does similar thing so if we keep 
ClangDiagnosticHandler pointer in LLVMContext it should not break.


https://reviews.llvm.org/D37196



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to