LLVM  13.0.0git
Macros | Functions | Variables
Debugify.cpp File Reference
#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 dependency graph for Debugify.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "debugify"
 

Functions

static bool applyDebugify (Function &F, enum DebugifyMode Mode=DebugifyMode::SyntheticDebugInfo, DebugInfoPerPassMap *DIPreservationMap=nullptr, StringRef NameOfWrappedPass="")
 
static bool applyDebugify (Module &M, enum DebugifyMode Mode=DebugifyMode::SyntheticDebugInfo, DebugInfoPerPassMap *DIPreservationMap=nullptr, StringRef NameOfWrappedPass="")
 
static bool checkFunctions (const DebugFnMap &DIFunctionsBefore, const DebugFnMap &DIFunctionsAfter, StringRef NameOfWrappedPass, StringRef FileNameFromCU)
 
static bool checkInstructions (const DebugInstMap &DILocsBefore, const DebugInstMap &DILocsAfter, const WeakInstValueMap &InstToDelete, StringRef NameOfWrappedPass, StringRef FileNameFromCU)
 
ModulePasscreateDebugifyModulePass (enum DebugifyMode Mode, llvm::StringRef NameOfWrappedPass, DebugInfoPerPassMap *DIPreservationMap)
 
FunctionPasscreateDebugifyFunctionPass (enum DebugifyMode Mode, llvm::StringRef NameOfWrappedPass, DebugInfoPerPassMap *DIPreservationMap)
 
ModulePasscreateCheckDebugifyModulePass (bool Strip, StringRef NameOfWrappedPass, DebugifyStatsMap *StatsMap, enum DebugifyMode Mode, DebugInfoPerPassMap *DIPreservationMap)
 
FunctionPasscreateCheckDebugifyFunctionPass (bool Strip, StringRef NameOfWrappedPass, DebugifyStatsMap *StatsMap, enum DebugifyMode Mode, DebugInfoPerPassMap *DIPreservationMap)
 
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")
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "debugify"

Definition at line 29 of file Debugify.cpp.

Function Documentation

◆ applyDebugify() [1/2]

static bool applyDebugify ( Function F,
enum DebugifyMode  Mode = DebugifyMode::SyntheticDebugInfo,
DebugInfoPerPassMap DIPreservationMap = nullptr,
StringRef  NameOfWrappedPass = "" 
)
static

◆ applyDebugify() [2/2]

static bool applyDebugify ( Module M,
enum DebugifyMode  Mode = DebugifyMode::SyntheticDebugInfo,
DebugInfoPerPassMap DIPreservationMap = nullptr,
StringRef  NameOfWrappedPass = "" 
)
static

◆ checkFunctions()

static bool checkFunctions ( const DebugFnMap DIFunctionsBefore,
const DebugFnMap DIFunctionsAfter,
StringRef  NameOfWrappedPass,
StringRef  FileNameFromCU 
)
static

◆ checkInstructions()

static bool checkInstructions ( const DebugInstMap DILocsBefore,
const DebugInstMap DILocsAfter,
const WeakInstValueMap InstToDelete,
StringRef  NameOfWrappedPass,
StringRef  FileNameFromCU 
)
static

◆ createCheckDebugifyFunctionPass()

FunctionPass* createCheckDebugifyFunctionPass ( bool  Strip,
StringRef  NameOfWrappedPass,
DebugifyStatsMap StatsMap,
enum DebugifyMode  Mode,
DebugInfoPerPassMap DIPreservationMap 
)

Definition at line 804 of file Debugify.cpp.

References assert(), Mode, OriginalDebugInfo, and SyntheticDebugInfo.

◆ createCheckDebugifyModulePass()

ModulePass* createCheckDebugifyModulePass ( bool  Strip,
StringRef  NameOfWrappedPass,
DebugifyStatsMap StatsMap,
enum DebugifyMode  Mode,
DebugInfoPerPassMap DIPreservationMap 
)

Definition at line 794 of file Debugify.cpp.

References assert(), Mode, OriginalDebugInfo, and SyntheticDebugInfo.

◆ createDebugifyFunctionPass()

FunctionPass* createDebugifyFunctionPass ( enum DebugifyMode  Mode,
llvm::StringRef  NameOfWrappedPass,
DebugInfoPerPassMap DIPreservationMap 
)

Definition at line 779 of file Debugify.cpp.

References assert(), Mode, OriginalDebugInfo, and SyntheticDebugInfo.

Referenced by llvm::DebugifyCustomPassManager::add().

◆ createDebugifyModulePass()

ModulePass* createDebugifyModulePass ( enum DebugifyMode  Mode,
llvm::StringRef  NameOfWrappedPass,
DebugInfoPerPassMap DIPreservationMap 
)

Definition at line 769 of file Debugify.cpp.

References assert(), Mode, OriginalDebugInfo, and SyntheticDebugInfo.

Referenced by llvm::DebugifyCustomPassManager::add().

◆ isIgnoredPass()

static bool isIgnoredPass ( StringRef  PassID)
static

Definition at line 821 of file Debugify.cpp.

References llvm::isSpecialPass().

Referenced by llvm::DebugifyEachInstrumentation::registerCallbacks().

Variable Documentation

◆ CDF

RegisterPass<CheckDebugifyFunctionPass> CDF("check-debugify-function", "Check debug info from -debugify-function")
static

◆ CDM

RegisterPass<CheckDebugifyModulePass> CDM("check-debugify", "Check debug info from -debugify")
static

◆ DF

RegisterPass<DebugifyFunctionPass> DF("debugify-function", "Attach debug info to a function")
static

Referenced by llvm::DILocation::cloneByMultiplyingDuplicationFactor(), llvm::DILocation::cloneWithBaseDiscriminator(), llvm::DILocation::decodeDiscriminator(), llvm::MCFragment::dump(), llvm::DWARFContext::dump(), llvm::MCELFStreamer::emitBundleLock(), llvm::MCELFStreamer::emitBundleUnlock(), llvm::MCObjectStreamer::emitBytes(), llvm::MCWinCOFFStreamer::EmitCOFFImgRel32(), llvm::MCWinCOFFStreamer::EmitCOFFSecRel32(), llvm::MCWinCOFFStreamer::EmitCOFFSectionIndex(), llvm::MCObjectStreamer::emitDTPRel32Value(), llvm::MCObjectStreamer::emitDTPRel64Value(), llvm::MCObjectStreamer::emitFill(), llvm::MCObjectStreamer::emitGPRel32Value(), llvm::MCObjectStreamer::emitGPRel64Value(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::MCXCOFFStreamer::emitInstToData(), llvm::MCWinCOFFStreamer::emitInstToData(), llvm::MCObjectStreamer::emitLabelAtPos(), llvm::MCObjectStreamer::emitNops(), llvm::MCObjectStreamer::emitRelocDirective(), llvm::MCObjectStreamer::emitTPRel32Value(), llvm::MCObjectStreamer::emitTPRel64Value(), llvm::MCObjectStreamer::emitValueImpl(), llvm::DILocation::encodeDiscriminator(), llvm::RISCVAsmBackend::evaluateTargetFixup(), llvm::MCAsmBackend::fixupNeedsRelaxationAdvanced(), llvm::DWARFContext::getDebugFrame(), llvm::DWARFContext::getEHFrame(), getOffsetAndDataFragment(), llvm::RISCVMCExpr::getPCRelHiFixup(), llvm::X86TargetLowering::getRegForInlineAsmConstraint(), llvm::MCInstrInfo::InitMCInstrInfo(), isRightAfterData(), llvm::MCAssembler::layout(), llvm::DominanceFrontierAnalysis::run(), llvm::RegionInfoAnalysis::run(), llvm::RegionInfoPass::runOnFunction(), llvm::MachineRegionInfoPass::runOnMachineFunction(), and llvm::MCAssembler::writeSectionData().

◆ DM

RegisterPass<DebugifyModulePass> DM("debugify", "Attach debug info to everything")
static