[all-commits] [llvm/llvm-project] e72cdc: [clang][cli] NFC: Ensure non-null DiagnosticsEngin...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Thu Jan 7 05:19:51 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e72cdc5ba1e65ecd8632663b6604eb9be8d1a162
      https://github.com/llvm/llvm-project/commit/e72cdc5ba1e65ecd8632663b6604eb9be8d1a162
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-01-07 (Thu, 07 Jan 2021)

  Changed paths:
    M clang/lib/Frontend/CompilerInvocation.cpp

  Log Message:
  -----------
  [clang][cli] NFC: Ensure non-null DiagnosticsEngine in ParseDiagnosticArgs

Before this patch, ParseDiagnosticArgs can be called with a nullptr DiagnosticsEngine *. This happens early on in the compilation process, where no proper DiagnosticEngine exists, because the diagnostic options (passed through command line) are not known yet.

This patch ensures nullptr is replaced by an ignoring DiagnosticEngine in ParseDiagnosticArgs, which allows to switch from pointer to a reference in some utility functions.

Besides simplifying the code, this patch enables a future patch (D84673) that ports diagnostic options to the new marshalling infrastructure.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D93701


  Commit: 75d63630ebb197c338801d6b100ae2e06800c4ce
      https://github.com/llvm/llvm-project/commit/75d63630ebb197c338801d6b100ae2e06800c4ce
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-01-07 (Thu, 07 Jan 2021)

  Changed paths:
    M clang/lib/Frontend/CompilerInvocation.cpp

  Log Message:
  -----------
  [clang][cli] NFC: Move parseSimpleArgs

This patch moves `parseSimpleArgs` closer to `ParseDiagnosticArgs` so that sharing the parsing macro between them can be done more locally in a future patch.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D94172


Compare: https://github.com/llvm/llvm-project/compare/c1d58c2b0023...75d63630ebb1


More information about the All-commits mailing list