[PATCH] D104431: [lld] Add lto-cspgo-warn-mismatch option for COFF

Yolanda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 03:09:31 PDT 2021


YolandaCY added a comment.

In D104431#2836028 <https://reviews.llvm.org/D104431#2836028>, @tejohnson wrote:

> In D104431#2835530 <https://reviews.llvm.org/D104431#2835530>, @YolandaCY wrote:
>
>> Thanks Teresa for the comments.
>>
>> For the first question, clang uses the -Wno-backend-plugin option to ignore the warnings.
>> This is mentioned in the How to build clang and LLVM with PGO <https://llvm.org/docs/HowToBuildWithPGO.html> user guide.
>>
>> I haven't figured out how this correlates to the internal -no-pgo-warn-mismatch option though. Any tips?
>
> I traced it through and it looks like it will disable any warning coming from outside of clang (so LLVM) that doesn't have another type of handling in this switch statement:
> http://llvm-cs.pcc.me.uk/tools/clang/lib/CodeGen/CodeGenAction.cpp#818
>
> So it looks like a larger hammer because it could affect other warning types too.
>
> @xur @davidxl do either of you know why we don't support something more fine grained in clang such as gcc's -Wno-coverage-mismatch?

Thanks Teresa for the pointer.

The corresponding lld diagnostic handler can be found at:
http://llvm-cs.pcc.me.uk/tools/lld/Common/ErrorHandler.cpp#66
It is much simpler and does not distingush the kind. And it is initialized in the LTOLLVMContext:
http://llvm-cs.pcc.me.uk/include/llvm/LTO/Config.h#228

It seems that to add a similar option as clang we may need to add an lto specific DiagnosticHandlerFunction (not share lld's) and check for all diagnostic kinds as clang?
Or shall we just add a fine grained option similar to gcc?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104431



More information about the llvm-commits mailing list