[llvm] [SPIR-V] Support for multiple DebugCompilationUnit in DI (PR #109645)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 04:31:27 PDT 2024


================
@@ -101,9 +101,10 @@ bool SPIRVEmitNonSemanticDI::emitGlobalDI(MachineFunction &MF) {
     for (const auto *Op : DbgCu->operands()) {
       if (const auto *CompileUnit = dyn_cast<DICompileUnit>(Op)) {
         DIFile *File = CompileUnit->getFile();
-        sys::path::append(FilePath, File->getDirectory(), File->getFilename());
-        SourceLanguage = CompileUnit->getSourceLanguage();
-        break;
+        FilePaths.emplace_back();
+        sys::path::append(FilePaths.back(), File->getDirectory(),
+                          File->getFilename());
+        SourceLanguages.push_back(CompileUnit->getSourceLanguage());
----------------
MrSidims wrote:

Unrelated to this very question, but still. getSourceLanguage will return an integer for a source language known in LLVM's context. But it's not necessarily the same as defined in SPIR-V specification. So here should be a map to SPIR-V source languages defaulting to 3.2. Source Language: unknown.

https://github.com/llvm/llvm-project/pull/109645


More information about the llvm-commits mailing list