[lld] r288973 - Do not pass line number to convertToUnixPathSeparator.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 12:25:45 PST 2016


Author: ruiu
Date: Wed Dec  7 14:25:45 2016
New Revision: 288973

URL: http://llvm.org/viewvc/llvm-project?rev=288973&view=rev
Log:
Do not pass line number to convertToUnixPathSeparator.

Line number can never contain '/' or '\', so the previous code
was pointless at that point.

Modified:
    lld/trunk/ELF/InputFiles.cpp
    lld/trunk/include/lld/Core/Reproduce.h

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=288973&r1=288972&r2=288973&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Dec  7 14:25:45 2016
@@ -91,8 +91,8 @@ std::string elf::ObjectFile<ELFT>::getLi
       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".

Modified: lld/trunk/include/lld/Core/Reproduce.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Reproduce.h?rev=288973&r1=288972&r2=288973&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Reproduce.h (original)
+++ lld/trunk/include/lld/Core/Reproduce.h Wed Dec  7 14:25:45 2016
@@ -68,7 +68,6 @@ std::string stringize(llvm::opt::Arg *Ar
 
 // Replaces backslashes with slashes if Windows.
 std::string convertToUnixPathSeparator(StringRef S);
-
 }
 
 #endif




More information about the llvm-commits mailing list