diff options
author | Nico Weber <nicolasweber@gmx.de> | 2018-07-20 23:06:34 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2018-07-20 23:06:34 +0000 |
commit | f6be41668799d052a021bd23991da7a0e6700708 (patch) | |
tree | d995e5d06bfe1ca39bc121c64e8133fc380a73fc /lld | |
parent | b218069826a1bf8f1f10247f8512c9d71d69327c (diff) | |
download | bcm5719-llvm-f6be41668799d052a021bd23991da7a0e6700708.tar.gz bcm5719-llvm-f6be41668799d052a021bd23991da7a0e6700708.zip |
Simplify; no behavior change.
Reviewed as part of https://reviews.llvm.org/D49189
llvm-svn: 337633
Diffstat (limited to 'lld')
-rw-r--r-- | lld/COFF/InputFiles.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp index 86843211aa7..7fa3b0e0b21 100644 --- a/lld/COFF/InputFiles.cpp +++ b/lld/COFF/InputFiles.cpp @@ -27,6 +27,7 @@ #include "llvm/Support/Error.h" #include "llvm/Support/ErrorOr.h" #include "llvm/Support/FileSystem.h" +#include "llvm/Support/Path.h" #include "llvm/Target/TargetOptions.h" #include <cstring> #include <system_error> @@ -489,10 +490,7 @@ MachineTypes BitcodeFile::getMachineType() { // Returns the last element of a path, which is supposed to be a filename. static StringRef getBasename(StringRef Path) { - size_t Pos = Path.find_last_of("\\/"); - if (Pos == StringRef::npos) - return Path; - return Path.substr(Pos + 1); + return sys::path::filename(Path, sys::path::Style::windows); } // Returns a string in the format of "foo.obj" or "foo.obj(bar.lib)". |