mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
MCContext::GetDwarfFile(): Make FileName parsing tolerant of DOSish pathsep with PathV2.
It fixes failure in test/MC/MachO/gen-dwarf.s on Win32 w/o bash. llvm-svn: 159640
This commit is contained in:
parent
ebfaec6c36
commit
a96a98098e
@ -274,11 +274,11 @@ unsigned MCContext::GetDwarfFile(StringRef Directory, StringRef FileName,
|
||||
|
||||
if (Directory.empty()) {
|
||||
// Separate the directory part from the basename of the FileName.
|
||||
std::pair<StringRef, StringRef> Slash = FileName.rsplit('/');
|
||||
Directory = Slash.second;
|
||||
if (!Directory.empty()) {
|
||||
Directory = Slash.first;
|
||||
FileName = Slash.second;
|
||||
StringRef tFileName = sys::path::filename(FileName);
|
||||
if (!tFileName.empty()) {
|
||||
Directory = sys::path::parent_path(FileName);
|
||||
if (!Directory.empty())
|
||||
FileName = sys::path::filename(FileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user