[llvm-commits] [llvm] r159640 - /llvm/trunk/lib/MC/MCContext.cpp

NAKAMURA Takumi geek4civic at gmail.com
Mon Jul 2 20:59:29 PDT 2012


Author: chapuni
Date: Mon Jul  2 22:59:29 2012
New Revision: 159640

URL: http://llvm.org/viewvc/llvm-project?rev=159640&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/MC/MCContext.cpp

Modified: llvm/trunk/lib/MC/MCContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=159640&r1=159639&r2=159640&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCContext.cpp (original)
+++ llvm/trunk/lib/MC/MCContext.cpp Mon Jul  2 22:59:29 2012
@@ -274,11 +274,11 @@
 
   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);
     }
   }
 





More information about the llvm-commits mailing list