[Remarks] Retain all remarks by default, add option to drop without DL.
authorFlorian Hahn <flo@fhahn.com>
Fri, 26 May 2023 10:01:18 +0000 (11:01 +0100)
committerFlorian Hahn <flo@fhahn.com>
Fri, 26 May 2023 10:01:20 +0000 (11:01 +0100)
commite1596d7d9be1659730403b95efb94dad13c8495a
tree703333d99fb3d7ba99a54ac2fbfa7833dd115562
parent45aaa67fceadaeb3bf76bab21d36c1f337d97491
[Remarks] Retain all remarks by default, add option to drop without DL.

At the moment, dsymutil drops all remarks without debug location.

There are many cases where debug location may be missing for remarks,
mostly due LLVM not preserving debug locations. When using bitstream
remarks for statistical analysis, those missed remarks mean we get an
incomplete picture.

The patch flips the default to keeping all remarks and leaving it to
tools that display remarks to filter out remarks without debug locations
as needed.

The new --remarks-drop-without-debug flag can be used to drop remarks
without debug locations, i.e. restore the previous behavior.

Reviewed By: thegameg

Differential Revision: https://reviews.llvm.org/D151089
llvm/docs/CommandGuide/dsymutil.rst
llvm/include/llvm/Remarks/RemarkLinker.h
llvm/lib/Remarks/RemarkLinker.cpp
llvm/test/tools/dsymutil/cmdline.test
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
llvm/tools/dsymutil/LinkUtils.h
llvm/tools/dsymutil/Options.td
llvm/tools/dsymutil/dsymutil.cpp
llvm/unittests/Remarks/RemarksLinkingTest.cpp