31void DwarfCFIException::addPersonality(
const GlobalValue *Personality) {
33 Personalities.push_back(Personality);
51 for (
const GlobalValue *Personality : Personalities) {
55 Personalities.clear();
59 shouldEmitPersonality = shouldEmitLSDA =
false;
66 bool shouldEmitMoves =
72 if (
F.hasPersonalityFn())
73 Per = dyn_cast<GlobalValue>(
F.getPersonalityFn()->stripPointerCasts());
76 forceEmitPersonality =
78 F.hasPersonalityFn() &&
82 F.needsUnwindTableEntry();
84 shouldEmitPersonality =
85 (forceEmitPersonality ||
90 shouldEmitLSDA = shouldEmitPersonality &&
96 MAI.
usesCFIForEH() && (shouldEmitPersonality || shouldEmitMoves);
105 if (!hasEmittedCFISections) {
114 hasEmittedCFISections =
true;
120 if (!shouldEmitPersonality)
124 auto *
P = dyn_cast<GlobalValue>(
F.getPersonalityFn()->stripPointerCasts());
125 assert(
P &&
"Expected personality function");
148 if (!shouldEmitPersonality)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file contains constants used for implementing Dwarf debug support.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class is intended to be used as a driving class for all asm writers.
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
MCSymbol * getSymbol(const GlobalValue *GV) const
CFISection getModuleCFISectionType() const
Get the CFISection type for the module.
TargetMachine & TM
Target machine description.
MCSymbol * getMBBExceptionSym(const MachineBasicBlock &MBB)
const MCAsmInfo * MAI
Target Asm Printer information.
CFISection getFunctionCFISectionType(const Function &F) const
Get the CFISection type for a function.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
const DataLayout & getDataLayout() const
Return information about data layout.
bool usesCFIWithoutEH() const
Since emitting CFI unwind information is entangled with supporting the exceptions,...
@ None
Do not emit either .eh_frame or .debug_frame.
@ Debug
Emit .debug_frame.
void endBasicBlockSection(const MachineBasicBlock &MBB) override
Process the end of a basic-block-section within a function.
~DwarfCFIException() override
void beginBasicBlockSection(const MachineBasicBlock &MBB) override
Process the beginning of a new basic-block-section within a function.
void endFunction(const MachineFunction *) override
Gather and emit post-function exception information.
void endModule() override
Emit all exception information that should come after the content.
DwarfCFIException(AsmPrinter *A)
void beginFunction(const MachineFunction *MF) override
Gather pre-function exception information.
Emits exception handling directives.
AsmPrinter * Asm
Target of directive emission.
MCSymbol * emitExceptionTable()
Emit landing pads and actions.
MachineModuleInfo * MMI
Collected machine module information.
This class is intended to be used as a base class for asm properties and features specific to the tar...
bool usesCFIForEH() const
Returns true if the exception handling method for the platform uses call frame information to unwind.
ExceptionHandling getExceptionHandlingType() const
const MCAsmInfo * getAsmInfo() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MCContext & getContext() const
Function & getFunction()
Return the LLVM function that this machine code represents.
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
virtual void emitPersonalityValue(MCStreamer &Streamer, const DataLayout &TM, const MCSymbol *Sym) const
unsigned getLSDAEncoding() const
virtual MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const
unsigned getPersonalityEncoding() const
unsigned ForceDwarfFrameSection
Emit DWARF debug frame section.
This is an optimization pass for GlobalISel generic memory operations.
@ None
No exception support.
bool isNoOpWithoutInvoke(EHPersonality Pers)
Return true if this personality may be safely removed if there are no invoke instructions remaining i...
EHPersonality classifyEHPersonality(const Value *Pers)
See if the given exception handling personality function is one that we understand.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.