https://github.com/noxwell updated 
https://github.com/llvm/llvm-project/pull/83175

>From 237264fded2b9806d273d7bc5d593a7dd0011850 Mon Sep 17 00:00:00 2001
From: Aleksei Vetrov <vvv...@google.com>
Date: Tue, 27 Feb 2024 19:50:13 +0000
Subject: [PATCH] [Clang][DebugInfo] Use CGDebugInfo::createFile in
 CGDebugInfo::CreateCompileUnit (#83174)

Use `CGDebugInfo::createFile` wrapper that handles file remapping and
corner cases instead of directly using `DBuilder.createFile` in
`CGDebugInfo::CreateCompileUnit`.

Fixes #83174
---
 clang/lib/CodeGen/CGDebugInfo.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index c2c01439f2dc99..22cb3492ebe11a 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -628,9 +628,8 @@ void CGDebugInfo::CreateCompileUnit() {
   // file was specified with an absolute path.
   if (CSKind)
     CSInfo.emplace(*CSKind, Checksum);
-  llvm::DIFile *CUFile = DBuilder.createFile(
-      remapDIPath(MainFileName), remapDIPath(getCurrentDirname()), CSInfo,
-      getSource(SM, SM.getMainFileID()));
+  llvm::DIFile *CUFile =
+      createFile(MainFileName, CSInfo, getSource(SM, SM.getMainFileID()));
 
   StringRef Sysroot, SDK;
   if (CGM.getCodeGenOpts().getDebuggerTuning() == llvm::DebuggerKind::LLDB) {

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to