Do not pass line number to convertToUnixPathSeparator.
authorRui Ueyama <ruiu@google.com>
Wed, 7 Dec 2016 20:25:45 +0000 (20:25 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 7 Dec 2016 20:25:45 +0000 (20:25 +0000)
Line number can never contain '/' or '\', so the previous code
was pointless at that point.

llvm-svn: 288973

lld/ELF/InputFiles.cpp
lld/include/lld/Core/Reproduce.h

index ac717f4..66ecb51 100644 (file)
@@ -91,8 +91,8 @@ std::string elf::ObjectFile<ELFT>::getLineInfo(InputSectionBase<ELFT> *S,
       DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info);
   if (Info.Line == 0)
     return "";
-  return convertToUnixPathSeparator(
-      Info.FileName + ":" + std::to_string(Info.Line));
+  return convertToUnixPathSeparator(Info.FileName) + ":" +
+         std::to_string(Info.Line);
 }
 
 // Returns "(internal)", "foo.a(bar.o)" or "baz.o".
index 660c2da..cf27474 100644 (file)
@@ -68,7 +68,6 @@ std::string stringize(llvm::opt::Arg *Arg);
 
 // Replaces backslashes with slashes if Windows.
 std::string convertToUnixPathSeparator(StringRef S);
-
 }
 
 #endif