[lld] r250133 - Use llvm::sys::path::is_absolute instead of my own.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 17:09:22 PDT 2015
Author: ruiu
Date: Mon Oct 12 19:09:21 2015
New Revision: 250133
URL: http://llvm.org/viewvc/llvm-project?rev=250133&view=rev
Log:
Use llvm::sys::path::is_absolute instead of my own.
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=250133&r1=250132&r2=250133&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Oct 12 19:09:21 2015
@@ -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 Expe
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())
More information about the llvm-commits
mailing list