[all-commits] [llvm/llvm-project] 1c829c: [clang][codegen] Set CurLinkModule in CodeGenActio...

inglorion via All-commits all-commits at lists.llvm.org
Tue Aug 24 14:29:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c829ce1e3627cf9b22da33943dc2e423ded11c4
      https://github.com/llvm/llvm-project/commit/1c829ce1e3627cf9b22da33943dc2e423ded11c4
  Author: Bob Haarman <llvm at inglorion.net>
  Date:   2021-08-24 (Tue, 24 Aug 2021)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticFrontendKinds.td
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/lib/CodeGen/CodeGenAction.cpp
    A clang/test/CodeGen/Inputs/linker-diagnostic1.ll
    A clang/test/CodeGen/linker-diagnostic.ll
    M clang/test/Misc/serialized-diags-driver.c

  Log Message:
  -----------
  [clang][codegen] Set CurLinkModule in CodeGenAction::ExecuteAction

CodeGenAction::ExecuteAction creates a BackendConsumer for the
purpose of handling diagnostics. The BackendConsumer's
DiagnosticHandlerImpl method expects CurLinkModule to be set,
but this did not happen on the code path that goes through
ExecuteAction. This change makes it so that the BackendConsumer
constructor used by ExecuteAction requires the Module to be
specified and passes the appropriate module in ExecuteAction.

The change also adds a test that fails without this change
and passes with it. To make the test work, the FIXME in the
handling of DK_Linker diagnostics was addressed so that warnings
and notes are no longer silently discarded. Since this introduces
a new warning diagnostic, a flag to control it (-Wlinker-warnings)
has also been added.

Reviewed By: xur

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




More information about the All-commits mailing list