rust/compiler/rustc_codegen_llvm
Kyle Huey 78caecf8f3 Special case DUMMY_SP to emit line 0/column 0 locations on DWARF platforms.
Line 0 has a special meaning in DWARF. From the version 5 spec:

    The compiler may emit the value 0 in cases
    where an instruction cannot be attributed to any
    source line.

DUMMY_SP spans cannot be attributed to any line. However, because rustc
internally stores line numbers starting at zero, lookup_debug_loc() adjusts
every line number by one. Special casing DUMMY_SP to actually emit line 0
ensures rustc communicates to the debugger that there's no meaningful source
code for this instruction, rather than telling the debugger to jump to line 1
randomly.
2024-08-03 21:18:52 -07:00
..
src Special case DUMMY_SP to emit line 0/column 0 locations on DWARF platforms. 2024-08-03 21:18:52 -07:00
Cargo.toml dedup object 2024-07-28 17:21:07 +03:00
messages.ftl Use an error struct instead of a panic 2024-05-15 11:14:45 +02:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

The codegen crate contains the code to convert from MIR into LLVM IR, and then from LLVM IR into machine code. In general it contains code that runs towards the end of the compilation process.

For more information about how codegen works, see the rustc dev guide.