diff options
Diffstat (limited to 'COFF/DriverUtils.cpp')
| -rw-r--r-- | COFF/DriverUtils.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/COFF/DriverUtils.cpp b/COFF/DriverUtils.cpp index 2c9ba797f73b..252590c7d870 100644 --- a/COFF/DriverUtils.cpp +++ b/COFF/DriverUtils.cpp @@ -479,6 +479,10 @@ Export parseExport(StringRef Arg) { E.Data = true; continue; } + if (Tok.equals_lower("constant")) { + E.Constant = true; + continue; + } if (Tok.equals_lower("private")) { E.Private = true; continue; @@ -695,17 +699,20 @@ opt::InputArgList ArgParser::parse(ArrayRef<const char *> ArgsArr) { return Args; } -// link.exe has an interesting feature. If LINK environment exists, -// its contents are handled as a command line string. So you can pass -// extra arguments using the environment variable. -opt::InputArgList ArgParser::parseLINK(ArrayRef<const char *> Args) { +// link.exe has an interesting feature. If LINK or _LINK_ environment +// variables exist, their contents are handled as command line strings. +// So you can pass extra arguments using them. +opt::InputArgList ArgParser::parseLINK(std::vector<const char *> Args) { // Concatenate LINK env and command line arguments, and then parse them. - Optional<std::string> Env = Process::GetEnv("LINK"); - if (!Env) - return parse(Args); - std::vector<const char *> V = tokenize(*Env); - V.insert(V.end(), Args.begin(), Args.end()); - return parse(V); + if (Optional<std::string> S = Process::GetEnv("LINK")) { + std::vector<const char *> V = tokenize(*S); + Args.insert(Args.begin(), V.begin(), V.end()); + } + if (Optional<std::string> S = Process::GetEnv("_LINK_")) { + std::vector<const char *> V = tokenize(*S); + Args.insert(Args.begin(), V.begin(), V.end()); + } + return parse(Args); } std::vector<const char *> ArgParser::tokenize(StringRef S) { |
