libcpp gains raw map creation for LTO linemap changes
New `linemap_add_raw_map` in libcpp provides finer control over linemap creation for LTO.
Libcpp’s line mapping functionality has been extended with linemap_add_raw_map(), allowing the LTO front end more precise control over linemap creation. This new function enables explicit specification of map properties, which is crucial for LTO’s upcoming revised approach to streaming location data. While this commit adds self-tests, no external observable changes are made yet.
In Details
This change introduces linemap_add_raw_map() to libcpp/line-map.cc and include/line-map.h, providing direct control over linemap creation for the LTO front end. Unlike linemap_add or linemap_line_start, which automatically decide map properties, linemap_add_raw_map allows the caller (LTO) to dictate these properties. This is a precursor to LTO fundamentally altering how it streams location data, requiring finer-grained management of the linemap structure.
- libcpp
- The C preprocessor used by GCC. It handles directives like #include, #define, and conditional compilation before the main compilation phases.
- LTO
- Link-Time Optimization. A compilation technique where optimization occurs at link time rather than during individual compilation units, allowing for inter-procedural optimizations across the entire program.
- linemap
- A data structure used by the compiler to map intermediate code locations to source file locations (filename, line number, column number). It's crucial for generating accurate debugging information and diagnostics.
- streaming
- The process of serializing and transmitting data, often in chunks, between different components of the build process. In LTO, this refers to sending code and symbol information between the front end and the backend.