summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-10-13 00:09:21 +0000
committerRui Ueyama <ruiu@google.com>2015-10-13 00:09:21 +0000
commitf03f3cc18cccbd7167540539bd9bece1d1ccccaf (patch)
treeb18a7c4b29ab02b33a182e0ba01055c2a712d28c /lld/ELF/LinkerScript.cpp
parentf0d9e47da2f39a738ca812c64bd1497f320f9465 (diff)
downloadbcm5719-llvm-f03f3cc18cccbd7167540539bd9bece1d1ccccaf.tar.gz
bcm5719-llvm-f03f3cc18cccbd7167540539bd9bece1d1ccccaf.zip
Use llvm::sys::path::is_absolute instead of my own.
llvm-svn: 250133
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 1939424eb8b..35749ea0e68 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -18,6 +18,7 @@
#include "SymbolTable.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/StringSaver.h"
#include <cctype>
@@ -139,12 +140,8 @@ void LinkerScript::expect(StringRef Expect) {
error(Expect + " expected, but got " + Tok);
}
-static bool isDOSAbsolutePath(StringRef S) {
- return isalpha(S[0]) && S.substr(1).startswith(":\\");
-}
-
void LinkerScript::addFile(StringRef S) {
- if (S.startswith("/") || isDOSAbsolutePath(S)) {
+ if (sys::path::is_absolute(S)) {
Driver->addFile(S);
} else if (S.startswith("=")) {
if (Config->Sysroot.empty())
OpenPOWER on IntegriCloud