Try to fix Windows bots after r355226.
authorPaul Robinson <paul.robinson@sony.com>
Fri, 1 Mar 2019 22:28:13 +0000 (22:28 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Fri, 1 Mar 2019 22:28:13 +0000 (22:28 +0000)
Windows has two path separator characters.

llvm-svn: 355235

llvm/lib/MC/MCContext.cpp

index 7cf4e1da5acfd602046caa616fa4ac8104b02836..69e18ed89987e327502b98ab7b17dc6169109ba2 100644 (file)
@@ -583,7 +583,8 @@ void MCContext::setGenDwarfRootFile(StringRef InputFileName, StringRef Buffer) {
   if (FileName.empty() || FileName == "-")
     FileName = "<stdin>";
   if (FileName.consume_front(getCompilationDir()))
-    FileName.consume_front(llvm::sys::path::get_separator());
+    if (llvm::sys::path::is_separator(FileName.front()))
+      FileName = FileName.drop_front();
   assert(!FileName.empty());
   setMCLineTableRootFile(
       /*CUID=*/0, getCompilationDir(), FileName, Cksum, None);