Changeset View
Changeset View
Standalone View
Standalone View
lld/ELF/Driver.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
#include "lld/Common/TargetOptionsCommandFlags.h" | #include "lld/Common/TargetOptionsCommandFlags.h" | ||||
#include "lld/Common/Version.h" | #include "lld/Common/Version.h" | ||||
#include "llvm/ADT/SetVector.h" | #include "llvm/ADT/SetVector.h" | ||||
#include "llvm/ADT/StringExtras.h" | #include "llvm/ADT/StringExtras.h" | ||||
#include "llvm/ADT/StringSwitch.h" | #include "llvm/ADT/StringSwitch.h" | ||||
#include "llvm/Config/llvm-config.h" | #include "llvm/Config/llvm-config.h" | ||||
#include "llvm/LTO/LTO.h" | #include "llvm/LTO/LTO.h" | ||||
#include "llvm/Object/Archive.h" | #include "llvm/Object/Archive.h" | ||||
#include "llvm/Passes/PassPlugin.h" | |||||
#include "llvm/Passes/PassPluginRegistry.h" | |||||
#include "llvm/Remarks/HotnessThresholdParser.h" | #include "llvm/Remarks/HotnessThresholdParser.h" | ||||
#include "llvm/Support/CommandLine.h" | #include "llvm/Support/CommandLine.h" | ||||
#include "llvm/Support/Compression.h" | #include "llvm/Support/Compression.h" | ||||
#include "llvm/Support/FileSystem.h" | #include "llvm/Support/FileSystem.h" | ||||
#include "llvm/Support/GlobPattern.h" | #include "llvm/Support/GlobPattern.h" | ||||
#include "llvm/Support/LEB128.h" | #include "llvm/Support/LEB128.h" | ||||
#include "llvm/Support/Parallel.h" | #include "llvm/Support/Parallel.h" | ||||
#include "llvm/Support/Path.h" | #include "llvm/Support/Path.h" | ||||
▲ Show 20 Lines • Show All 1,271 Lines • ▼ Show 20 Lines | static void readConfigs(opt::InputArgList &args) { | ||||
// GCC collect2 passes -plugin-opt=path/to/lto-wrapper with an absolute or | // GCC collect2 passes -plugin-opt=path/to/lto-wrapper with an absolute or | ||||
// relative path. Just ignore. If not ended with "lto-wrapper", consider it an | // relative path. Just ignore. If not ended with "lto-wrapper", consider it an | ||||
// unsupported LLVMgold.so option and error. | // unsupported LLVMgold.so option and error. | ||||
for (opt::Arg *arg : args.filtered(OPT_plugin_opt_eq)) | for (opt::Arg *arg : args.filtered(OPT_plugin_opt_eq)) | ||||
if (!StringRef(arg->getValue()).endswith("lto-wrapper")) | if (!StringRef(arg->getValue()).endswith("lto-wrapper")) | ||||
error(arg->getSpelling() + ": unknown plugin option '" + arg->getValue() + | error(arg->getSpelling() + ": unknown plugin option '" + arg->getValue() + | ||||
"'"); | "'"); | ||||
config->passPlugins = args::getStrings(args, OPT_load_pass_plugins); | for (StringRef pluginPath : args::getStrings(args, OPT_load_pass_plugins)) { | ||||
auto plugin = PassPlugin::Load(std::string(pluginPath)); | |||||
if (!plugin) { | |||||
lld::errs() << "Failed to load passes from '" << pluginPath | |||||
<< "'. Request ignored.\n"; | |||||
continue; | |||||
} | |||||
PassPluginRegistry::addPlugin(std::move(plugin.get())); | |||||
} | |||||
// Parse -mllvm options. | // Parse -mllvm options. | ||||
for (auto *arg : args.filtered(OPT_mllvm)) | for (auto *arg : args.filtered(OPT_mllvm)) | ||||
parseClangOption(arg->getValue(), arg->getSpelling()); | parseClangOption(arg->getValue(), arg->getSpelling()); | ||||
// --threads= takes a positive integer and provides the default value for | // --threads= takes a positive integer and provides the default value for | ||||
// --thinlto-jobs=. | // --thinlto-jobs=. | ||||
if (auto *arg = args.getLastArg(OPT_threads)) { | if (auto *arg = args.getLastArg(OPT_threads)) { | ||||
▲ Show 20 Lines • Show All 1,466 Lines • Show Last 20 Lines |