summaryrefslogtreecommitdiffstats
path: root/lld/COFF/PDB.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-07-07 18:46:14 +0000
committerZachary Turner <zturner@google.com>2017-07-07 18:46:14 +0000
commit448dea419c6cf01e5d692b58ebc36ad5453d2d8f (patch)
treee2cfdafe17fa76fb7ccebe2caec8d193613ef7f2 /lld/COFF/PDB.cpp
parentc1e93e5fa46772c959a9f5d74dfeb95d3cde4ce3 (diff)
downloadbcm5719-llvm-448dea419c6cf01e5d692b58ebc36ad5453d2d8f.tar.gz
bcm5719-llvm-448dea419c6cf01e5d692b58ebc36ad5453d2d8f.zip
Use windows path syntax when writing PDB module name.
Without this we would just append whatever the user wrote on the command line, so if we're in C:\foo and we run lld-link bar/baz.obj, we would write C:\foo\bar/baz.obj in various places in the PDB. MSVC linker does not do this, so we shouldn't either. This fixes some differences in the diff test, so we update the test as well. Differential Revision: https://reviews.llvm.org/D35092 llvm-svn: 307423
Diffstat (limited to 'lld/COFF/PDB.cpp')
-rw-r--r--lld/COFF/PDB.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index e0dc58b2a18..02cb1f51e3d 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -315,7 +315,9 @@ static void addObjectsToPDB(BumpPtrAllocator &Alloc, SymbolTable *Symtab,
bool InArchive = !File->ParentName.empty();
SmallString<128> Path = InArchive ? File->ParentName : File->getName();
sys::fs::make_absolute(Path);
+ sys::path::native(Path, llvm::sys::path::Style::windows);
StringRef Name = InArchive ? File->getName() : StringRef(Path);
+
File->ModuleDBI = &ExitOnErr(Builder.getDbiBuilder().addModuleInfo(Name));
File->ModuleDBI->setObjFileName(Path);
@@ -414,7 +416,7 @@ void coff::createPDB(StringRef Path, SymbolTable *Symtab,
llvm::SmallString<128> NativePath(Path.begin(), Path.end());
llvm::sys::fs::make_absolute(NativePath);
- llvm::sys::path::native(NativePath);
+ llvm::sys::path::native(NativePath, llvm::sys::path::Style::windows);
pdb::PDB_UniqueId uuid{};
if (DI)
OpenPOWER on IntegriCloud