Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/BackendUtil.cpp
Show All 35 Lines | |||||
#include "llvm/IR/PassManager.h" | #include "llvm/IR/PassManager.h" | ||||
#include "llvm/IR/Verifier.h" | #include "llvm/IR/Verifier.h" | ||||
#include "llvm/LTO/LTOBackend.h" | #include "llvm/LTO/LTOBackend.h" | ||||
#include "llvm/MC/MCAsmInfo.h" | #include "llvm/MC/MCAsmInfo.h" | ||||
#include "llvm/MC/SubtargetFeature.h" | #include "llvm/MC/SubtargetFeature.h" | ||||
#include "llvm/MC/TargetRegistry.h" | #include "llvm/MC/TargetRegistry.h" | ||||
#include "llvm/Object/OffloadBinary.h" | #include "llvm/Object/OffloadBinary.h" | ||||
#include "llvm/Passes/PassBuilder.h" | #include "llvm/Passes/PassBuilder.h" | ||||
#include "llvm/Passes/PassPlugin.h" | #include "llvm/Passes/PassPluginRegistry.h" | ||||
#include "llvm/Passes/StandardInstrumentations.h" | #include "llvm/Passes/StandardInstrumentations.h" | ||||
#include "llvm/Support/BuryPointer.h" | #include "llvm/Support/BuryPointer.h" | ||||
#include "llvm/Support/CommandLine.h" | #include "llvm/Support/CommandLine.h" | ||||
#include "llvm/Support/MemoryBuffer.h" | #include "llvm/Support/MemoryBuffer.h" | ||||
#include "llvm/Support/PrettyStackTrace.h" | #include "llvm/Support/PrettyStackTrace.h" | ||||
#include "llvm/Support/TimeProfiler.h" | #include "llvm/Support/TimeProfiler.h" | ||||
#include "llvm/Support/Timer.h" | #include "llvm/Support/Timer.h" | ||||
#include "llvm/Support/ToolOutputFile.h" | #include "llvm/Support/ToolOutputFile.h" | ||||
▲ Show 20 Lines • Show All 742 Lines • ▼ Show 20 Lines | if (CodeGenOpts.EnableDIPreservationVerify) { | ||||
Debugify.setDebugifyMode(DebugifyMode::OriginalDebugInfo); | Debugify.setDebugifyMode(DebugifyMode::OriginalDebugInfo); | ||||
Debugify.setDebugInfoBeforePass(DebugInfoBeforePass); | Debugify.setDebugInfoBeforePass(DebugInfoBeforePass); | ||||
if (!CodeGenOpts.DIBugsReportFilePath.empty()) | if (!CodeGenOpts.DIBugsReportFilePath.empty()) | ||||
Debugify.setOrigDIVerifyBugsReportFilePath( | Debugify.setOrigDIVerifyBugsReportFilePath( | ||||
CodeGenOpts.DIBugsReportFilePath); | CodeGenOpts.DIBugsReportFilePath); | ||||
Debugify.registerCallbacks(PIC); | Debugify.registerCallbacks(PIC); | ||||
} | } | ||||
// Attempt to load pass plugins and register their callbacks with PB. | // Register loaded pass plugins' callbacks with PB. | ||||
for (auto &PluginFN : CodeGenOpts.PassPlugins) { | for (auto const &Plugin : PassPluginRegistry::getPlugins()) { | ||||
auto PassPlugin = PassPlugin::Load(PluginFN); | Plugin.registerPassBuilderCallbacks(PB); | ||||
if (PassPlugin) { | |||||
PassPlugin->registerPassBuilderCallbacks(PB); | |||||
} else { | |||||
Diags.Report(diag::err_fe_unable_to_load_plugin) | |||||
<< PluginFN << toString(PassPlugin.takeError()); | |||||
} | |||||
} | } | ||||
#define HANDLE_EXTENSION(Ext) \ | #define HANDLE_EXTENSION(Ext) \ | ||||
get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB); | get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB); | ||||
#include "llvm/Support/Extension.def" | #include "llvm/Support/Extension.def" | ||||
// Register the target library analysis directly and give it a customized | // Register the target library analysis directly and give it a customized | ||||
// preset TLI. | // preset TLI. | ||||
std::unique_ptr<TargetLibraryInfoImpl> TLII( | std::unique_ptr<TargetLibraryInfoImpl> TLII( | ||||
▲ Show 20 Lines • Show All 419 Lines • Show Last 20 Lines |