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();
89 shouldEmitPersonality =
90 forceEmitPersonality || ((hasLandingPads || hasEHFunclets) &&
94 shouldEmitLSDA = shouldEmitPersonality &&
99 if (!
Asm->MAI.usesWindowsCFI()) {
107 emitEHRegistrationOffsetLabel(FuncInfo, FLinkageName);
109 shouldEmitLSDA = hasEHFunclets;
110 shouldEmitPersonality =
false;
118 if (isAArch64 && CurrentFuncletEntry &&
119 (shouldEmitMoves || shouldEmitPersonality))
120 Asm->OutStreamer->emitWinCFIFuncletOrFuncEnd();
126 if (!shouldEmitPersonality && !shouldEmitMoves && !shouldEmitLSDA)
131 if (
F.hasPersonalityFn())
140 if (shouldEmitPersonality || shouldEmitLSDA) {
141 Asm->OutStreamer->pushSection();
144 MCSection *XData =
Asm->OutStreamer->getAssociatedXDataSection(
145 Asm->OutStreamer->getCurrentSectionOnly());
146 Asm->OutStreamer->switchSection(XData);
151 emitCSpecificHandlerTable(MF);
153 emitExceptHandlerTable(MF);
155 emitCXXFrameHandler3Table(MF);
157 emitCLRExceptionTable(MF);
161 Asm->OutStreamer->popSection();
184 StringRef HandlerPrefix =
MBB->isCleanupFuncletEntry() ?
"dtor" :
"catch";
185 return Ctx.getOrCreateSymbol(
"?" + HandlerPrefix +
"$" +
187 FuncLinkageName +
"@4HA");
192 CurrentFuncletEntry = &
MBB;
200 Asm->OutStreamer->beginCOFFSymbolDef(Sym);
204 Asm->OutStreamer->endCOFFSymbolDef();
209 std::max(
Asm->MF->getPreferredAlignment(),
MBB.getAlignment()), &
F);
212 Asm->OutStreamer->emitLabel(Sym);
216 if (shouldEmitMoves || shouldEmitPersonality) {
217 CurrentFuncletTextSection =
Asm->OutStreamer->getCurrentSectionOnly();
218 Asm->OutStreamer->emitWinCFIStartProc(Sym);
221 if (shouldEmitPersonality) {
226 if (
F.hasPersonalityFn())
236 if (!CurrentFuncletEntry->isCleanupFuncletEntry())
237 Asm->OutStreamer->emitWinEHHandler(PersHandlerSym,
true,
true);
242 if (isAArch64 && CurrentFuncletEntry &&
243 (shouldEmitMoves || shouldEmitPersonality)) {
244 Asm->OutStreamer->switchSection(CurrentFuncletTextSection);
245 Asm->OutStreamer->emitWinCFIFuncletOrFuncEnd();
250void WinException::endFuncletImpl() {
252 if (!CurrentFuncletEntry)
256 if (shouldEmitMoves || shouldEmitPersonality) {
259 if (
F.hasPersonalityFn())
271 Twine(
"$cppxdata$", FuncLinkageName));
280 emitCSpecificHandlerTable(MF);
281 }
else if (shouldEmitPersonality || shouldEmitLSDA) {
283 Asm->OutStreamer->emitWinEHHandlerData();
301 Asm->OutStreamer->switchSection(CurrentFuncletTextSection);
302 Asm->OutStreamer->emitWinCFIEndProc();
306 CurrentFuncletEntry =
nullptr;
319 return create32bitRef(
Asm->getSymbol(GV));
334const MCExpr *WinException::getOffsetPlusOne(
const MCSymbol *OffsetOf,
341int WinException::getFrameIndexOffset(
int FrameIndex,
343 const TargetFrameLowering &TFI = *
Asm->MF->getSubtarget().getFrameLowering();
345 if (
Asm->MAI.usesWindowsCFI()) {
350 Asm->MF->getSubtarget()
352 ->getStackPointerRegisterToSaveRestore());
362 "Frame offsets with a scalable component are not supported");
369const int NullState = -1;
371struct InvokeStateChange {
393class InvokeStateChangeIterator {
394 InvokeStateChangeIterator(
const WinEHFuncInfo &EHInfo,
399 : EHInfo(EHInfo), MFI(MFI), MFE(MFE),
MBBI(
MBBI), BaseState(BaseState) {
400 LastStateChange.PreviousEndLabel =
nullptr;
401 LastStateChange.NewStartLabel =
nullptr;
402 LastStateChange.NewState = BaseState;
413 auto BlockBegin = Begin->begin();
414 auto BlockEnd = std::prev(End)->end();
416 InvokeStateChangeIterator(EHInfo, Begin, End, BlockBegin, BaseState),
417 InvokeStateChangeIterator(EHInfo, End, End, BlockEnd, BaseState));
421 bool operator==(
const InvokeStateChangeIterator &O)
const {
422 assert(BaseState ==
O.BaseState);
433 return CurrentEndLabel ==
O.CurrentEndLabel;
436 bool operator!=(
const InvokeStateChangeIterator &O)
const {
439 InvokeStateChange &
operator*() {
return LastStateChange; }
440 InvokeStateChange *operator->() {
return &LastStateChange; }
441 InvokeStateChangeIterator &operator++() {
return scan(); }
444 InvokeStateChangeIterator &scan();
446 const WinEHFuncInfo &EHInfo;
447 const MCSymbol *CurrentEndLabel =
nullptr;
451 InvokeStateChange LastStateChange;
452 bool VisitingInvoke =
false;
458InvokeStateChangeIterator &InvokeStateChangeIterator::scan() {
459 bool IsNewBlock =
false;
460 for (; MFI != MFE; ++MFI, IsNewBlock =
true) {
463 for (
auto MBBE = MFI->end();
MBBI != MBBE; ++
MBBI) {
465 if (!VisitingInvoke && LastStateChange.NewState != BaseState &&
470 LastStateChange.PreviousEndLabel = CurrentEndLabel;
471 LastStateChange.NewStartLabel =
nullptr;
472 LastStateChange.NewState = BaseState;
473 CurrentEndLabel =
nullptr;
483 if (Label == CurrentEndLabel) {
484 VisitingInvoke =
false;
491 auto &StateAndEnd = InvokeMapIter->second;
492 int NewState = StateAndEnd.first;
495 VisitingInvoke =
true;
496 if (NewState == LastStateChange.NewState) {
499 CurrentEndLabel = StateAndEnd.second;
503 LastStateChange.PreviousEndLabel = CurrentEndLabel;
504 LastStateChange.NewStartLabel =
Label;
505 LastStateChange.NewState = NewState;
507 CurrentEndLabel = StateAndEnd.second;
514 if (LastStateChange.NewState != BaseState) {
516 LastStateChange.PreviousEndLabel = CurrentEndLabel;
517 LastStateChange.NewStartLabel =
nullptr;
518 LastStateChange.NewState = BaseState;
520 assert(CurrentEndLabel !=
nullptr);
524 CurrentEndLabel =
nullptr;
556void WinException::emitCSpecificHandlerTable(
const MachineFunction *MF) {
557 auto &OS = *
Asm->OutStreamer;
558 MCContext &Ctx =
Asm->OutContext;
561 bool VerboseAsm = OS.isVerboseAsm();
562 auto AddComment = [&](
const Twine &
Comment) {
564 OS.AddComment(Comment);
570 StringRef FLinkageName =
574 const MCExpr *MCOffset =
576 Asm->OutStreamer->emitAssignment(ParentFrameOffset, MCOffset);
585 const MCExpr *LabelDiff = getOffset(TableEnd, TableBegin);
588 AddComment(
"Number of call sites");
589 OS.emitValue(EntryCount, 4);
591 OS.emitLabel(TableBegin);
600 const MCSymbol *LastStartLabel =
nullptr;
601 int LastEHState = -1;
606 while (Stop != End && !Stop->isEHFuncletEntry())
608 for (
const auto &StateChange :
609 InvokeStateChangeIterator::range(FuncInfo, MF->
begin(), Stop)) {
612 if (LastEHState != -1)
613 emitSEHActionsForRange(FuncInfo, LastStartLabel,
614 StateChange.PreviousEndLabel, LastEHState);
615 LastStartLabel = StateChange.NewStartLabel;
616 LastEHState = StateChange.NewState;
619 OS.emitLabel(TableEnd);
622void WinException::emitSEHActionsForRange(
const WinEHFuncInfo &FuncInfo,
624 const MCSymbol *EndLabel,
int State) {
625 auto &OS = *
Asm->OutStreamer;
626 MCContext &Ctx =
Asm->OutContext;
627 bool VerboseAsm = OS.isVerboseAsm();
628 auto AddComment = [&](
const Twine &
Comment) {
630 OS.AddComment(Comment);
633 assert(BeginLabel && EndLabel);
634 while (State != -1) {
635 const SEHUnwindMapEntry &UME = FuncInfo.
SEHUnwindMap[State];
636 const MCExpr *FilterOrFinally;
637 const MCExpr *ExceptOrNull;
645 FilterOrFinally = UME.
Filter ? create32bitRef(UME.
Filter)
646 : MCConstantExpr::create(1, Ctx);
647 ExceptOrNull = create32bitRef(Handler->getSymbol());
650 AddComment(
"LabelStart");
651 OS.emitValue(getLabel(BeginLabel), 4);
652 AddComment(
"LabelEnd");
653 OS.emitValue(getLabel(EndLabel), 4);
654 AddComment(UME.
IsFinally ?
"FinallyFunclet" : UME.
Filter ?
"FilterFunction"
656 OS.emitValue(FilterOrFinally, 4);
657 AddComment(UME.
IsFinally ?
"Null" :
"ExceptionHandler");
658 OS.emitValue(ExceptOrNull, 4);
665void WinException::emitCXXFrameHandler3Table(
const MachineFunction *MF) {
667 auto &OS = *
Asm->OutStreamer;
674 if (shouldEmitPersonality) {
678 Asm->OutContext.getOrCreateSymbol(Twine(
"$cppxdata$", FuncLinkageName));
679 computeIP2StateTable(MF, FuncInfo, IPToStateTable);
681 FuncInfoXData =
Asm->OutContext.getOrCreateLSDASymbol(FuncLinkageName);
684 int UnwindHelpOffset = 0;
689 if (
Asm->MAI.usesWindowsCFI() &&
695 MCSymbol *TryBlockMapXData =
nullptr;
698 UnwindMapXData =
Asm->OutContext.getOrCreateSymbol(
699 Twine(
"$stateUnwindMap$", FuncLinkageName));
702 Asm->OutContext.getOrCreateSymbol(Twine(
"$tryMap$", FuncLinkageName));
703 if (!IPToStateTable.
empty())
705 Asm->OutContext.getOrCreateSymbol(Twine(
"$ip2state$", FuncLinkageName));
707 bool VerboseAsm = OS.isVerboseAsm();
708 auto AddComment = [&](
const Twine &
Comment) {
710 OS.AddComment(Comment);
728 OS.emitValueToAlignment(
Align(4));
729 OS.emitLabel(FuncInfoXData);
731 AddComment(
"MagicNumber");
732 OS.emitInt32(0x19930522);
734 AddComment(
"MaxState");
737 AddComment(
"UnwindMap");
738 OS.emitValue(create32bitRef(UnwindMapXData), 4);
740 AddComment(
"NumTryBlocks");
743 AddComment(
"TryBlockMap");
744 OS.emitValue(create32bitRef(TryBlockMapXData), 4);
746 AddComment(
"IPMapEntries");
747 OS.emitInt32(IPToStateTable.
size());
749 AddComment(
"IPToStateXData");
750 OS.emitValue(create32bitRef(IPToStateXData), 4);
752 if (
Asm->MAI.usesWindowsCFI() &&
754 AddComment(
"UnwindHelp");
755 OS.emitInt32(UnwindHelpOffset);
758 AddComment(
"ESTypeList");
761 AddComment(
"EHFlags");
762 if (
MMI->getModule()->getModuleFlag(
"eh-asynch")) {
772 if (UnwindMapXData) {
773 OS.emitLabel(UnwindMapXData);
774 for (
const CxxUnwindMapEntry &UME : FuncInfo.
CxxUnwindMap) {
777 AddComment(
"ToState");
780 AddComment(
"Action");
781 OS.emitValue(create32bitRef(CleanupSym), 4);
792 if (TryBlockMapXData) {
793 OS.emitLabel(TryBlockMapXData);
796 const WinEHTryBlockMapEntry &TBME = FuncInfo.
TryBlockMap[
I];
798 MCSymbol *HandlerMapXData =
nullptr;
801 Asm->OutContext.getOrCreateSymbol(Twine(
"$handlerMap$")
804 .
concat(FuncLinkageName));
812 "bad trymap interval");
814 AddComment(
"TryLow");
815 OS.emitInt32(TBME.
TryLow);
817 AddComment(
"TryHigh");
820 AddComment(
"CatchHigh");
823 AddComment(
"NumCatches");
826 AddComment(
"HandlerArray");
827 OS.emitValue(create32bitRef(HandlerMapXData), 4);
831 unsigned ParentFrameOffset = 0;
832 if (shouldEmitPersonality) {
838 const WinEHTryBlockMapEntry &TBME = FuncInfo.
TryBlockMap[
I];
839 MCSymbol *HandlerMapXData = HandlerMaps[
I];
840 if (!HandlerMapXData)
849 OS.emitLabel(HandlerMapXData);
854 const MCExpr *FrameAllocOffsetRef =
nullptr;
857 assert(
Offset != 0 &&
"Illegal offset for catch object!");
866 AddComment(
"Adjectives");
872 AddComment(
"CatchObjOffset");
873 OS.emitValue(FrameAllocOffsetRef, 4);
875 AddComment(
"Handler");
876 OS.emitValue(create32bitRef(HandlerSym), 4);
878 if (shouldEmitPersonality) {
879 AddComment(
"ParentFrameOffset");
880 OS.emitInt32(ParentFrameOffset);
890 if (IPToStateXData) {
891 OS.emitLabel(IPToStateXData);
892 for (
auto &IPStatePair : IPToStateTable) {
894 OS.emitValue(IPStatePair.first, 4);
895 AddComment(
"ToState");
896 OS.emitInt32(IPStatePair.second);
901void WinException::computeIP2StateTable(
906 FuncletEnd = MF->
begin(),
908 FuncletStart != End; FuncletStart = FuncletEnd) {
910 while (++FuncletEnd != End) {
911 if (FuncletEnd->isEHFuncletEntry()) {
919 if (FuncletStart->isCleanupFuncletEntry())
924 if (FuncletStart == MF->
begin()) {
925 BaseState = NullState;
926 StartLabel =
Asm->getFunctionBegin();
929 FuncletStart->getBasicBlock()->getFirstNonPHIIt());
934 assert(StartLabel &&
"need local function start label");
935 IPToStateTable.push_back(
936 std::make_pair(create32bitRef(StartLabel), BaseState));
938 for (
const auto &StateChange : InvokeStateChangeIterator::range(
939 FuncInfo, FuncletStart, FuncletEnd, BaseState)) {
944 const MCSymbol *ChangeLabel = StateChange.NewStartLabel;
946 ChangeLabel = StateChange.PreviousEndLabel;
948 const MCExpr *LabelExpression = getLabel(ChangeLabel);
949 IPToStateTable.push_back(
950 std::make_pair(LabelExpression, StateChange.NewState));
956void WinException::emitEHRegistrationOffsetLabel(
const WinEHFuncInfo &FuncInfo,
970 const TargetFrameLowering *TFI =
Asm->MF->getSubtarget().getFrameLowering();
974 MCContext &Ctx =
Asm->OutContext;
977 Asm->OutStreamer->emitAssignment(ParentFrameOffset,
985 MCStreamer &OS = *
Asm->OutStreamer;
990 auto AddComment = [&](
const Twine &
Comment) {
996 emitEHRegistrationOffsetLabel(FuncInfo, FLinkageName);
999 MCSymbol *LSDALabel =
Asm->OutContext.getOrCreateLSDASymbol(FLinkageName);
1003 const auto *Per =
cast<Function>(
F.getPersonalityFn()->stripPointerCasts());
1004 StringRef PerName = Per->getName();
1006 if (PerName ==
"_except_handler4") {
1029 int GSCookieOffset = -2;
1041 int EHCookieOffset = 9999;
1050 AddComment(
"GSCookieOffset");
1052 AddComment(
"GSCookieXOROffset");
1054 AddComment(
"EHCookieOffset");
1056 AddComment(
"EHCookieXOROffset");
1062 for (
const SEHUnwindMapEntry &UME : FuncInfo.
SEHUnwindMap) {
1069 AddComment(
"ToState");
1071 AddComment(UME.
IsFinally ?
"Null" :
"FilterFunction");
1073 AddComment(UME.
IsFinally ?
"FinallyFunclet" :
"ExceptionHandler");
1074 OS.
emitValue(create32bitRef(ExceptOrFinally), 4);
1080 while (State != -1) {
1091 while (LeftRank < RightRank) {
1096 while (RightRank < LeftRank) {
1113 MCStreamer &OS = *
Asm->OutStreamer;
1130 assert(NumStates > 0 &&
"Don't need exception table!");
1131 DenseMap<const MachineBasicBlock *, int> HandlerStates;
1132 for (
int State = 0; State < NumStates; ++State) {
1133 MachineBasicBlock *HandlerBlock =
1135 HandlerStates[HandlerBlock] = State;
1140 "ill-formed state numbering");
1143 HandlerStates[&MF->
front()] = NullState;
1168 std::unique_ptr<MCSymbol *[]> EndSymbolMap(
new MCSymbol *[NumStates]);
1169 SmallVector<int, 4> MinClauseMap((
size_t)NumStates, NumStates);
1173 FuncletEnd = MF->
begin(),
1175 FuncletStart != End; FuncletStart = FuncletEnd) {
1176 int FuncletState = HandlerStates[&*FuncletStart];
1179 while (++FuncletEnd != End) {
1180 if (FuncletEnd->isEHFuncletEntry()) {
1187 OS.
emitValue(getOffset(EndSymbol, FuncBeginSym), 4);
1188 if (FuncletState != NullState) {
1190 EndSymbolMap[FuncletState] = EndSymbol;
1195 const MCSymbol *CurrentStartLabel =
nullptr;
1196 int CurrentState = NullState;
1198 for (
const auto &StateChange :
1199 InvokeStateChangeIterator::range(FuncInfo, FuncletStart, FuncletEnd)) {
1201 int StillPendingState =
1203 while (CurrentState != StillPendingState) {
1204 assert(CurrentState != NullState &&
1205 "Failed to find still-pending state!");
1207 Clauses.
push_back({CurrentStartLabel, StateChange.PreviousEndLabel,
1208 CurrentState, FuncletState});
1210 CurrentState = FuncInfo.
ClrEHUnwindMap[CurrentState].TryParentState;
1213 if (HandlerStack.
back().second == CurrentState)
1217 if (StateChange.NewState != CurrentState) {
1221 for (
int EnteredState = StateChange.NewState;
1222 EnteredState != CurrentState;
1225 int &MinEnclosingState = MinClauseMap[EnteredState];
1226 if (FuncletState < MinEnclosingState)
1227 MinEnclosingState = FuncletState;
1231 HandlerStack.
emplace_back(CurrentStartLabel, CurrentState);
1232 CurrentStartLabel = StateChange.NewStartLabel;
1233 CurrentState = StateChange.NewState;
1241 for (ClrClause &Clause : Clauses) {
1290 const MCExpr *ClauseBegin =
1291 getOffsetPlusOne(Clause.StartLabel, FuncBeginSym);
1292 const MCExpr *ClauseEnd = getOffsetPlusOne(Clause.EndLabel, FuncBeginSym);
1297 const MCExpr *HandlerBegin = getOffset(BeginSym, FuncBeginSym);
1298 MCSymbol *EndSym = EndSymbolMap[Clause.State];
1299 const MCExpr *HandlerEnd = getOffset(EndSym, FuncBeginSym);
1302 switch (
Entry.HandlerType) {
1316 if (Clause.EnclosingState != MinClauseMap[Clause.State]) {
1319 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.
FunctionAddr VTableAddr Value
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...
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