diff options
Diffstat (limited to 'lld/COFF/DriverUtils.cpp')
-rw-r--r-- | lld/COFF/DriverUtils.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/lld/COFF/DriverUtils.cpp b/lld/COFF/DriverUtils.cpp index b4b8ee9eead..864a7e67156 100644 --- a/lld/COFF/DriverUtils.cpp +++ b/lld/COFF/DriverUtils.cpp @@ -49,23 +49,23 @@ public: void add(const char *S) { Args.push_back(Saver.save(S).data()); } void run() { - ErrorOr<std::string> ExeOrErr = llvm::sys::findProgramByName(Prog); + ErrorOr<std::string> ExeOrErr = sys::findProgramByName(Prog); if (auto EC = ExeOrErr.getError()) fatal(EC, "unable to find " + Prog + " in PATH: "); const char *Exe = Saver.save(*ExeOrErr).data(); Args.insert(Args.begin(), Exe); Args.push_back(nullptr); - if (llvm::sys::ExecuteAndWait(Args[0], Args.data()) != 0) { + if (sys::ExecuteAndWait(Args[0], Args.data()) != 0) { for (const char *S : Args) if (S) - llvm::errs() << S << " "; + errs() << S << " "; fatal("ExecuteAndWait failed"); } } private: - llvm::BumpPtrAllocator Alloc; - llvm::StringSaver Saver; + BumpPtrAllocator Alloc; + StringSaver Saver; StringRef Prog; std::vector<const char *> Args; }; @@ -166,8 +166,8 @@ void parseMerge(StringRef S) { if (!Inserted) { StringRef Existing = Pair.first->second; if (Existing != To) - llvm::errs() << "warning: " << S << ": already merged into " - << Existing << "\n"; + errs() << "warning: " << S << ": already merged into " << Existing + << "\n"; } } @@ -322,7 +322,7 @@ TemporaryFile createDefaultXml() { // Open the temporary file for writing. std::error_code EC; - llvm::raw_fd_ostream OS(File.Path, EC, sys::fs::F_Text); + raw_fd_ostream OS(File.Path, EC, sys::fs::F_Text); if (EC) fatal(EC, "failed to open " + File.Path); @@ -389,7 +389,7 @@ std::unique_ptr<MemoryBuffer> createManifestRes() { // Open the temporary file for writing. std::error_code EC; - llvm::raw_fd_ostream Out(RCFile.Path, EC, sys::fs::F_Text); + raw_fd_ostream Out(RCFile.Path, EC, sys::fs::F_Text); if (EC) fatal(EC, "failed to open " + RCFile.Path); @@ -421,7 +421,7 @@ void createSideBySideManifest() { if (Path == "") Path = Config->OutputFile + ".manifest"; std::error_code EC; - llvm::raw_fd_ostream Out(Path, EC, llvm::sys::fs::F_Text); + raw_fd_ostream Out(Path, EC, sys::fs::F_Text); if (EC) fatal(EC, "failed to create manifest"); Out << createManifestXml(); @@ -539,7 +539,7 @@ void fixupExports() { Export *Existing = Pair.first->second; if (E == *Existing || E.Name != Existing->Name) continue; - llvm::errs() << "warning: duplicate /export option: " << E.Name << "\n"; + errs() << "warning: duplicate /export option: " << E.Name << "\n"; } Config->Exports = std::move(V); @@ -601,7 +601,7 @@ convertResToCOFF(const std::vector<MemoryBufferRef> &MBs) { TemporaryFile& ResFile = ResFiles.back(); // Write the content of the resource in a temporary file std::error_code EC; - llvm::raw_fd_ostream OS(ResFile.Path, EC, sys::fs::F_None); + raw_fd_ostream OS(ResFile.Path, EC, sys::fs::F_None); if (EC) fatal(EC, "failed to open " + ResFile.Path); OS << MB.getBuffer(); @@ -638,7 +638,7 @@ public: }; // Parses a given list of options. -llvm::opt::InputArgList ArgParser::parse(ArrayRef<const char *> ArgsArr) { +opt::InputArgList ArgParser::parse(ArrayRef<const char *> ArgsArr) { // First, replace respnose files (@<file>-style options). std::vector<const char *> Argv = replaceResponseFiles(ArgsArr); @@ -646,28 +646,27 @@ llvm::opt::InputArgList ArgParser::parse(ArrayRef<const char *> ArgsArr) { COFFOptTable Table; unsigned MissingIndex; unsigned MissingCount; - llvm::opt::InputArgList Args = - Table.ParseArgs(Argv, MissingIndex, MissingCount); + opt::InputArgList Args = Table.ParseArgs(Argv, MissingIndex, MissingCount); // Print the real command line if response files are expanded. if (Args.hasArg(OPT_verbose) && ArgsArr.size() != Argv.size()) { - llvm::outs() << "Command line:"; + outs() << "Command line:"; for (const char *S : Argv) - llvm::outs() << " " << S; - llvm::outs() << "\n"; + outs() << " " << S; + outs() << "\n"; } if (MissingCount) fatal(Twine(Args.getArgString(MissingIndex)) + ": missing argument"); for (auto *Arg : Args.filtered(OPT_UNKNOWN)) - llvm::errs() << "ignoring unknown argument: " << Arg->getSpelling() << "\n"; + errs() << "ignoring unknown argument: " << Arg->getSpelling() << "\n"; 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. -llvm::opt::InputArgList ArgParser::parseLINK(ArrayRef<const char *> Args) { +opt::InputArgList ArgParser::parseLINK(ArrayRef<const char *> Args) { // Concatenate LINK env and command line arguments, and then parse them. Optional<std::string> Env = Process::GetEnv("LINK"); if (!Env) @@ -680,7 +679,7 @@ llvm::opt::InputArgList ArgParser::parseLINK(ArrayRef<const char *> Args) { std::vector<const char *> ArgParser::tokenize(StringRef S) { SmallVector<const char *, 16> Tokens; StringSaver Saver(AllocAux); - llvm::cl::TokenizeWindowsCommandLine(S, Saver, Tokens); + cl::TokenizeWindowsCommandLine(S, Saver, Tokens); return std::vector<const char *>(Tokens.begin(), Tokens.end()); } @@ -696,7 +695,7 @@ ArgParser::replaceResponseFiles(std::vector<const char *> Argv) { void printHelp(const char *Argv0) { COFFOptTable Table; - Table.PrintHelp(llvm::outs(), Argv0, "LLVM Linker", false); + Table.PrintHelp(outs(), Argv0, "LLVM Linker", false); } } // namespace coff |