Call cl::ParseCommandLineOptions from the driver.

Thanks to Rui for the suggestion; this simplifies things.

llvm-svn: 265213
This commit is contained in:
Sean Silva 2016-04-02 04:08:02 +00:00
parent e70901552c
commit abd25c9b3e
3 changed files with 4 additions and 5 deletions

View File

@ -91,7 +91,6 @@ struct Configuration {
uint16_t EMachine = llvm::ELF::EM_NONE;
uint64_t EntryAddr = -1;
unsigned LtoO;
std::vector<const char *> MLlvm;
unsigned Optimize;
};

View File

@ -309,9 +309,11 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
for (auto *Arg : Args.filtered(OPT_undefined))
Config->Undefined.push_back(Arg->getValue());
Config->MLlvm.push_back("lld (LLVM option parsing)");
std::vector<const char *> Argv;
Argv.push_back("lld (LLVM option parsing)");
for (auto *Arg : Args.filtered(OPT_mllvm))
Config->MLlvm.push_back(Arg->getValue());
Argv.push_back(Arg->getValue());
cl::ParseCommandLineOptions(Argv.size(), Argv.data());
}
void LinkerDriver::createFiles(opt::InputArgList &Args) {

View File

@ -143,8 +143,6 @@ std::unique_ptr<InputFile> BitcodeCompiler::compile() {
internalize(*GV);
}
cl::ParseCommandLineOptions(Config->MLlvm.size(), Config->MLlvm.data());
if (Config->SaveTemps)
saveBCFile(Combined, ".lto.bc");