56 forceEmitPersonality(
false), shouldEmitLSDA(
false),
57 shouldEmitMoves(
false) {}
86 return Asm->getMBBExceptionSym(*
MBB);
90 shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA =
false;
104 if (
F.hasPersonalityFn())
105 Per = dyn_cast<Function>(
F.getPersonalityFn()->stripPointerCasts());
108 forceEmitPersonality =
110 F.hasPersonalityFn() &&
114 F.needsUnwindTableEntry();
116 shouldEmitPersonality =
117 (forceEmitPersonality ||
122 shouldEmitLSDA = shouldEmitPersonality &&
126 (shouldEmitPersonality || shouldEmitMoves);
146 if (!shouldEmitPersonality)
150 auto *
P = dyn_cast<Function>(
F.getPersonalityFn()->stripPointerCasts());
151 assert(
P &&
"Expected personality function");
155 if (forceEmitPersonality)
171 if (!shouldEmitPersonality)
const MCAsmInfo * getAsmInfo() const
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
This class represents lattice values for constants.
virtual void emitPersonalityValue(MCStreamer &Streamer, const DataLayout &TM, const MCSymbol *Sym) const
static MCSymbol * getExceptionSym(AsmPrinter *Asm, const MachineBasicBlock *MBB)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool needsOnlyDebugCFIMoves() const
Returns false if needsCFIMoves() == CFI_M_EH for any function in the module.
void endFragment() override
CFIMoveType needsCFIMoves() const
void beginFragment(const MachineBasicBlock *MBB, ExceptionSymbolProvider ESP) override
bool shouldEmitCFI
Per-function flag to indicate if frame CFI info should be emitted.
MachineFunction * MF
The current machine function.
MachineModuleInfo & getMMI() const
void endBasicBlock(const MachineBasicBlock &MBB) override
Process end of a basic block during basic block sections.
DwarfCFIException(AsmPrinter *A)
Function & getFunction()
Return the LLVM function that this machine code represents.
MachineModuleInfo * MMI
Collected machine module information.
MCSymbol * ExceptionSymbolProvider(AsmPrinter *Asm, const MachineBasicBlock *MBB)
Emits exception handling directives.
DwarfCFIExceptionBase(AsmPrinter *A)
void endFunction(const MachineFunction *) override
Gather and emit post-function exception information.
~DwarfCFIException() override
unsigned getLSDAEncoding() const
bool hasBBSections() const
Returns true if this function has basic block sections enabled.
void tidyLandingPads(DenseMap< MCSymbol *, uintptr_t > *LPMap=nullptr, bool TidyIfNoBeginLabels=true)
Remap landing pad labels and remove any deleted landing pads.
const MCContext & getContext() const
void beginBasicBlock(const MachineBasicBlock &MBB) override
Process beginning of a basic block during basic block sections.
void beginFunction(const MachineFunction *MF) override
Gather pre-function exception information.
const MCAsmInfo * MAI
Target Asm Printer information.
void addPersonality(const Function *Personality)
Provide the personality function for the exception information.
TargetMachine & TM
Target machine description.
This class is intended to be used as a driving class for all asm writers.
EHPersonality classifyEHPersonality(const Value *Pers)
See if the given exception handling personality function is one that we understand.
void markFunctionEnd() override
unsigned ForceDwarfFrameSection
Emit DWARF debug frame section.
AsmPrinter * Asm
Target of directive emission.
bool hasEmittedCFISections
Per-module flag to indicate if .cfi_section has beeen emitted.
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
unsigned getPersonalityEncoding() const
MCSymbol * getSymbol(const GlobalValue *GV) const
Module.h This file contains the declarations for the Module class.
bool usesCFIForEH() const
Returns true if the exception handling method for the platform uses call frame information to unwind.
This file contains constants used for implementing Dwarf debug support.
void endModule() override
Emit all exception information that should come after the content.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCSymbol * emitExceptionTable()
Emit landing pads and actions.
const std::vector< const Function * > & getPersonalities() const
Return array of personality functions ever seen.
const DataLayout & getDataLayout() const
Return information about data layout.
virtual MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const
bool isNoOpWithoutInvoke(EHPersonality Pers)
Return true if this personality may be safely removed if there are no invoke instructions remaining i...