[PATCH] D37196: [Clang] Bug 32352 - Provide a way for OptimizationRemarkEmitter::allowExtraAnalysis to check if (specific) remarks are enabled

Adam Nemet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 11 21:50:29 PDT 2017


anemet added inline comments.


================
Comment at: lib/CodeGen/CodeGenAction.cpp:882-883
   BEConsumer = Result.get();
-
+  VMContext->setDiagnosticHandler(llvm::make_unique<ClangDiagnosticHandler>(
+      CI.getCodeGenOpts(), Result.get()));
   // Enable generating macro debug info only when debug info is not disabled and
----------------
vivekvpandya wrote:
> anemet wrote:
> > Any reason you moved where we set this up?
>  
> 
>   #  At older place I was not able to define ClangDiagnosticHandler class as it will require definition of BackendComsumer and vice versa.
>   # and this seems to be appropriate place to create and tie DiagnosticHandler to LLVMContext
> 
>  
> But I am not sure about why old diagnostic handler was tied back to  context that is why I wanted someone from clang to look at this.
> 
> 
> At older place I was not able to define ClangDiagnosticHandler class as it will require definition of BackendComsumer and vice versa.

Why?  That was inside BackendConsumer.

> But I am not sure about why old diagnostic handler was tied back to context that is why I wanted someone from clang to look at this.

You can just save the old DiagHandler object instead.




https://reviews.llvm.org/D37196





More information about the cfe-commits mailing list