Skip to content

Commit

Permalink
MCContext::GetDwarfFile(): Make FileName parsing tolerant of DOSish p…
Browse files Browse the repository at this point in the history
…athsep with PathV2.

It fixes failure in test/MC/MachO/gen-dwarf.s on Win32 w/o bash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159640 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chapuni committed Jul 3, 2012
1 parent ea957f0 commit 4c215c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/MC/MCContext.cpp
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 4c215c0

Please sign in to comment.