After IRTranslator pass, constants are deduplicated and translated into instructions at entry block, having debug locations lost. Localization of constants may cause emission of extra zero lines in debug_line section, like here https://godbolt.org/z/ecvsxxfKn. In this example, constant gets placed as a first instruction in entry block, and despite it has no debug location, AsmPrinter emits zero line for it. If a localized constant has the only user, we can assume that it has the same debug location as its user, since they are placed consequently. Differential Revision: https://reviews.llvm.org/D128192
8.1 KiB
8.1 KiB