[lld] r250127 - Fix test breakage on Windows.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 16:49:04 PDT 2015
Author: ruiu
Date: Mon Oct 12 18:49:04 2015
New Revision: 250127
URL: http://llvm.org/viewvc/llvm-project?rev=250127&view=rev
Log:
Fix test breakage on Windows.
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=250127&r1=250126&r2=250127&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Oct 12 18:49:04 2015
@@ -19,6 +19,7 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/StringSaver.h"
+#include <cctype>
using namespace llvm;
using namespace lld;
@@ -138,8 +139,12 @@ 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("/")) {
+ if (S.startswith("/") || isDOSAbsolutePath(S)) {
Driver->addFile(S);
} else if (S.startswith("=")) {
if (Config->Sysroot.empty())
More information about the llvm-commits
mailing list