39 useImageRel32 =
A->TM.getTargetTriple().getArch() !=
Triple::x86;
40 isAArch64 =
Asm->TM.getTargetTriple().isAArch64();
41 isThumb =
Asm->TM.getTargetTriple().isThumb();
49 auto &OS = *
Asm->OutStreamer;
52 if (
F.hasFnAttribute(
"safeseh"))
53 OS.emitCOFFSafeSEH(
Asm->getSymbol(&
F));
55 if (M->getModuleFlag(
"ehcontguard") && !EHContTargets.empty()) {
57 OS.switchSection(
Asm->OutContext.getObjectFileInfo()->getGEHContSection());
58 for (
const MCSymbol *S : EHContTargets) {
59 OS.emitCOFFSymbolIndex(S);
65 shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA =
false;
73 shouldEmitMoves =
Asm->needsSEHMoves() && MF->
hasWinCFI();
80 if (
F.hasPersonalityFn()) {
85 bool forceEmitPersonality =
F.hasPersonalityFn() &&
87 F.needsUnwindTableEntry();
92 shouldEmitPersonality =
93 (forceEmitPersonality || ((hasLandingPads || hasEHFunclets) &&
98 shouldEmitLSDA = shouldEmitPersonality &&
103 if (!
Asm->MAI.usesWindowsCFI()) {
111 emitEHRegistrationOffsetLabel(FuncInfo, FLinkageName);
113 shouldEmitLSDA = hasEHFunclets;
114 shouldEmitPersonality =
false;
122 if (isAArch64 && CurrentFuncletEntry &&
123 (shouldEmitMoves || shouldEmitPersonality))
124 Asm->OutStreamer->emitWinCFIFuncletOrFuncEnd();
130 if (!shouldEmitPersonality && !shouldEmitMoves && !shouldEmitLSDA)
135 if (
F.hasPersonalityFn())
144 if (shouldEmitPersonality || shouldEmitLSDA) {
145 Asm->OutStreamer->pushSection();
148 MCSection *XData =
Asm->OutStreamer->getAssociatedXDataSection(
149 Asm->OutStreamer->getCurrentSectionOnly());
150 Asm->OutStreamer->switchSection(XData);
155 emitCSpecificHandlerTable(MF);
157 emitExceptHandlerTable(MF);
159 emitCXXFrameHandler3Table(MF);
161 emitCLRExceptionTable(MF);
165 Asm->OutStreamer->popSection();
188 StringRef HandlerPrefix =
MBB->isCleanupFuncletEntry() ?
"dtor" :
"catch";
189 return Ctx.getOrCreateSymbol(
"?" + HandlerPrefix +
"$" +
191 FuncLinkageName +
"@4HA");
196 CurrentFuncletEntry = &
MBB;
204 Asm->OutStreamer->beginCOFFSymbolDef(Sym);
208 Asm->OutStreamer->endCOFFSymbolDef();
213 std::max(
Asm->MF->getPreferredAlignment(),
MBB.getAlignment()), &
F);
216 Asm->OutStreamer->emitLabel(Sym);
220 if (shouldEmitMoves || shouldEmitPersonality) {
221 CurrentFuncletTextSection =
Asm->OutStreamer->getCurrentSectionOnly();
222 Asm->OutStreamer->emitWinCFIStartProc(Sym);
225 if (shouldEmitPersonality) {
230 if (
F.hasPersonalityFn())
240 if (!CurrentFuncletEntry->isCleanupFuncletEntry())
241 Asm->OutStreamer->emitWinEHHandler(PersHandlerSym,
true,
true);
246 if (isAArch64 && CurrentFuncletEntry &&
247 (shouldEmitMoves || shouldEmitPersonality)) {
248 Asm->OutStreamer->switchSection(CurrentFuncletTextSection);
249 Asm->OutStreamer->emitWinCFIFuncletOrFuncEnd();
254void WinException::endFuncletImpl() {
256 if (!CurrentFuncletEntry)
260 if (shouldEmitMoves || shouldEmitPersonality) {
263 if (
F.hasPersonalityFn())
275 Twine(
"$cppxdata$", FuncLinkageName));
284 emitCSpecificHandlerTable(MF);
285 }
else if (shouldEmitPersonality || shouldEmitLSDA) {
287 Asm->OutStreamer->emitWinEHHandlerData();
305 Asm->OutStreamer->switchSection(CurrentFuncletTextSection);
306 Asm->OutStreamer->emitWinCFIEndProc();
310 CurrentFuncletEntry =
nullptr;
323 return create32bitRef(
Asm->getSymbol(GV));
338const MCExpr *WinException::getOffsetPlusOne(
const MCSymbol *OffsetOf,
345int WinException::getFrameIndexOffset(
int FrameIndex,
347 const TargetFrameLowering &TFI = *
Asm->MF->getSubtarget().getFrameLowering();
349 if (
Asm->MAI.usesWindowsCFI()) {
354 Asm->MF->getSubtarget()
356 ->getStackPointerRegisterToSaveRestore());
366 "Frame offsets with a scalable component are not supported");
373const int NullState = -1;
375struct InvokeStateChange {
397class InvokeStateChangeIterator {
398 InvokeStateChangeIterator(
const WinEHFuncInfo &EHInfo,
403 : EHInfo(EHInfo), MFI(MFI), MFE(MFE),
MBBI(
MBBI), BaseState(BaseState) {
404 LastStateChange.PreviousEndLabel =
nullptr;
405 LastStateChange.NewStartLabel =
nullptr;
406 LastStateChange.NewState = BaseState;
417 auto BlockBegin = Begin->begin();
418 auto BlockEnd = std::prev(End)->end();
420 InvokeStateChangeIterator(EHInfo, Begin, End, BlockBegin, BaseState),
421 InvokeStateChangeIterator(EHInfo, End, End, BlockEnd, BaseState));
425 bool operator==(
const InvokeStateChangeIterator &O)
const {
426 assert(BaseState ==
O.BaseState);
437 return CurrentEndLabel ==
O.CurrentEndLabel;
440 bool operator!=(
const InvokeStateChangeIterator &O)
const {
443 InvokeStateChange &
operator*() {
return LastStateChange; }
444 InvokeStateChange *operator->() {
return &LastStateChange; }
445 InvokeStateChangeIterator &operator++() {
return scan(); }
448 InvokeStateChangeIterator &scan();
450 const WinEHFuncInfo &EHInfo;
451 const MCSymbol *CurrentEndLabel =
nullptr;
455 InvokeStateChange LastStateChange;
456 bool VisitingInvoke =
false;
462InvokeStateChangeIterator &InvokeStateChangeIterator::scan() {
463 bool IsNewBlock =
false;
464 for (; MFI != MFE; ++MFI, IsNewBlock =
true) {
467 for (
auto MBBE = MFI->end();
MBBI != MBBE; ++
MBBI) {
469 if (!VisitingInvoke && LastStateChange.NewState != BaseState &&
474 LastStateChange.PreviousEndLabel = CurrentEndLabel;
475 LastStateChange.NewStartLabel =
nullptr;
476 LastStateChange.NewState = BaseState;
477 CurrentEndLabel =
nullptr;
487 if (Label == CurrentEndLabel) {
488 VisitingInvoke =
false;
495 auto &StateAndEnd = InvokeMapIter->second;
496 int NewState = StateAndEnd.first;
499 VisitingInvoke =
true;
500 if (NewState == LastStateChange.NewState) {
503 CurrentEndLabel = StateAndEnd.second;
507 LastStateChange.PreviousEndLabel = CurrentEndLabel;
508 LastStateChange.NewStartLabel =
Label;
509 LastStateChange.NewState = NewState;
511 CurrentEndLabel = StateAndEnd.second;
518 if (LastStateChange.NewState != BaseState) {
520 LastStateChange.PreviousEndLabel = CurrentEndLabel;
521 LastStateChange.NewStartLabel =
nullptr;
522 LastStateChange.NewState = BaseState;
524 assert(CurrentEndLabel !=
nullptr);
528 CurrentEndLabel =
nullptr;
560void WinException::emitCSpecificHandlerTable(
const MachineFunction *MF) {
561 auto &OS = *
Asm->OutStreamer;
562 MCContext &Ctx =
Asm->OutContext;
565 bool VerboseAsm = OS.isVerboseAsm();
566 auto AddComment = [&](
const Twine &
Comment) {
568 OS.AddComment(Comment);
574 StringRef FLinkageName =
578 const MCExpr *MCOffset =
580 Asm->OutStreamer->emitAssignment(ParentFrameOffset, MCOffset);
589 const MCExpr *LabelDiff = getOffset(TableEnd, TableBegin);
592 AddComment(
"Number of call sites");
593 OS.emitValue(EntryCount, 4);
595 OS.emitLabel(TableBegin);
604 const MCSymbol *LastStartLabel =
nullptr;
605 int LastEHState = -1;
610 while (Stop != End && !Stop->isEHFuncletEntry())
612 for (
const auto &StateChange :
613 InvokeStateChangeIterator::range(FuncInfo, MF->
begin(), Stop)) {
616 if (LastEHState != -1)
617 emitSEHActionsForRange(FuncInfo, LastStartLabel,
618 StateChange.PreviousEndLabel, LastEHState);
619 LastStartLabel = StateChange.NewStartLabel;
620 LastEHState = StateChange.NewState;
623 OS.emitLabel(TableEnd);
626void WinException::emitSEHActionsForRange(
const WinEHFuncInfo &FuncInfo,
628 const MCSymbol *EndLabel,
int State) {
629 auto &OS = *
Asm->OutStreamer;
630 MCContext &Ctx =
Asm->OutContext;
631 bool VerboseAsm = OS.isVerboseAsm();
632 auto AddComment = [&](
const Twine &
Comment) {
634 OS.AddComment(Comment);
637 assert(BeginLabel && EndLabel);
638 while (State != -1) {
639 const SEHUnwindMapEntry &UME = FuncInfo.
SEHUnwindMap[State];
640 const MCExpr *FilterOrFinally;
641 const MCExpr *ExceptOrNull;
649 FilterOrFinally = UME.
Filter ? create32bitRef(UME.
Filter)
650 : MCConstantExpr::create(1, Ctx);
651 ExceptOrNull = create32bitRef(Handler->getSymbol());
654 AddComment(
"LabelStart");
655 OS.emitValue(getLabel(BeginLabel), 4);
656 AddComment(
"LabelEnd");
657 OS.emitValue(getLabel(EndLabel), 4);
658 AddComment(UME.
IsFinally ?
"FinallyFunclet" : UME.
Filter ?
"FilterFunction"
660 OS.emitValue(FilterOrFinally, 4);
661 AddComment(UME.
IsFinally ?
"Null" :
"ExceptionHandler");
662 OS.emitValue(ExceptOrNull, 4);
669void WinException::emitCXXFrameHandler3Table(
const MachineFunction *MF) {
671 auto &OS = *
Asm->OutStreamer;
678 if (shouldEmitPersonality) {
682 Asm->OutContext.getOrCreateSymbol(Twine(
"$cppxdata$", FuncLinkageName));
683 computeIP2StateTable(MF, FuncInfo, IPToStateTable);
685 FuncInfoXData =
Asm->OutContext.getOrCreateLSDASymbol(FuncLinkageName);
688 int UnwindHelpOffset = 0;
693 if (
Asm->MAI.usesWindowsCFI() &&
699 MCSymbol *TryBlockMapXData =
nullptr;
702 UnwindMapXData =
Asm->OutContext.getOrCreateSymbol(
703 Twine(
"$stateUnwindMap$", FuncLinkageName));
706 Asm->OutContext.getOrCreateSymbol(Twine(
"$tryMap$", FuncLinkageName));
707 if (!IPToStateTable.
empty())
709 Asm->OutContext.getOrCreateSymbol(Twine(
"$ip2state$", FuncLinkageName));
711 bool VerboseAsm = OS.isVerboseAsm();
712 auto AddComment = [&](
const Twine &
Comment) {
714 OS.AddComment(Comment);
732 OS.emitValueToAlignment(
Align(4));
733 OS.emitLabel(FuncInfoXData);
735 AddComment(
"MagicNumber");
736 OS.emitInt32(0x19930522);
738 AddComment(
"MaxState");
741 AddComment(
"UnwindMap");
742 OS.emitValue(create32bitRef(UnwindMapXData), 4);
744 AddComment(
"NumTryBlocks");
747 AddComment(
"TryBlockMap");
748 OS.emitValue(create32bitRef(TryBlockMapXData), 4);
750 AddComment(
"IPMapEntries");
751 OS.emitInt32(IPToStateTable.
size());
753 AddComment(
"IPToStateXData");
754 OS.emitValue(create32bitRef(IPToStateXData), 4);
756 if (
Asm->MAI.usesWindowsCFI() &&
758 AddComment(
"UnwindHelp");
759 OS.emitInt32(UnwindHelpOffset);
762 AddComment(
"ESTypeList");
765 AddComment(
"EHFlags");
766 if (
MMI->getModule()->getModuleFlag(
"eh-asynch")) {
776 if (UnwindMapXData) {
777 OS.emitLabel(UnwindMapXData);
778 for (
const CxxUnwindMapEntry &UME : FuncInfo.
CxxUnwindMap) {
781 AddComment(
"ToState");
784 AddComment(
"Action");
785 OS.emitValue(create32bitRef(CleanupSym), 4);
796 if (TryBlockMapXData) {
797 OS.emitLabel(TryBlockMapXData);
800 const WinEHTryBlockMapEntry &TBME = FuncInfo.
TryBlockMap[
I];
802 MCSymbol *HandlerMapXData =
nullptr;
805 Asm->OutContext.getOrCreateSymbol(Twine(
"$handlerMap$")
808 .
concat(FuncLinkageName));
816 "bad trymap interval");
818 AddComment(
"TryLow");
819 OS.emitInt32(TBME.
TryLow);
821 AddComment(
"TryHigh");
824 AddComment(
"CatchHigh");
827 AddComment(
"NumCatches");
830 AddComment(
"HandlerArray");
831 OS.emitValue(create32bitRef(HandlerMapXData), 4);
835 unsigned ParentFrameOffset = 0;
836 if (shouldEmitPersonality) {
842 const WinEHTryBlockMapEntry &TBME = FuncInfo.
TryBlockMap[
I];
843 MCSymbol *HandlerMapXData = HandlerMaps[
I];
844 if (!HandlerMapXData)
853 OS.emitLabel(HandlerMapXData);
858 const MCExpr *FrameAllocOffsetRef =
nullptr;
861 assert(
Offset != 0 &&
"Illegal offset for catch object!");
870 AddComment(
"Adjectives");
876 AddComment(
"CatchObjOffset");
877 OS.emitValue(FrameAllocOffsetRef, 4);
879 AddComment(
"Handler");
880 OS.emitValue(create32bitRef(HandlerSym), 4);
882 if (shouldEmitPersonality) {
883 AddComment(
"ParentFrameOffset");
884 OS.emitInt32(ParentFrameOffset);
894 if (IPToStateXData) {
895 OS.emitLabel(IPToStateXData);
896 for (
auto &IPStatePair : IPToStateTable) {
898 OS.emitValue(IPStatePair.first, 4);
899 AddComment(
"ToState");
900 OS.emitInt32(IPStatePair.second);
905void WinException::computeIP2StateTable(
910 FuncletEnd = MF->
begin(),
912 FuncletStart != End; FuncletStart = FuncletEnd) {
914 while (++FuncletEnd != End) {
915 if (FuncletEnd->isEHFuncletEntry()) {
923 if (FuncletStart->isCleanupFuncletEntry())
928 if (FuncletStart == MF->
begin()) {
929 BaseState = NullState;
930 StartLabel =
Asm->getFunctionBegin();
933 FuncletStart->getBasicBlock()->getFirstNonPHIIt());
938 assert(StartLabel &&
"need local function start label");
939 IPToStateTable.push_back(
940 std::make_pair(create32bitRef(StartLabel), BaseState));
942 for (
const auto &StateChange : InvokeStateChangeIterator::range(
943 FuncInfo, FuncletStart, FuncletEnd, BaseState)) {
948 const MCSymbol *ChangeLabel = StateChange.NewStartLabel;
950 ChangeLabel = StateChange.PreviousEndLabel;
952 const MCExpr *LabelExpression = getLabel(ChangeLabel);
953 IPToStateTable.push_back(
954 std::make_pair(LabelExpression, StateChange.NewState));
960void WinException::emitEHRegistrationOffsetLabel(
const WinEHFuncInfo &FuncInfo,
974 const TargetFrameLowering *TFI =
Asm->MF->getSubtarget().getFrameLowering();
978 MCContext &Ctx =
Asm->OutContext;
981 Asm->OutStreamer->emitAssignment(ParentFrameOffset,
989 MCStreamer &OS = *
Asm->OutStreamer;
994 auto AddComment = [&](
const Twine &
Comment) {
1000 emitEHRegistrationOffsetLabel(FuncInfo, FLinkageName);
1003 MCSymbol *LSDALabel =
Asm->OutContext.getOrCreateLSDASymbol(FLinkageName);
1007 const auto *Per =
cast<Function>(
F.getPersonalityFn()->stripPointerCasts());
1008 StringRef PerName = Per->getName();
1010 if (PerName ==
"_except_handler4") {
1033 int GSCookieOffset = -2;
1045 int EHCookieOffset = 9999;
1054 AddComment(
"GSCookieOffset");
1056 AddComment(
"GSCookieXOROffset");
1058 AddComment(
"EHCookieOffset");
1060 AddComment(
"EHCookieXOROffset");
1066 for (
const SEHUnwindMapEntry &UME : FuncInfo.
SEHUnwindMap) {
1073 AddComment(
"ToState");
1075 AddComment(UME.
IsFinally ?
"Null" :
"FilterFunction");
1077 AddComment(UME.
IsFinally ?
"FinallyFunclet" :
"ExceptionHandler");
1078 OS.
emitValue(create32bitRef(ExceptOrFinally), 4);
1084 while (State != -1) {
1095 while (LeftRank < RightRank) {
1100 while (RightRank < LeftRank) {
1117 MCStreamer &OS = *
Asm->OutStreamer;
1134 assert(NumStates > 0 &&
"Don't need exception table!");
1135 DenseMap<const MachineBasicBlock *, int> HandlerStates;
1136 for (
int State = 0; State < NumStates; ++State) {
1137 MachineBasicBlock *HandlerBlock =
1139 HandlerStates[HandlerBlock] = State;
1144 "ill-formed state numbering");
1147 HandlerStates[&MF->
front()] = NullState;
1172 std::unique_ptr<MCSymbol *[]> EndSymbolMap(
new MCSymbol *[NumStates]);
1173 SmallVector<int, 4> MinClauseMap((
size_t)NumStates, NumStates);
1177 FuncletEnd = MF->
begin(),
1179 FuncletStart != End; FuncletStart = FuncletEnd) {
1180 int FuncletState = HandlerStates[&*FuncletStart];
1183 while (++FuncletEnd != End) {
1184 if (FuncletEnd->isEHFuncletEntry()) {
1191 OS.
emitValue(getOffset(EndSymbol, FuncBeginSym), 4);
1192 if (FuncletState != NullState) {
1194 EndSymbolMap[FuncletState] = EndSymbol;
1199 const MCSymbol *CurrentStartLabel =
nullptr;
1200 int CurrentState = NullState;
1202 for (
const auto &StateChange :
1203 InvokeStateChangeIterator::range(FuncInfo, FuncletStart, FuncletEnd)) {
1205 int StillPendingState =
1207 while (CurrentState != StillPendingState) {
1208 assert(CurrentState != NullState &&
1209 "Failed to find still-pending state!");
1211 Clauses.
push_back({CurrentStartLabel, StateChange.PreviousEndLabel,
1212 CurrentState, FuncletState});
1214 CurrentState = FuncInfo.
ClrEHUnwindMap[CurrentState].TryParentState;
1217 if (HandlerStack.
back().second == CurrentState)
1221 if (StateChange.NewState != CurrentState) {
1225 for (
int EnteredState = StateChange.NewState;
1226 EnteredState != CurrentState;
1229 int &MinEnclosingState = MinClauseMap[EnteredState];
1230 if (FuncletState < MinEnclosingState)
1231 MinEnclosingState = FuncletState;
1235 HandlerStack.
emplace_back(CurrentStartLabel, CurrentState);
1236 CurrentStartLabel = StateChange.NewStartLabel;
1237 CurrentState = StateChange.NewState;
1245 for (ClrClause &Clause : Clauses) {
1294 const MCExpr *ClauseBegin =
1295 getOffsetPlusOne(Clause.StartLabel, FuncBeginSym);
1296 const MCExpr *ClauseEnd = getOffsetPlusOne(Clause.EndLabel, FuncBeginSym);
1301 const MCExpr *HandlerBegin = getOffset(BeginSym, FuncBeginSym);
1302 MCSymbol *EndSym = EndSymbolMap[Clause.State];
1303 const MCExpr *HandlerEnd = getOffset(EndSym, FuncBeginSym);
1306 switch (
Entry.HandlerType) {
1320 if (Clause.EnclosingState != MinClauseMap[Clause.State]) {
1323 assert(Clause.EnclosingState > MinClauseMap[Clause.State]);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator MBBI
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains constants used for implementing Dwarf debug support.
Module.h This file contains the declarations for the Module class.
Promote Memory to Register
This file describes how to lower LLVM code to machine code.
static int getTryAncestor(const WinEHFuncInfo &FuncInfo, int Left, int Right)
static int getTryRank(const WinEHFuncInfo &FuncInfo, int State)
static MCSymbol * getMCSymbolForMBB(AsmPrinter *Asm, const MachineBasicBlock *MBB)
Retrieve the MCSymbol for a GlobalValue or MachineBasicBlock.
This class is intended to be used as a driving class for all asm writers.
MachineFunction * MF
The current machine function.
MCContext & OutContext
This is the context for the output file that we are streaming.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
static bool callToNoUnwindFunction(const MachineInstr *MI)
Return ‘true’ if this is a call to a function marked ‘nounwind’.
AsmPrinter * Asm
Target of directive emission.
MCSymbol * emitExceptionTable()
Emit landing pads and actions.
MachineModuleInfo * MMI
Collected machine module information.
EHStreamer(AsmPrinter *A)
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1',...
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
static const MCBinaryExpr * createDiv(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
LLVM_ABI MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
LLVM_ABI MCSymbol * getOrCreateParentFrameOffsetSymbol(const Twine &FuncName)
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
virtual bool isVerboseAsm() const
Return true if this streamer supports verbose assembly and if it is enabled.
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
virtual void emitValueToAlignment(Align Alignment, int64_t Fill=0, uint8_t FillLen=1, unsigned MaxBytesToEmit=0)
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
void emitInt32(uint64_t Value)
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MachineInstrBundleIterator< const MachineInstr > const_iterator
bool isEHFuncletEntry() const
Returns true if this is the entry block of an EH funclet.
bool isCleanupFuncletEntry() const
Returns true if this is the entry block of a cleanup funclet.
int getStackProtectorIndex() const
Return the index for the stack protector object.
bool hasStackProtectorIndex() const
const WinEHFuncInfo * getWinEHFuncInfo() const
getWinEHFuncInfo - Return information about how the current function uses Windows exception handling.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const std::vector< MCSymbol * > & getEHContTargets() const
Returns a reference to a list of symbols that are targets for Windows EH Continuation Guard.
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.
const MachineBasicBlock & front() const
bool hasEHFunclets() const
BasicBlockListType::const_iterator const_iterator
Representation of each machine instruction.
A Module instance is used to store all the information related to an LLVM module.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
int64_t getFixed() const
Returns the fixed component of the stack.
static StackOffset getFixed(int64_t Fixed)
Represent a constant reference to a string, i.e.
virtual StackOffset getNonLocalFrameIndexReference(const MachineFunction &MF, int FI) const
getNonLocalFrameIndexReference - This method returns the offset used to reference a frame index locat...
virtual StackOffset getFrameIndexReferencePreferSP(const MachineFunction &MF, int FI, Register &FrameReg, bool IgnoreSPUpdates) const
Same as getFrameIndexReference, except that the stack pointer (as opposed to the frame pointer) will ...
virtual unsigned getWinEHParentFrameOffset(const MachineFunction &MF) const
virtual StackOffset getFrameIndexReference(const MachineFunction &MF, int FI, Register &FrameReg) const
getFrameIndexReference - This method should return the base register and offset used to reference a f...
unsigned getLSDAEncoding() const
virtual MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const
unsigned getPersonalityEncoding() const
virtual const TargetFrameLowering * getFrameLowering() const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
void endFunction(const MachineFunction *) override
Gather and emit post-function exception information.
void markFunctionEnd() override
void beginFunclet(const MachineBasicBlock &MBB, MCSymbol *Sym) override
Emit target-specific EH funclet machinery.
void endModule() override
Emit all exception information that should come after the content.
WinException(AsmPrinter *A)
void endFunclet() override
void beginFunction(const MachineFunction *MF) override
Gather pre-function exception information.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
@ IMAGE_SYM_CLASS_STATIC
Static.
@ IMAGE_SYM_DTYPE_FUNCTION
A function that returns a base type.
@ SCT_COMPLEX_TYPE_SHIFT
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
APInt operator*(APInt a, uint64_t RHS)
bool operator!=(uint64_t V1, const APInt &V2)
auto dyn_cast_if_present(const Y &Val)
dyn_cast_if_present<X> - Functionally identical to dyn_cast, except that a null (or none in the case ...
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
detail::concat_range< ValueT, RangeTs... > concat(RangeTs &&...Ranges)
Returns a concatenated range across two or more ranges.
bool isNoOpWithoutInvoke(EHPersonality Pers)
Return true if this personality may be safely removed if there are no invoke instructions remaining i...
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
LLVM_ABI EHPersonality classifyEHPersonality(const Value *Pers)
See if the given exception handling personality function is one that we understand.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
iterator_range(Container &&) -> iterator_range< llvm::detail::IterOfRange< Container > >
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
int ToState
If unwinding continues through this handler, transition to the handler at this state.
MBBOrBasicBlock Handler
Holds the __except or __finally basic block.
const Function * Filter
Holds the filter expression function.
SmallVector< SEHUnwindMapEntry, 4 > SEHUnwindMap
SmallVector< ClrEHUnwindMapEntry, 4 > ClrEHUnwindMap
DenseMap< const FuncletPadInst *, int > FuncletBaseStateMap
SmallVector< WinEHTryBlockMapEntry, 4 > TryBlockMap
DenseMap< MCSymbol *, std::pair< int, MCSymbol * > > LabelToStateMap
SmallVector< CxxUnwindMapEntry, 4 > CxxUnwindMap
GlobalVariable * TypeDescriptor
union llvm::WinEHHandlerType::@246205307012256373115155017221207221353102114334 CatchObj
The CatchObj starts out life as an LLVM alloca and is eventually turned frame index.
SmallVector< WinEHHandlerType, 1 > HandlerArray