forked from OSchip/llvm-project
parent
18255a333e
commit
63d8880b38
|
@ -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 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("/")) {
|
||||
if (S.startswith("/") || isDOSAbsolutePath(S)) {
|
||||
Driver->addFile(S);
|
||||
} else if (S.startswith("=")) {
|
||||
if (Config->Sysroot.empty())
|
||||
|
|
Loading…
Reference in New Issue