[DebugInfo] Fix issue with debug line table offsets for empty functions (#142253) This patch addresses an issue where an anonymous DWARF line table symbol could be inadvertently defined multiple times, leading to an "symbol '' is already defined" error during assembly or object file emission. This issue happens for empty functions when `-emit-func-debug-line-table-offsets` is enabled. The root cause is the creation of the "end sequence" entry for a DWARF line table. This entry was sometimes created by copying the last existing line table entry. If this last entry was a special one (created for the purpose of marking the position in the line table stream and having an anonymous symbol attached), the copied end-sequence entry would also incorrectly reference this same anonymous symbol. Consequently, when the line table was finally emitted, the DWARF emission logic would attempt to emit a label for this anonymous symbol twice, triggering the redefinition error. The fix ensures that when an end-sequence line table entry is created, it does not inherit any special stream label from the entry it might have been based on, thereby preventing the duplicate label emission.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.