LLVM 20.0.0git
|
#include "llvm/Transforms/Utils/Debugify.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassInstrumentation.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/JSON.h"
#include <optional>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "debugify" |
Functions | |
static bool | applyDebugify (Function &F, enum DebugifyMode Mode=DebugifyMode::SyntheticDebugInfo, DebugInfoPerPass *DebugInfoBeforePass=nullptr, StringRef NameOfWrappedPass="") |
static bool | applyDebugify (Module &M, enum DebugifyMode Mode=DebugifyMode::SyntheticDebugInfo, DebugInfoPerPass *DebugInfoBeforePass=nullptr, StringRef NameOfWrappedPass="") |
static bool | checkFunctions (const DebugFnMap &DIFunctionsBefore, const DebugFnMap &DIFunctionsAfter, StringRef NameOfWrappedPass, StringRef FileNameFromCU, bool ShouldWriteIntoJSON, llvm::json::Array &Bugs) |
static bool | checkInstructions (const DebugInstMap &DILocsBefore, const DebugInstMap &DILocsAfter, const WeakInstValueMap &InstToDelete, StringRef NameOfWrappedPass, StringRef FileNameFromCU, bool ShouldWriteIntoJSON, llvm::json::Array &Bugs) |
static bool | checkVars (const DebugVarMap &DIVarsBefore, const DebugVarMap &DIVarsAfter, StringRef NameOfWrappedPass, StringRef FileNameFromCU, bool ShouldWriteIntoJSON, llvm::json::Array &Bugs) |
static void | writeJSON (StringRef OrigDIVerifyBugsReportFilePath, StringRef FileNameFromCU, StringRef NameOfWrappedPass, llvm::json::Array &Bugs) |
ModulePass * | createDebugifyModulePass (enum DebugifyMode Mode, llvm::StringRef NameOfWrappedPass, DebugInfoPerPass *DebugInfoBeforePass) |
FunctionPass * | createDebugifyFunctionPass (enum DebugifyMode Mode, llvm::StringRef NameOfWrappedPass, DebugInfoPerPass *DebugInfoBeforePass) |
ModulePass * | createCheckDebugifyModulePass (bool Strip, StringRef NameOfWrappedPass, DebugifyStatsMap *StatsMap, enum DebugifyMode Mode, DebugInfoPerPass *DebugInfoBeforePass, StringRef OrigDIVerifyBugsReportFilePath) |
FunctionPass * | createCheckDebugifyFunctionPass (bool Strip, StringRef NameOfWrappedPass, DebugifyStatsMap *StatsMap, enum DebugifyMode Mode, DebugInfoPerPass *DebugInfoBeforePass, StringRef OrigDIVerifyBugsReportFilePath) |
static bool | isIgnoredPass (StringRef PassID) |
Variables | |
static RegisterPass< DebugifyModulePass > | DM ("debugify", "Attach debug info to everything") |
static RegisterPass< CheckDebugifyModulePass > | CDM ("check-debugify", "Check debug info from -debugify") |
static RegisterPass< DebugifyFunctionPass > | DF ("debugify-function", "Attach debug info to a function") |
static RegisterPass< CheckDebugifyFunctionPass > | CDF ("check-debugify-function", "Check debug info from -debugify-function") |
#define DEBUG_TYPE "debugify" |
Definition at line 32 of file Debugify.cpp.
|
static |
Definition at line 217 of file Debugify.cpp.
References llvm::applyDebugifyMetadata(), assert(), llvm::collectDebugInfoMetadata(), F, llvm::make_range(), and SyntheticDebugInfo.
Referenced by llvm::DebugifyEachInstrumentation::registerCallbacks().
|
static |
Definition at line 233 of file Debugify.cpp.
References llvm::applyDebugifyMetadata(), llvm::collectDebugInfoMetadata(), and SyntheticDebugInfo.
|
static |
Definition at line 378 of file Debugify.cpp.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), F, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::find(), and llvm::json::Array::push_back().
Referenced by llvm::checkDebugInfoMetadata().
|
static |
Definition at line 420 of file Debugify.cpp.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::find(), llvm::Instruction::getOpcodeName(), and llvm::json::Array::push_back().
Referenced by llvm::checkDebugInfoMetadata().
|
static |
Definition at line 481 of file Debugify.cpp.
References llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::find(), getName(), getSubprogram(), and llvm::json::Array::push_back().
Referenced by llvm::checkDebugInfoMetadata().
FunctionPass * createCheckDebugifyFunctionPass | ( | bool | Strip, |
StringRef | NameOfWrappedPass, | ||
DebugifyStatsMap * | StatsMap, | ||
enum DebugifyMode | Mode, | ||
DebugInfoPerPass * | DebugInfoBeforePass, | ||
StringRef | OrigDIVerifyBugsReportFilePath | ||
) |
Definition at line 1025 of file Debugify.cpp.
References assert(), OriginalDebugInfo, and SyntheticDebugInfo.
Referenced by llvm::DebugifyCustomPassManager::add().
ModulePass * createCheckDebugifyModulePass | ( | bool | Strip, |
StringRef | NameOfWrappedPass, | ||
DebugifyStatsMap * | StatsMap, | ||
enum DebugifyMode | Mode, | ||
DebugInfoPerPass * | DebugInfoBeforePass, | ||
StringRef | OrigDIVerifyBugsReportFilePath | ||
) |
Definition at line 1013 of file Debugify.cpp.
References assert(), OriginalDebugInfo, and SyntheticDebugInfo.
Referenced by llvm::DebugifyCustomPassManager::add().
FunctionPass * createDebugifyFunctionPass | ( | enum DebugifyMode | Mode, |
llvm::StringRef | NameOfWrappedPass, | ||
DebugInfoPerPass * | DebugInfoBeforePass | ||
) |
Definition at line 990 of file Debugify.cpp.
References assert(), OriginalDebugInfo, and SyntheticDebugInfo.
Referenced by llvm::DebugifyCustomPassManager::add().
ModulePass * createDebugifyModulePass | ( | enum DebugifyMode | Mode, |
llvm::StringRef | NameOfWrappedPass, | ||
DebugInfoPerPass * | DebugInfoBeforePass | ||
) |
Definition at line 980 of file Debugify.cpp.
References assert(), OriginalDebugInfo, and SyntheticDebugInfo.
Referenced by llvm::DebugifyCustomPassManager::add().
Definition at line 1051 of file Debugify.cpp.
References llvm::isSpecialPass().
Referenced by llvm::DebugifyEachInstrumentation::registerCallbacks().
|
static |
Definition at line 514 of file Debugify.cpp.
References llvm::errs(), llvm::sys::fs::OF_Append, llvm::sys::fs::OF_TextWithCRLF, and PassName.
Referenced by llvm::checkDebugInfoMetadata().
|
static |
|
static |
|
static |
Referenced by AttemptToFoldSymbolOffsetDifference(), llvm::DILocation::cloneByMultiplyingDuplicationFactor(), llvm::DILocation::cloneWithBaseDiscriminator(), llvm::DILocation::decodeDiscriminator(), llvm::MCFragment::dump(), llvm::DWARFContext::dump(), llvm::MCObjectStreamer::emitBytes(), llvm::MCWinCOFFStreamer::emitCOFFImgRel32(), llvm::MCWinCOFFStreamer::emitCOFFSecRel32(), llvm::MCWinCOFFStreamer::emitCOFFSectionIndex(), llvm::MCObjectStreamer::emitDTPRel32Value(), llvm::MCObjectStreamer::emitDTPRel64Value(), llvm::MCObjectStreamer::emitGPRel32Value(), llvm::MCObjectStreamer::emitGPRel64Value(), llvm::MCXCOFFStreamer::emitInstToData(), llvm::MCWinCOFFStreamer::emitInstToData(), llvm::MCObjectStreamer::emitRelocDirective(), llvm::MCObjectStreamer::emitTPRel32Value(), llvm::MCObjectStreamer::emitTPRel64Value(), llvm::MCObjectStreamer::emitValueImpl(), llvm::MCXCOFFStreamer::emitXCOFFRefDirective(), llvm::DILocation::encodeDiscriminator(), llvm::RISCVAsmBackend::evaluateTargetFixup(), getOffsetAndDataFragment(), llvm::RISCVMCExpr::getPCRelHiFixup(), llvm::MCInstrInfo::InitMCInstrInfo(), isRightAfterData(), llvm::MCAssembler::layout(), llvm::MCAssembler::layoutBundle(), llvm::LoongArchAsmBackend::relaxDwarfCFA(), llvm::RISCVAsmBackend::relaxDwarfCFA(), llvm::LoongArchAsmBackend::relaxDwarfLineAddr(), llvm::RISCVAsmBackend::relaxDwarfLineAddr(), llvm::DominanceFrontierAnalysis::run(), llvm::RegionInfoAnalysis::run(), llvm::RegionInfoPass::runOnFunction(), llvm::MachineRegionInfoPass::runOnMachineFunction(), and llvm::MCAssembler::writeSectionData().
|
static |
Referenced by llvm::PMDataManager::add(), llvm::rdf::DataFlowGraph::build(), llvm::BasicBlock::createMarker(), llvm::BasicBlock::getMarker(), llvm::pdb::UDTLayoutBase::initializeChildren(), llvm::PPC::isXXPERMDIShuffleMask(), llvm::BasicBlock::reinsertInstInDbgRecords(), and llvm::PMTopLevelManager::schedulePass().