[lld] r257077 - ELF: Split LinkerDriver::createFiles. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 7 09:54:19 PST 2016
Author: ruiu
Date: Thu Jan 7 11:54:19 2016
New Revision: 257077
URL: http://llvm.org/viewvc/llvm-project?rev=257077&view=rev
Log:
ELF: Split LinkerDriver::createFiles. NFC.
createFiles was doing more than creating files despite its name.
Now these things are moved to a new function.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/Driver.h
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=257077&r1=257076&r2=257077&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Jan 7 11:54:19 2016
@@ -143,6 +143,7 @@ void LinkerDriver::main(ArrayRef<const c
initSymbols();
opt::InputArgList Args = parseArgs(&Alloc, ArgsArr);
+ readConfigs(Args);
createFiles(Args);
checkOptions(Args);
@@ -164,7 +165,8 @@ void LinkerDriver::main(ArrayRef<const c
}
}
-void LinkerDriver::createFiles(opt::InputArgList &Args) {
+// Initializes Config members by the command line options.
+void LinkerDriver::readConfigs(opt::InputArgList &Args) {
for (auto *Arg : Args.filtered(OPT_L))
Config->SearchPaths.push_back(Arg->getValue());
@@ -230,7 +232,9 @@ void LinkerDriver::createFiles(opt::Inpu
for (auto *Arg : Args.filtered(OPT_undefined))
Config->Undefined.push_back(Arg->getValue());
+}
+void LinkerDriver::createFiles(opt::InputArgList &Args) {
for (auto *Arg : Args) {
switch (Arg->getOption().getID()) {
case OPT_l:
Modified: lld/trunk/ELF/Driver.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.h?rev=257077&r1=257076&r2=257077&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.h (original)
+++ lld/trunk/ELF/Driver.h Thu Jan 7 11:54:19 2016
@@ -26,6 +26,7 @@ void link(ArrayRef<const char *> Args);
class LinkerDriver {
public:
void main(ArrayRef<const char *> Args);
+ void readConfigs(llvm::opt::InputArgList &Args);
void createFiles(llvm::opt::InputArgList &Args);
template <class ELFT> void link(llvm::opt::InputArgList &Args);
More information about the llvm-commits
mailing list