31void DwarfCFIException::addPersonality(
const GlobalValue *Personality) {
33 Personalities.push_back(Personality);
51 for (
const GlobalValue *Personality : Personalities) {
56 Personalities.clear();
60 shouldEmitPersonality = shouldEmitLSDA =
false;
67 bool shouldEmitMoves =
73 if (
F.hasPersonalityFn())
74 Per = dyn_cast<GlobalValue>(
F.getPersonalityFn()->stripPointerCasts());
77 forceEmitPersonality =
79 F.hasPersonalityFn() &&
83 F.needsUnwindTableEntry();
85 shouldEmitPersonality =
86 (forceEmitPersonality ||
91 shouldEmitLSDA = shouldEmitPersonality &&
97 MAI.
usesCFIForEH() && (shouldEmitPersonality || shouldEmitMoves);
106 if (!hasEmittedCFISections) {
115 hasEmittedCFISections =
true;
121 if (!shouldEmitPersonality)
125 auto *
P = dyn_cast<GlobalValue>(
F.getPersonalityFn()->stripPointerCasts());
126 assert(
P &&
"Expected personality function");
149 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.
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
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.
unsigned getLSDAEncoding() const
virtual MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const
unsigned getPersonalityEncoding() const
virtual void emitPersonalityValue(MCStreamer &Streamer, const DataLayout &TM, const MCSymbol *Sym, const MachineModuleInfo *MMI) 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.