[PATCH] D93701: [clang][cli] NFC: Pass an ignoring DiagnosticsEngine instead of nullptr to ParseDiagnosticArgs

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 6 12:41:31 PST 2021


dexonsmith added inline comments.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:1400-1402
 bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
-                                DiagnosticsEngine *Diags,
+                                DiagnosticsEngine &Diags,
                                 bool DefaultDiagColor) {
----------------
Instead of this change (and updating callers), I suggest adding:
```
  Optional<DiagnosticsEngine> IgnoredDiags;
  if (!Diags) {
    IgnoredDiags.emplace(new DiagnosticIDs(), new DiagnosticOptions(),
                         new IgnoringDiagConsumer());
    Diags = &*IgnoredDiags;
  }
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93701



More information about the cfe-commits mailing list