Changeset View
Changeset View
Standalone View
Standalone View
llvm/tools/llvm-lto2/llvm-lto2.cpp
Show All 14 Lines | |||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#include "llvm/Bitcode/BitcodeReader.h" | #include "llvm/Bitcode/BitcodeReader.h" | ||||
#include "llvm/CodeGen/CommandFlags.h" | #include "llvm/CodeGen/CommandFlags.h" | ||||
#include "llvm/Config/llvm-config.h" | #include "llvm/Config/llvm-config.h" | ||||
#include "llvm/IR/DiagnosticPrinter.h" | #include "llvm/IR/DiagnosticPrinter.h" | ||||
#include "llvm/LTO/LTO.h" | #include "llvm/LTO/LTO.h" | ||||
#include "llvm/Passes/PassPlugin.h" | #include "llvm/Passes/PassPluginLoader.h" | ||||
#include "llvm/Remarks/HotnessThresholdParser.h" | #include "llvm/Remarks/HotnessThresholdParser.h" | ||||
#include "llvm/Support/Caching.h" | #include "llvm/Support/Caching.h" | ||||
#include "llvm/Support/CommandLine.h" | #include "llvm/Support/CommandLine.h" | ||||
#include "llvm/Support/FileSystem.h" | #include "llvm/Support/FileSystem.h" | ||||
#include "llvm/Support/InitLLVM.h" | #include "llvm/Support/InitLLVM.h" | ||||
#include "llvm/Support/PluginLoader.h" | #include "llvm/Support/PluginLoader.h" | ||||
#include "llvm/Support/TargetSelect.h" | #include "llvm/Support/TargetSelect.h" | ||||
#include "llvm/Support/Threading.h" | #include "llvm/Support/Threading.h" | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
static cl::opt<bool> | static cl::opt<bool> | ||||
DebugPassManager("debug-pass-manager", cl::Hidden, | DebugPassManager("debug-pass-manager", cl::Hidden, | ||||
cl::desc("Print pass management debugging information")); | cl::desc("Print pass management debugging information")); | ||||
static cl::opt<std::string> | static cl::opt<std::string> | ||||
StatsFile("stats-file", cl::desc("Filename to write statistics to")); | StatsFile("stats-file", cl::desc("Filename to write statistics to")); | ||||
static cl::list<std::string> | |||||
PassPlugins("load-pass-plugin", | |||||
cl::desc("Load passes from plugin library")); | |||||
static cl::opt<bool> EnableFreestanding( | static cl::opt<bool> EnableFreestanding( | ||||
"lto-freestanding", | "lto-freestanding", | ||||
cl::desc("Enable Freestanding (disable builtins / TLI) during LTO"), | cl::desc("Enable Freestanding (disable builtins / TLI) during LTO"), | ||||
cl::Hidden); | cl::Hidden); | ||||
static void check(Error E, std::string Msg) { | static void check(Error E, std::string Msg) { | ||||
if (!E) | if (!E) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | static int run(int argc, char **argv) { | ||||
Conf.RunCSIRInstr = RunCSIRInstr; | Conf.RunCSIRInstr = RunCSIRInstr; | ||||
// Run a custom pipeline, if asked for. | // Run a custom pipeline, if asked for. | ||||
Conf.OptPipeline = OptPipeline; | Conf.OptPipeline = OptPipeline; | ||||
Conf.AAPipeline = AAPipeline; | Conf.AAPipeline = AAPipeline; | ||||
Conf.OptLevel = OptLevel - '0'; | Conf.OptLevel = OptLevel - '0'; | ||||
Conf.Freestanding = EnableFreestanding; | Conf.Freestanding = EnableFreestanding; | ||||
for (auto &PluginFN : PassPlugins) | |||||
Conf.PassPlugins.push_back(PluginFN); | |||||
switch (CGOptLevel) { | switch (CGOptLevel) { | ||||
case '0': | case '0': | ||||
Conf.CGOptLevel = CodeGenOpt::None; | Conf.CGOptLevel = CodeGenOpt::None; | ||||
break; | break; | ||||
case '1': | case '1': | ||||
Conf.CGOptLevel = CodeGenOpt::Less; | Conf.CGOptLevel = CodeGenOpt::Less; | ||||
break; | break; | ||||
case '2': | case '2': | ||||
▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines |