LLVM: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

25using namespace llvm;

26

28

30

31void DwarfCFIException::addPersonality(const GlobalValue *Personality) {

33 Personalities.push_back(Personality);

34}

35

36

37

39

41 return;

42

44

46

48 return;

49

50

51 for (const GlobalValue *Personality : Personalities) {

55 }

56 Personalities.clear();

57}

58

60 shouldEmitPersonality = shouldEmitLSDA = false;

62

63

65

66

67 bool shouldEmitMoves =

69

73 if (F.hasPersonalityFn())

74 Per = dyn_cast(F.getPersonalityFn()->stripPointerCasts());

75

76

77 forceEmitPersonality =

78

79 F.hasPersonalityFn() &&

80

82

83 F.needsUnwindTableEntry();

84

85 shouldEmitPersonality =

86 (forceEmitPersonality ||

88 Per;

89

91 shouldEmitLSDA = shouldEmitPersonality &&

93

96 shouldEmitCFI =

97 MAI.usesCFIForEH() && (shouldEmitPersonality || shouldEmitMoves);

98 else

100}

101

103 if (!shouldEmitCFI)

104 return;

105

106 if (!hasEmittedCFISections) {

108

109

110

115 hasEmittedCFISections = true;

116 }

117

118 Asm->OutStreamer->emitCFIStartProc(false);

119

120

121 if (!shouldEmitPersonality)

122 return;

123

125 auto *P = dyn_cast(F.getPersonalityFn()->stripPointerCasts());

126 assert(P && "Expected personality function");

127

128 addPersonality(P);

129

134

135

136 if (shouldEmitLSDA)

139}

140

142 if (shouldEmitCFI)

144}

145

146

147

149 if (!shouldEmitPersonality)

150 return;

151

153}

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.