[llvm] 86c01b1 - [DebugInfo] [PDB] Force injected source paths to use backslashes

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 5 12:51:09 PDT 2021


Author: Martin Storsjö
Date: 2021-11-05T21:50:42+02:00
New Revision: 86c01b1bc6aed83f93c359f513105af6b626fa8c

URL: https://github.com/llvm/llvm-project/commit/86c01b1bc6aed83f93c359f513105af6b626fa8c
DIFF: https://github.com/llvm/llvm-project/commit/86c01b1bc6aed83f93c359f513105af6b626fa8c.diff

LOG: [DebugInfo] [PDB] Force injected source paths to use backslashes

This fixes lld/COFF/pdb-natvis.test (which only is run on Windows)
when using paths with forward slashes on Windows.

Differential Revision: https://reviews.llvm.org/D113265

Added: 
    

Modified: 
    llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
index a508f163a2d84..f33125474e3a4 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
@@ -103,7 +103,7 @@ void PDBFileBuilder::addInjectedSource(StringRef Name,
   // table and the hash value is dependent on the exact contents of the string.
   // link.exe lowercases a path and converts / to \, so we must do the same.
   SmallString<64> VName;
-  sys::path::native(Name.lower(), VName);
+  sys::path::native(Name.lower(), VName, sys::path::Style::windows_backslash);
 
   uint32_t NI = getStringTableBuilder().insert(Name);
   uint32_t VNI = getStringTableBuilder().insert(VName);


        


More information about the llvm-commits mailing list