diff options
author | Derek Schuff <dschuff@chromium.org> | 2012-08-21 17:32:13 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2012-08-21 17:32:13 -0700 |
commit | 66f271497ed92ebb05c66f54616e512606a2e314 (patch) | |
tree | 96d54cd64804ab7c9f2f52f680c3301aa789ce1d /lib/MC/MCContext.cpp | |
parent | b62e9abf7dd9e39c95327914ce9dfe216386824a (diff) | |
parent | bc363931085587bac42a40653962a3e5acd1ffce (diff) |
Merge up to r162331, git commit bc363931085587bac42a40653962a3e5acd1ffce
Diffstat (limited to 'lib/MC/MCContext.cpp')
-rw-r--r-- | lib/MC/MCContext.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index d3c4fb1d7c..b5b14b95f6 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -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 = tFileName; } } |