forked from OSchip/llvm-project
Store just argv[0] in Config.
Having the full argv there seems in conflict with the desire to parse all command line options in the Driver. llvm-svn: 324418
This commit is contained in:
parent
cb7959fd78
commit
64626b344b
|
@ -89,12 +89,12 @@ struct Configuration {
|
|||
llvm::StringRef MapFile;
|
||||
llvm::StringRef OutputFile;
|
||||
llvm::StringRef OptRemarksFilename;
|
||||
llvm::StringRef ProgName;
|
||||
llvm::StringRef SoName;
|
||||
llvm::StringRef Sysroot;
|
||||
llvm::StringRef ThinLTOCacheDir;
|
||||
std::string Rpath;
|
||||
std::vector<VersionDefinition> VersionDefinitions;
|
||||
std::vector<llvm::StringRef> Argv;
|
||||
std::vector<llvm::StringRef> AuxiliaryList;
|
||||
std::vector<llvm::StringRef> FilterList;
|
||||
std::vector<llvm::StringRef> SearchPaths;
|
||||
|
|
|
@ -89,7 +89,7 @@ bool elf::link(ArrayRef<const char *> Args, bool CanExitEarly,
|
|||
Driver = make<LinkerDriver>();
|
||||
Script = make<LinkerScript>();
|
||||
Symtab = make<SymbolTable>();
|
||||
Config->Argv = {Args.begin(), Args.end()};
|
||||
Config->ProgName = Args[0];
|
||||
|
||||
Driver->main(Args, CanExitEarly);
|
||||
|
||||
|
@ -317,7 +317,7 @@ void LinkerDriver::main(ArrayRef<const char *> ArgsArr, bool CanExitEarly) {
|
|||
|
||||
// Handle -help
|
||||
if (Args.hasArg(OPT_help)) {
|
||||
printHelp(ArgsArr[0]);
|
||||
printHelp();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -690,7 +690,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
|
|||
Config->ZWxneeded = hasZOption(Args, "wxneeded");
|
||||
|
||||
// Parse LTO plugin-related options for compatibility with gold.
|
||||
std::vector<const char *> LTOOptions({Config->Argv[0].data()});
|
||||
std::vector<const char *> LTOOptions({Config->ProgName.data()});
|
||||
for (auto *Arg : Args.filtered(OPT_plugin_opt)) {
|
||||
StringRef S = Arg->getValue();
|
||||
if (S == "disable-verify")
|
||||
|
|
|
@ -63,7 +63,7 @@ enum {
|
|||
#undef OPTION
|
||||
};
|
||||
|
||||
void printHelp(const char *Argv0);
|
||||
void printHelp();
|
||||
std::string createResponseFile(const llvm::opt::InputArgList &Args);
|
||||
|
||||
llvm::Optional<std::string> findFromSearchPaths(StringRef Path);
|
||||
|
|
|
@ -114,9 +114,9 @@ opt::InputArgList ELFOptTable::parse(ArrayRef<const char *> Argv) {
|
|||
return Args;
|
||||
}
|
||||
|
||||
void elf::printHelp(const char *Argv0) {
|
||||
ELFOptTable().PrintHelp(outs(), Argv0, "lld", false /*ShowHidden*/,
|
||||
true /*ShowAllAliases*/);
|
||||
void elf::printHelp() {
|
||||
ELFOptTable().PrintHelp(outs(), Config->ProgName.data(), "lld",
|
||||
false /*ShowHidden*/, true /*ShowAllAliases*/);
|
||||
outs() << "\n";
|
||||
|
||||
// Scripts generated by Libtool versions up to at least 2.4.6 (the most
|
||||
|
@ -125,7 +125,7 @@ void elf::printHelp(const char *Argv0) {
|
|||
// assume that the linker doesn't support very basic features such as
|
||||
// shared libraries. Therefore, we need to print out at least "elf".
|
||||
// Here, we print out all the targets that we support.
|
||||
outs() << Argv0 << ": supported targets: "
|
||||
outs() << Config->ProgName << ": supported targets: "
|
||||
<< "elf32-i386 elf32-iamcu elf32-littlearm elf32-ntradbigmips "
|
||||
<< "elf32-ntradlittlemips elf32-powerpc elf32-tradbigmips "
|
||||
<< "elf32-tradlittlemips elf32-x86-64 "
|
||||
|
|
Loading…
Reference in New Issue