[PATCH 34/79] [Backport to 15][DebugInfo] Support multiple CompileUnits (#1950)
authorDmitry Sidorov <dmitry.sidorov@intel.com>
Wed, 19 Apr 2023 13:34:06 +0000 (15:34 +0200)
committerAndreas Beckmann <anbe@debian.org>
Thu, 8 Feb 2024 21:48:18 +0000 (22:48 +0100)
commit54a89f302727b8660954d4e07da1955b9d42c6e3
tree27012fa143e1b1f839a371c470bc594d288ac5fc
parent51049bae0b638b91d91a3adfcb06b387333976df
[PATCH 34/79] [Backport to 15][DebugInfo] Support multiple CompileUnits (#1950)

It's possible for LLVM IR module to contain multiple CU in case if this module is a result
of llvm-link between two modules compiled for different languages and or compiled with
different options.

This patch introduces handling of such modules.
std::unordered_map<SPIRVId, std::unique_ptr> BuilderMap was introduced
to SPIR-V consumption part and
std::unordered_map<const DICompileUnit *, SPIRVExtInst *> SPIRVCUMap was introduced
to SPIR-V generation part to preserve Scope relations between DI metadata in SPIR-V and vice versa.

Note, that DIBuilder has a single CU field and this class is not trivially copiable.

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
Gbp-Pq: Name 0034-Backport-to-15-DebugInfo-Support-multiple-CompileUni.patch
lib/SPIRV/LLVMToSPIRVDbgTran.cpp
lib/SPIRV/LLVMToSPIRVDbgTran.h
lib/SPIRV/SPIRVReader.cpp
lib/SPIRV/SPIRVToLLVMDbgTran.cpp
lib/SPIRV/SPIRVToLLVMDbgTran.h
lib/SPIRV/libSPIRV/SPIRV.debug.h
test/DebugInfo/Generic/c-and-cpp-mixed.ll [new file with mode: 0644]
test/DebugInfo/X86/mixed-nodebug-cu.ll
test/DebugInfo/X86/split-dwarf-omit-empty.ll