mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 11:36:07 +00:00

Currently, DWARFLinker determines the target DWARF version internally. It examines incoming object files, detects maximal DWARF version and uses that version for the output file. This patch allows explicitly setting output DWARF version by the consumer of DWARFLinker. So that DWARFLinker uses a specified version instead of autodetected one. It allows consumers to use different logic for setting the target DWARF version. f.e. instead of the maximally used version someone could set a higher version to convert from DWARFv4 to DWARFv5 (This possibility is not supported yet, but it would be good if the interface will support it). Or another variant is to set the target version through the command line. In this patch, the autodetection is moved into the consumers(DwarfLinkerForBinary.cpp, DebugInfoLinker.cpp). Differential Revision: https://reviews.llvm.org/D132755