[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
Fri Sep 8 10:21:18 PDT 2017


anemet added a comment.

Please clean this up as well (don't have commented-out lines) so that it's ready to go with the LLVM patch.



================
Comment at: lib/CodeGen/CodeGenAction.cpp:302-305
     static void DiagnosticHandler(const llvm::DiagnosticInfo &DI,
                                   void *Context) {
       ((BackendConsumer *)Context)->DiagnosticHandlerImpl(DI);
     }
----------------
Remove this.


================
Comment at: lib/CodeGen/CodeGenAction.cpp:761
+public:
+  ClangDiagnosticHandler(const CodeGenOptions &CGOpts, void *DiagContext)
+      : DiagnosticHandler(DiagContext), CodeGenOpts(CGOpts) {}
----------------
Again don't overload DiagContext as such.  Have a dedicated field for the BackendConsumer.


================
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
----------------
Any reason you moved where we set this up?


https://reviews.llvm.org/D37196





More information about the cfe-commits mailing list