[PATCH] D108603: [clang][codegen] Set CurLinkModule in CodeGenAction::ExecuteAction

Bob Haarman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 23 18:01:48 PDT 2021


inglorion created this revision.
inglorion requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108603

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108603.368249.patch
Type: text/x-patch
Size: 6277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210824/bbbe7656/attachment.bin>


More information about the cfe-commits mailing list