LLVM: lib/MC/MCStreamer.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
38#include
39#include
40#include
41#include
42#include
43
44using namespace llvm;
45
49
50
52
54
56
58
61 auto &MAI = *Streamer.getContext().getAsmInfo();
62 MAI.printSwitchToSection(*Sec, Subsection,
63 Streamer.getContext().getTargetTriple(), OS);
64}
65
69
73
74 Streamer.getContext().getAsmInfo()->printExpr(OS, *Value);
76}
77
81 for (const unsigned char C : Data.bytes()) {
84
87 }
88}
89
91
93 : Context(Ctx), CurrentWinFrameInfo(nullptr),
94 CurrentProcWinFrameInfoStartIndex(0) {
95 SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
96}
97
99
101 DwarfFrameInfos.clear();
102 CurrentWinFrameInfo = nullptr;
103 WinFrameInfos.clear();
104 SectionStack.clear();
105 SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
107}
108
113
116 return DwarfFrameInfos;
117}
118
120
123
125 for (auto &FI : DwarfFrameInfos)
126 FI.CompactUnwindEncoding =
128}
129
130
131
135 "Invalid size");
136 const bool IsLittleEndian = Context.getAsmInfo()->isLittleEndian();
139 unsigned Index = IsLittleEndian ? 0 : 8 - Size;
141}
143 if (Value.getNumWords() == 1) {
145 return;
146 }
147
148 const bool IsLittleEndianTarget = Context.getAsmInfo()->isLittleEndian();
150 const APInt Swapped = ShouldSwap ? Value.byteSwap() : Value;
151 const unsigned Size = Value.getBitWidth() / 8;
156}
157
158
159
165 return Tmp.size();
166}
167
168
169
175 return Tmp.size();
176}
177
181
183 bool IsSectionRelative) {
184 assert((!IsSectionRelative || Size == 4) &&
185 "SectionRelative value requires 4-bytes");
186
187 if (!IsSectionRelative)
189 else
191}
192
193
194
199
202
203
205
208 std::optionalMD5::MD5Result Checksum, std::optional Source,
209 unsigned CUID) {
211 Source, CUID);
212}
213
216 std::optionalMD5::MD5Result Checksum,
217 std::optional Source,
218 unsigned CUID) {
220 Source);
221}
222
225 if (!CurFrame)
226 return;
228}
229
232 if (!CurFrame)
233 return;
235}
236
238 unsigned Column, unsigned Flags,
239 unsigned Isa, unsigned Discriminator,
242 Discriminator);
243}
244
250
254 StringRef Prefix = Context.getAsmInfo()->getPrivateGlobalPrefix();
256 Context.getOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID)));
257 }
259}
260
262 return !FrameInfoStack.empty();
263}
264
268 "this directive must appear between "
269 ".cfi_startproc and .cfi_endproc directives");
270 return nullptr;
271 }
272 return &DwarfFrameInfos[FrameInfoStack.back().first];
273}
274
277 unsigned ChecksumKind) {
279 ChecksumKind);
280}
281
285
287 unsigned IAFunc, unsigned IAFile,
288 unsigned IALine, unsigned IACol,
290 if (getContext().getCVContext().getCVFunctionInfo(IAFunc) == nullptr) {
292 ".cv_func_id or .cv_inline_site_id");
293 return true;
294 }
295
297 FunctionId, IAFunc, IAFile, IALine, IACol);
298}
299
301 unsigned Line, unsigned Column,
302 bool PrologueEnd, bool IsStmt,
304
309 if (!FI) {
311 Loc, "function id not introduced by .cv_func_id or .cv_inline_site_id");
312 return false;
313 }
314
315
316 if (FI->Section == nullptr)
321 "all .cv_loc directives for a function must be in the same section");
322 return false;
323 }
324 return true;
325}
326
330
332 unsigned SourceFileId,
333 unsigned SourceLineNum,
336
337
338
339template
342 const T &DefRangeHeader) {
343 BytePrefix.resize(2 + sizeof(T));
345 memcpy(&BytePrefix[0], &SymKindLE, 2);
346 memcpy(&BytePrefix[2], &DefRangeHeader, sizeof(T));
347}
348
350 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
352
354 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
359}
360
362 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
366 DRHdr);
368}
369
371 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
376}
377
379 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
383 DRHdr);
385}
386
390
394
396 Symbol->redefineIfPossible();
397
398 if (!Symbol->isUndefined() || Symbol->isVariable())
400 "' is already defined");
401
402 assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
404 assert(!Symbol->getFragment() && "Unexpected fragment on symbol data!");
405 assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
406
408
410 if (TS)
412}
413
416
418
420 if (!FrameInfoStack.empty() &&
423 Loc, "starting new .cfi frame before finishing the previous one");
424
428
429 const MCAsmInfo* MAI = Context.getAsmInfo();
430 if (MAI) {
436 }
437 }
438 }
439
441 DwarfFrameInfos.push_back(std::move(Frame));
442}
443
446
449 if (!CurFrame)
450 return;
452 FrameInfoStack.pop_back();
453}
454
460
462
464
466 MCDwarfLineEntry LabelLineEntry(nullptr, DwarfLoc, LineStreamLabel);
471
472 return LineStreamLabel;
473}
474
480
486 if (!CurFrame)
487 return;
490}
491
497 if (!CurFrame)
498 return;
500}
501
507 if (!CurFrame)
508 return;
510}
511
517 if (!CurFrame)
518 return;
521}
522
529 if (!CurFrame)
530 return;
533}
534
540 if (!CurFrame)
541 return;
543}
544
550 if (!CurFrame)
551 return;
553}
554
556 unsigned Encoding) {
558 if (!CurFrame)
559 return;
562}
563
566 if (!CurFrame)
567 return;
568 CurFrame->Lsda = Sym;
570}
571
577 if (!CurFrame)
578 return;
580}
581
583
588 if (!CurFrame)
589 return;
591}
592
598 if (!CurFrame)
599 return;
601}
602
608 if (!CurFrame)
609 return;
611}
612
618 if (!CurFrame)
619 return;
621}
622
628 if (!CurFrame)
629 return;
631}
632
635 if (!CurFrame)
636 return;
638}
639
645 if (!CurFrame)
646 return;
648}
649
656 if (!CurFrame)
657 return;
659}
660
665 if (!CurFrame)
666 return;
668}
669
675 if (!CurFrame)
676 return;
678}
679
685 if (!CurFrame)
686 return;
688}
689
692 if (!CurFrame)
693 return;
695}
696
703
709 if (!CurFrame)
710 return;
712}
713
715 const MCAsmInfo *MAI = Context.getAsmInfo();
718 Loc, ".seh_* directives are not supported on this target");
719 return nullptr;
720 }
721 if (!CurrentWinFrameInfo || CurrentWinFrameInfo->End) {
723 Loc, ".seh_ directive must appear within an active frame");
724 return nullptr;
725 }
726 return CurrentWinFrameInfo;
727}
728
730 const MCAsmInfo *MAI = Context.getAsmInfo();
733 Loc, ".seh_* directives are not supported on this target");
734 if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End)
736 Loc, "Starting a function before ending the previous one!");
737
739
740 CurrentProcWinFrameInfoStartIndex = WinFrameInfos.size();
741 WinFrameInfos.emplace_back(
742 std::make_uniqueWinEH::FrameInfo(Symbol, StartProc));
743 CurrentWinFrameInfo = WinFrameInfos.back().get();
745 CurrentWinFrameInfo->FunctionLoc = Loc;
746}
747
750 if (!CurFrame)
751 return;
754
756 CurFrame->End = Label;
759
760 for (size_t I = CurrentProcWinFrameInfoStartIndex, E = WinFrameInfos.size();
764}
765
768 if (!CurFrame)
769 return;
772
775}
776
779 if (!CurFrame)
780 return;
781
783
784 WinFrameInfos.emplace_back(std::make_uniqueWinEH::FrameInfo(
785 CurFrame->Function, StartProc, CurFrame));
786 CurrentWinFrameInfo = WinFrameInfos.back().get();
788}
789
792 if (!CurFrame)
793 return;
796 Loc, "End of a chained region outside a chained region!");
797
799
800 CurFrame->End = Label;
802}
803
807 if (!CurFrame)
808 return;
811 Loc, "Chained unwind areas can't have handlers!");
813 if (!Except && !Unwind)
815 if (Unwind)
817 if (Except)
819}
820
823 if (!CurFrame)
824 return;
827}
828
832
836
837 if (TextSec == Context.getObjectFileInfo()->getTextSection())
838 return MainCFISec;
839
840 const auto *TextSecCOFF = static_cast<const MCSectionCOFF *>(TextSec);
841 auto *MainCFISecCOFF = static_cast<MCSectionCOFF *>(MainCFISec);
842 unsigned UniqueID = TextSecCOFF->getOrAssignWinCFISectionID(NextWinCFIID);
843
844
845
846 const MCSymbol *KeySym = nullptr;
848 KeySym = TextSecCOFF->getCOMDATSymbol();
849
850
851
852
853 if (!Context.getAsmInfo()->hasCOFFAssociativeComdats()) {
854 std::string SectionName = (MainCFISecCOFF->getName() + "$" +
855 TextSecCOFF->getName().split('$').second)
856 .str();
857 return Context.getCOFFSection(SectionName,
858 MainCFISecCOFF->getCharacteristics() |
861 }
862 }
863
864 return Context.getAssociativeCOFFSection(MainCFISecCOFF, KeySym, UniqueID);
865}
866
869 getContext().getObjectFileInfo()->getPDataSection(),
870 TextSec);
871}
872
875 getContext().getObjectFileInfo()->getXDataSection(),
876 TextSec);
877}
878
880
882 return Ctx.getRegisterInfo()->getSEHRegNum(Reg);
883}
884
887 if (!CurFrame)
888 return;
889
891
895}
896
900 if (!CurFrame)
901 return;
904 Loc, "frame register and offset can be set at most once");
909 Loc, "frame offset must be less than or equal to 240");
910
912
917}
918
921 if (!CurFrame)
922 return;
923 if (Size == 0)
925 "stack allocation size must be non-zero");
926 if (Size & 7)
928 Loc, "stack allocation size is not a multiple of 8");
929
931
934}
935
939 if (!CurFrame)
940 return;
941
944 Loc, "register save offset is not 8 byte aligned");
945
947
951}
952
956 if (!CurFrame)
957 return;
960
962
966}
967
970 if (!CurFrame)
971 return;
974 Loc, "If present, PushMachFrame must be the first UOP");
975
977
980}
981
984 if (!CurFrame)
985 return;
986
988
990}
991
994 if (!CurFrame)
995 return;
996
999 Loc, "starting epilogue (.seh_startepilogue) before prologue has ended "
1000 "(.seh_endprologue) in " +
1002
1006 .first->second;
1009}
1010
1013 if (!CurFrame)
1014 return;
1015
1019
1023
1026}
1027
1030 if (!CurFrame)
1031 return;
1032
1036
1040
1043}
1044
1047 if (!CurFrame)
1048 return;
1049
1053
1056 Loc, "Unsupported version specified in .seh_unwindversion in " +
1058
1060}
1061
1063
1065
1067
1069
1071
1073
1075
1076
1077
1078
1080
1081
1082
1083 report_fatal_error("EmitRawText called on an MCStreamer that doesn't support "
1084 "it (target backend is likely missing an AsmStreamer "
1085 "implementation)");
1086}
1087
1092
1094
1096
1098 if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) ||
1099 (!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) {
1101 return;
1102 }
1103
1105 if (TS)
1107
1109}
1110
1117
1125
1127 const Twine &Comment) {
1130 MCSymbol *Lo = Context.createTempSymbol(Prefix + "_start");
1131 MCSymbol *Hi = Context.createTempSymbol(Prefix + "_end");
1132
1135
1137
1138 return Hi;
1139}
1140
1145
1148 Symbol->setVariableValue(Value);
1149
1151 if (TS)
1153}
1154
1161
1164
1166 switch (Expr.getKind()) {
1169 break;
1170
1172 break;
1173
1178 break;
1179 }
1180
1183 break;
1184
1187 break;
1188
1191 break;
1192 }
1193}
1194
1201
1207
1208
1209 MCSymbol *ProbeSym = Context.createTempSymbol();
1210
1211
1213
1214
1216
1217
1218 Context.getMCPseudoProbeTable().getProbeSections().addPseudoProbe(
1219 FnSym, Probe, InlineStack);
1220}
1221
1223 unsigned Size) {
1224
1225 const MCExpr *Diff =
1228
1229 const MCAsmInfo *MAI = Context.getAsmInfo();
1232 return;
1233 }
1234
1235
1236 MCSymbol *SetLabel = Context.createTempSymbol("set");
1239}
1240
1243
1244 const MCExpr *Diff =
1247
1249}
1250
1253 "emitSubsectionsViaSymbols only supported on Mach-O targets");
1254}
1278
1282 llvm_unreachable("emitXCOFFSymbolLinkageWithVisibility is only supported on "
1283 "XCOFF targets");
1284}
1285
1288
1290 llvm_unreachable("emitXCOFFRefDirective is only supported on XCOFF targets");
1291}
1292
1295 unsigned Lang, unsigned Reason,
1296 unsigned FunctionSize,
1297 bool hasDebug) {
1299 "XCOFF targets");
1300}
1301
1304 "XCOFF targets");
1305}
1306
1309 StringRef Name, bool KeepOriginalSym) {}
1311 Align ByteAlignment) {}
1316
1320 if (!Sym || !Sym->isUndefined())
1321 return;
1322
1323
1326 else
1327 Sym->setFragment(CurFrag);
1328}
1329
1343 unsigned MaxBytesToEmit) {}
1347
1349 if (SectionStack.size() <= 1)
1350 return false;
1351 auto I = SectionStack.end();
1352 --I;
1354 --I;
1356
1357 if (NewSec.first && OldSec != NewSec)
1359 SectionStack.pop_back();
1360 return true;
1361}
1362
1364 assert(Section && "Cannot switch to a null section!");
1366 SectionStack.back().second = curSection;
1369 SectionStack.back().first = MCSectionSubPair(Section, Subsection);
1370 assert(!Section->hasEnded() && "Section already ended");
1371 }
1372}
1373
1375 int64_t Subsec = 0;
1376 if (SubsecExpr) {
1377 if (!SubsecExpr->evaluateAsAbsolute(Subsec, getAssemblerPtr())) {
1379 "cannot evaluate subsection number");
1380 return true;
1381 }
1384 "subsection number " + Twine(Subsec) +
1385 " is not within [0,2147483647]");
1386 return true;
1387 }
1388 }
1390 return false;
1391}
1392
1394 SectionStack.back().second = SectionStack.back().first;
1397}
1398
1400
1401
1402 MCSymbol *Sym = Section->getEndSymbol(Context);
1404 return Sym;
1405
1408 return Sym;
1409}
1410
1412 auto *Sec = CurFrag->getParent();
1413 F->setParent(Sec);
1414 F->setLayoutOrder(CurFrag->getLayoutOrder() + 1);
1417 Sec->curFragList()->Tail = F;
1418}
1419
1424 return !Min.empty() && Min > TargetVersion ? Min : TargetVersion;
1425}
1426
1429 assert(Target.isOSDarwin() && "expected a darwin OS");
1430 switch (Target.getOS()) {
1435 assert(.isMacCatalystEnvironment() &&
1436 "mac Catalyst should use LC_BUILD_VERSION");
1442 default:
1443 break;
1444 }
1446}
1447
1449 assert(Target.isOSDarwin() && "expected a darwin OS");
1450 switch (Target.getOS()) {
1455
1456 if (Target.isMacCatalystEnvironment())
1458 [[fallthrough]];
1466
1468 default:
1469 break;
1470 }
1472}
1473
1476 assert(Target.isOSDarwin() && "expected a darwin OS");
1477 switch (Target.getOS()) {
1480 return MachO::PLATFORM_MACOS;
1482 if (Target.isMacCatalystEnvironment())
1483 return MachO::PLATFORM_MACCATALYST;
1484 return Target.isSimulatorEnvironment() ? MachO::PLATFORM_IOSSIMULATOR
1485 : MachO::PLATFORM_IOS;
1487 return Target.isSimulatorEnvironment() ? MachO::PLATFORM_TVOSSIMULATOR
1488 : MachO::PLATFORM_TVOS;
1490 return Target.isSimulatorEnvironment() ? MachO::PLATFORM_WATCHOSSIMULATOR
1491 : MachO::PLATFORM_WATCHOS;
1493 return MachO::PLATFORM_DRIVERKIT;
1495 return Target.isSimulatorEnvironment() ? MachO::PLATFORM_XROS_SIMULATOR
1496 : MachO::PLATFORM_XROS;
1498 return MachO::PLATFORM_BRIDGEOS;
1499 default:
1500 break;
1501 }
1503}
1504
1507 const Triple *DarwinTargetVariantTriple,
1508 const VersionTuple &DarwinTargetVariantSDKVersion) {
1509 if (.isOSBinFormatMachO() ||
.isOSDarwin())
1510 return;
1511
1512 if (Target.getOSMajorVersion() == 0)
1513 return;
1514
1516 switch (Target.getOS()) {
1520 break;
1524 break;
1527 break;
1530 break;
1534 break;
1535 default:
1537 }
1538 assert(Version.getMajor() != 0 && "A non-zero major version is expected");
1539 auto LinkedTargetVersion =
1542 bool ShouldEmitBuildVersion = false;
1543 if (BuildVersionOSVersion.empty() ||
1544 LinkedTargetVersion >= BuildVersionOSVersion) {
1545 if (Target.isMacCatalystEnvironment() && DarwinTargetVariantTriple &&
1546 DarwinTargetVariantTriple->isMacOSX()) {
1548 DarwinTargetVariantSDKVersion,
1549 nullptr,
1550 VersionTuple());
1553 LinkedTargetVersion.getMajor(),
1554 LinkedTargetVersion.getMinor().value_or(0),
1555 LinkedTargetVersion.getSubminor().value_or(0), SDKVersion);
1556 return;
1557 }
1559 LinkedTargetVersion.getMajor(),
1560 LinkedTargetVersion.getMinor().value_or(0),
1561 LinkedTargetVersion.getSubminor().value_or(0), SDKVersion);
1562 ShouldEmitBuildVersion = true;
1563 }
1564
1565 if (const Triple *TVT = DarwinTargetVariantTriple) {
1566 if (Target.isMacOSX() && TVT->isMacCatalystEnvironment()) {
1567 auto TVLinkedTargetVersion =
1571 TVLinkedTargetVersion.getMajor(),
1572 TVLinkedTargetVersion.getMinor().value_or(0),
1573 TVLinkedTargetVersion.getSubminor().value_or(0),
1574 DarwinTargetVariantSDKVersion);
1575 }
1576 }
1577
1578 if (ShouldEmitBuildVersion)
1579 return;
1580
1582 LinkedTargetVersion.getMajor(),
1583 LinkedTargetVersion.getMinor().value_or(0),
1584 LinkedTargetVersion.getSubminor().value_or(0), SDKVersion);
1585}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static ManagedStatic< cl::opt< bool, true >, CreateDebug > Debug
static VersionTuple getMachoBuildVersionSupportedOS(const Triple &Target)
Definition MCStreamer.cpp:1448
static void copyBytesForDefRange(SmallString< 20 > &BytePrefix, codeview::SymbolKind SymKind, const T &DefRangeHeader)
Only call this on endian-specific types like ulittle16_t and little32_t, or structs composed of them.
Definition MCStreamer.cpp:340
static MCVersionMinType getMachoVersionMinLoadCommandType(const Triple &Target)
Definition MCStreamer.cpp:1428
static VersionTuple targetVersionOrMinimumSupportedOSVersion(const Triple &Target, VersionTuple TargetVersion)
Definition MCStreamer.cpp:1421
static MCSection * getWinCFISection(MCContext &Context, unsigned *NextWinCFIID, MCSection *MainCFISec, const MCSection *TextSec)
Definition MCStreamer.cpp:833
static MachO::PlatformType getMachoBuildVersionPlatformType(const Triple &Target)
Definition MCStreamer.cpp:1475
static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg)
Definition MCStreamer.cpp:881
This file defines the SmallString class.
Class for arbitrary precision integers.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Holds state from .cv_file and .cv_loc directives for later emission.
bool addFile(MCStreamer &OS, unsigned FileNumber, StringRef Filename, ArrayRef< uint8_t > ChecksumBytes, uint8_t ChecksumKind)
MCCVFunctionInfo * getCVFunctionInfo(unsigned FuncId)
Retreive the function info if this is a valid function id, or nullptr.
bool recordFunctionId(unsigned FuncId)
Records the function id of a normal function.
bool recordInlinedCallSiteId(unsigned FuncId, unsigned IAFunc, unsigned IAFile, unsigned IALine, unsigned IACol)
Records the function id of an inlined call site.
Tagged union holding either a T or a Error.
Generic interface to target specific assembler backends.
virtual uint64_t generateCompactUnwindEncoding(const MCDwarfFrameInfo *FI, const MCContext *Ctxt) const
Generate the compact unwind encoding for the CFI instructions.
This class is intended to be used as a base class for asm properties and features specific to the tar...
const std::vector< MCCFIInstruction > & getInitialFrameState() const
const char * getData8bitsDirective() const
bool doesSetDirectiveSuppressReloc() const
bool usesWindowsCFI() const
Binary assembler expressions.
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register, SMLoc Loc={})
.cfi_def_cfa_register modifies a rule for computing CFA.
static MCCFIInstruction createUndefined(MCSymbol *L, unsigned Register, SMLoc Loc={})
.cfi_undefined From now on the previous value of Register can't be restored anymore.
static MCCFIInstruction createGnuArgsSize(MCSymbol *L, int64_t Size, SMLoc Loc={})
A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE.
static MCCFIInstruction createRestore(MCSymbol *L, unsigned Register, SMLoc Loc={})
.cfi_restore says that the rule for Register is now the same as it was at the beginning of the functi...
static MCCFIInstruction createLLVMDefAspaceCfa(MCSymbol *L, unsigned Register, int64_t Offset, unsigned AddressSpace, SMLoc Loc)
.cfi_llvm_def_aspace_cfa defines the rule for computing the CFA to be the result of evaluating the DW...
static MCCFIInstruction createRegister(MCSymbol *L, unsigned Register1, unsigned Register2, SMLoc Loc={})
.cfi_register Previous value of Register1 is saved in register Register2.
static MCCFIInstruction cfiDefCfa(MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it.
static MCCFIInstruction createOffset(MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
.cfi_offset Previous value of Register is saved at offset Offset from CFA.
static MCCFIInstruction createValOffset(MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
.cfi_val_offset Previous value of Register is offset Offset from the current CFA register.
static MCCFIInstruction createNegateRAStateWithPC(MCSymbol *L, SMLoc Loc={})
.cfi_negate_ra_state_with_pc AArch64 negate RA state with PC.
static MCCFIInstruction createNegateRAState(MCSymbol *L, SMLoc Loc={})
.cfi_negate_ra_state AArch64 negate RA state.
static MCCFIInstruction createRememberState(MCSymbol *L, SMLoc Loc={})
.cfi_remember_state Save all current rules for all registers.
static MCCFIInstruction cfiDefCfaOffset(MCSymbol *L, int64_t Offset, SMLoc Loc={})
.cfi_def_cfa_offset modifies a rule for computing CFA.
static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals, SMLoc Loc={}, StringRef Comment="")
.cfi_escape Allows the user to add arbitrary bytes to the unwind info.
static MCCFIInstruction createWindowSave(MCSymbol *L, SMLoc Loc={})
.cfi_window_save SPARC register window is saved.
static MCCFIInstruction createAdjustCfaOffset(MCSymbol *L, int64_t Adjustment, SMLoc Loc={})
.cfi_adjust_cfa_offset Same as .cfi_def_cfa_offset, but Offset is a relative value that is added/subt...
static MCCFIInstruction createRestoreState(MCSymbol *L, SMLoc Loc={})
.cfi_restore_state Restore the previously saved state.
static MCCFIInstruction createSameValue(MCSymbol *L, unsigned Register, SMLoc Loc={})
.cfi_same_value Current value of Register is the same as in the previous frame.
static MCCFIInstruction createRelOffset(MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
.cfi_rel_offset Previous value of Register is saved at offset Offset from the current CFA register.
static MCCFIInstruction createLabel(MCSymbol *L, MCSymbol *CfiLabel, SMLoc Loc)
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 Expected< unsigned > getDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber, std::optional< MD5::MD5Result > Checksum, std::optional< StringRef > Source, unsigned CUID)
Creates an entry in the dwarf file and directory tables.
MCDwarfLineTable & getMCDwarfLineTable(unsigned CUID)
LLVM_ABI CodeViewContext & getCVContext()
void setCurrentDwarfLoc(unsigned FileNum, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator)
Saves the information from the currently parsed dwarf .loc directive and sets DwarfLocSeen.
LLVM_ABI void reportError(SMLoc L, const Twine &Msg)
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
const MCDwarfLoc & getCurrentDwarfLoc()
void setMCLineTableRootFile(unsigned CUID, StringRef CompilationDir, StringRef Filename, std::optional< MD5::MD5Result > Checksum, std::optional< StringRef > Source)
Specifies the "root" file and directory of the compilation unit.
Instances of this class represent the line information for the dwarf line table entries.
void setLabel(MCSymbol *Label)
LLVM_ABI void endCurrentSeqAndEmitLineStreamLabel(MCStreamer *MCOS, SMLoc DefLoc, StringRef Name)
const MCLineSection & getMCLineSections() const
MCSymbol * getLabel() const
Instances of this class represent the information from a dwarf .loc directive.
Base class for the full range of assembler expressions which are needed for parsing.
@ Unary
Unary expressions.
@ Constant
Constant expressions.
@ SymbolRef
References to labels and assigned expressions.
@ Target
Target specific expression.
@ Specifier
Expression with a relocation specifier.
@ Binary
Binary expressions.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
virtual void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &OS)=0
Print the specified MCInst to the specified raw_ostream.
Instances of this class represent a single low-level machine instruction.
unsigned getNumOperands() const
const MCOperand & getOperand(unsigned i) const
void addLineEntry(const MCDwarfLineEntry &LineEntry, MCSection *Sec)
const MCExpr * getExpr() const
Instances of this class represent a pseudo probe instance for a pseudo probe table entry,...
Wrapper class representing physical registers. Should be passed by value.
This represents a section on Windows.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
MCFragment & getDummyFragment()
MCSymbol * getBeginSymbol()
Streaming machine code generation interface.
virtual void emitCFIGnuArgsSize(int64_t Size, SMLoc Loc={})
Definition MCStreamer.cpp:623
virtual void emitNops(int64_t NumBytes, int64_t ControlledNopLength, SMLoc Loc, const MCSubtargetInfo &STI)
Definition MCStreamer.cpp:200
MCSymbol * emitLineTableLabel()
Definition MCStreamer.cpp:461
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
Definition MCStreamer.cpp:1146
void switchSectionNoPrint(MCSection *Section)
Similar to switchSection, but does not print the section directive.
Definition MCStreamer.cpp:1393
virtual void emitCFIDefCfa(int64_t Register, int64_t Offset, SMLoc Loc={})
Definition MCStreamer.cpp:481
virtual void emitWinCFIUnwindVersion(uint8_t Version, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:1045
virtual void visitUsedSymbol(const MCSymbol &Sym)
Definition MCStreamer.cpp:1162
void emitCFIStartProc(bool IsSimple, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:419
virtual bool emitCVFuncIdDirective(unsigned FunctionId)
Introduces a function id for use with .cv_loc.
Definition MCStreamer.cpp:282
virtual void finishImpl()
Streamer specific finalization.
Definition MCStreamer.cpp:1346
virtual void emitCFIBKeyFrame()
Definition MCStreamer.cpp:223
void generateCompactUnwindEncodings(MCAsmBackend *MAB)
Definition MCStreamer.cpp:124
virtual void beginCOFFSymbolDef(const MCSymbol *Symbol)
Start emitting COFF symbol definition.
Definition MCStreamer.cpp:1256
virtual void emitSyntaxDirective()
Definition MCStreamer.cpp:879
virtual void emitWinCFIPushReg(MCRegister Register, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:885
virtual void emitBinaryData(StringRef Data)
Functionally identical to EmitBytes.
Definition MCStreamer.cpp:1332
virtual void initSections(bool NoExecStack, const MCSubtargetInfo &STI)
Create the default sections and set the initial one.
Definition MCStreamer.cpp:391
virtual bool popSection()
Restore the current and previous section from the section stack.
Definition MCStreamer.cpp:1348
virtual MCSymbol * emitCFILabel()
When emitting an object file, create and emit a real label.
Definition MCStreamer.cpp:475
virtual void emitWindowsUnwindTables()
Definition MCStreamer.cpp:1093
virtual raw_ostream & getCommentOS()
Return a raw_ostream that comments can be written to.
Definition MCStreamer.cpp:109
virtual void emitZerofill(MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, Align ByteAlignment=Align(1), SMLoc Loc=SMLoc())
Emit the zerofill section and an optional symbol.
Definition MCStreamer.cpp:1312
virtual void emitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:804
virtual void emitCFISections(bool EH, bool Debug, bool SFrame)
Definition MCStreamer.cpp:417
MCSection * getAssociatedPDataSection(const MCSection *TextSec)
Get the .pdata section used for the given section.
Definition MCStreamer.cpp:867
virtual void emitDwarfLocLabelDirective(SMLoc Loc, StringRef Name)
This implements the '.loc_label Name' directive.
Definition MCStreamer.cpp:245
bool hasUnfinishedDwarfFrameInfo()
Definition MCStreamer.cpp:261
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
Definition MCStreamer.cpp:1195
virtual void emitCFINegateRAStateWithPC(SMLoc Loc={})
Definition MCStreamer.cpp:680
virtual void emitCFISameValue(int64_t Register, SMLoc Loc={})
Definition MCStreamer.cpp:593
virtual bool emitCVFileDirective(unsigned FileNo, StringRef Filename, ArrayRef< uint8_t > Checksum, unsigned ChecksumKind)
Associate a filename with a specified logical file number, and also specify that file's checksum info...
Definition MCStreamer.cpp:275
virtual void emitCFIReturnColumn(int64_t Register)
Definition MCStreamer.cpp:690
virtual void emitCOFFSymbolType(int Type)
Emit the type of the symbol.
Definition MCStreamer.cpp:1270
virtual void emitCFIPersonality(const MCSymbol *Sym, unsigned Encoding)
Definition MCStreamer.cpp:555
virtual void emitDwarfUnitLength(uint64_t Length, const Twine &Comment)
Emit a unit length field.
Definition MCStreamer.cpp:1118
virtual void emitCFIWindowSave(SMLoc Loc={})
Definition MCStreamer.cpp:661
virtual void emitCOFFSymbolIndex(MCSymbol const *Symbol)
Emits the symbol table index of a Symbol into the current section.
Definition MCStreamer.cpp:1064
virtual void emitWinCFIUnwindV2Start(SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:1028
virtual void emitWinCFIEndEpilogue(SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:1011
virtual void emitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset)
Emits a COFF image relative relocation.
Definition MCStreamer.cpp:1070
virtual void endCOFFSymbolDef()
Marks the end of the symbol definition.
Definition MCStreamer.cpp:1259
virtual void emitWinCFIPushFrame(bool Code, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:968
virtual void emitWinEHHandlerData(SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:821
virtual MCAssembler * getAssemblerPtr()
virtual void emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo)
Emit the absolute difference between two symbols encoded with ULEB128.
Definition MCStreamer.cpp:1241
virtual void emitXCOFFSymbolLinkageWithVisibility(MCSymbol *Symbol, MCSymbolAttr Linkage, MCSymbolAttr Visibility)
Emit a symbol's linkage and visibility with a linkage directive for XCOFF.
Definition MCStreamer.cpp:1279
virtual void emitCFIUndefined(int64_t Register, SMLoc Loc={})
Definition MCStreamer.cpp:640
void setTargetStreamer(MCTargetStreamer *TS)
virtual void emitWinCFISaveXMM(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:953
virtual void emitCFIStartProcImpl(MCDwarfFrameInfo &Frame)
Definition MCStreamer.cpp:444
virtual void emitCOFFSecNumber(MCSymbol const *Symbol)
Emits the physical number of the section containing the given symbol as assigned during object writin...
Definition MCStreamer.cpp:1072
virtual void emitCFINegateRAState(SMLoc Loc={})
Definition MCStreamer.cpp:670
virtual void emitCFILsda(const MCSymbol *Sym, unsigned Encoding)
Definition MCStreamer.cpp:564
MCContext & getContext() const
SMLoc getStartTokLoc() const
virtual Expected< unsigned > tryEmitDwarfFileDirective(unsigned FileNo, StringRef Directory, StringRef Filename, std::optional< MD5::MD5Result > Checksum=std::nullopt, std::optional< StringRef > Source=std::nullopt, unsigned CUID=0)
Associate a filename with a specified logical file number.
Definition MCStreamer.cpp:206
virtual void addExplicitComment(const Twine &T)
Add explicit comment T.
Definition MCStreamer.cpp:121
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
virtual void emitWinCFIBeginEpilogue(SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:992
virtual void emitELFSize(MCSymbol *Symbol, const MCExpr *Value)
Emit an ELF .size directive.
Definition MCStreamer.cpp:1307
virtual void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size, MCSymbol *CsectSym, Align Alignment)
Emits an lcomm directive with XCOFF csect information.
Definition MCStreamer.cpp:1273
virtual void emitCFIMTETaggedFrame()
Definition MCStreamer.cpp:230
virtual void emitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset)
Emits a COFF section relative relocation.
Definition MCStreamer.cpp:1068
MCSection * getAssociatedXDataSection(const MCSection *TextSec)
Get the .xdata section used for the given section.
Definition MCStreamer.cpp:873
virtual void emitRawComment(const Twine &T, bool TabPrefix=true)
Print T and prefix it with the comment string (normally #) and optionally a tab.
Definition MCStreamer.cpp:119
virtual void emitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:729
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:178
void emitSymbolValue(const MCSymbol *Sym, unsigned Size, bool IsSectionRelative=false)
Special case of EmitValue that avoids the client having to pass in a MCExpr for MCSymbols.
Definition MCStreamer.cpp:182
bool checkCVLocSection(unsigned FuncId, unsigned FileNo, SMLoc Loc)
Returns true if the .cv_loc directive is in the right section.
Definition MCStreamer.cpp:305
virtual void emitDwarfLineStartLabel(MCSymbol *StartSym)
Emit the debug line start label.
Definition MCStreamer.cpp:1141
virtual void emitCFIEscape(StringRef Values, SMLoc Loc={})
Definition MCStreamer.cpp:613
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
Definition MCStreamer.cpp:1222
virtual void emitXCOFFExceptDirective(const MCSymbol *Symbol, const MCSymbol *Trap, unsigned Lang, unsigned Reason, unsigned FunctionSize, bool hasDebug)
Emit an XCOFF .except directive which adds information about a trap instruction to the object file ex...
Definition MCStreamer.cpp:1293
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
Definition MCStreamer.cpp:395
virtual void emitCOFFSectionIndex(MCSymbol const *Symbol)
Emits a COFF section index.
Definition MCStreamer.cpp:1066
virtual void emitCFIRememberState(SMLoc Loc)
Definition MCStreamer.cpp:572
virtual void reset()
State management.
Definition MCStreamer.cpp:100
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.
Definition MCStreamer.cpp:1341
virtual void emitCFILabelDirective(SMLoc Loc, StringRef Name)
Definition MCStreamer.cpp:697
virtual void emitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName, StringRef Comment={})
This implements the DWARF2 '.loc fileno lineno ...' assembler directive.
Definition MCStreamer.cpp:237
virtual void emitCVLinetableDirective(unsigned FunctionId, const MCSymbol *FnStart, const MCSymbol *FnEnd)
This implements the CodeView '.cv_linetable' assembler directive.
Definition MCStreamer.cpp:327
virtual void emitCOFFSecOffset(MCSymbol const *Symbol)
Emits the offset of the symbol from the beginning of the section during object writing (i....
Definition MCStreamer.cpp:1074
MCTargetStreamer * getTargetStreamer()
MCStreamer(MCContext &Ctx)
Definition MCStreamer.cpp:92
virtual void emitDarwinTargetVariantBuildVersion(unsigned Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion)
virtual void emitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers.
Definition MCStreamer.cpp:132
unsigned getNumFrameInfos()
Definition MCStreamer.cpp:114
virtual void emitWinCFISaveReg(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:936
virtual void emitWinCFIEndChained(SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:790
virtual void emitWinCFIEndProlog(SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:982
virtual void emitWinCFIEndProc(SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:748
virtual void emitSubsectionsViaSymbols()
Emit a .subsection_via_symbols directive.
Definition MCStreamer.cpp:1251
void emitVersionForTarget(const Triple &Target, const VersionTuple &SDKVersion, const Triple *DarwinTargetVariantTriple, const VersionTuple &DarwinTargetVariantSDKVersion)
Definition MCStreamer.cpp:1505
virtual void emitCodeAlignment(Align Alignment, const MCSubtargetInfo *STI, unsigned MaxBytesToEmit=0)
Emit nops until the byte alignment ByteAlignment is reached.
Definition MCStreamer.cpp:1342
virtual void emitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame)
Definition MCStreamer.cpp:455
virtual void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue)
Set the DescValue for the Symbol.
Definition MCStreamer.cpp:1255
virtual void emitCFIDefCfaRegister(int64_t Register, SMLoc Loc={})
Definition MCStreamer.cpp:512
virtual void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, Align ByteAlignment)
Emit a local common (.lcomm) symbol.
Definition MCStreamer.cpp:1310
virtual MCSymbol * getDwarfLineTableSymbol(unsigned CUID)
Definition MCStreamer.cpp:251
virtual void emitCFIRegister(int64_t Register1, int64_t Register2, SMLoc Loc={})
Definition MCStreamer.cpp:650
virtual void emitCOFFSafeSEH(MCSymbol const *Symbol)
Definition MCStreamer.cpp:1062
virtual void emitWinCFIFuncletOrFuncEnd(SMLoc Loc=SMLoc())
This is used on platforms, such as Windows on ARM64, that require function or funclet sizes to be emi...
Definition MCStreamer.cpp:766
virtual void emitXCOFFRenameDirective(const MCSymbol *Name, StringRef Rename)
Emit a XCOFF .rename directive which creates a synonym for an illegal or undesirable name.
Definition MCStreamer.cpp:1286
virtual void emitPseudoProbe(uint64_t Guid, uint64_t Index, uint64_t Type, uint64_t Attr, uint64_t Discriminator, const MCPseudoProbeInlineStack &InlineStack, MCSymbol *FnSym)
Emit the a pseudo probe into the current section.
Definition MCStreamer.cpp:1202
virtual void emitCGProfileEntry(const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count)
Definition MCStreamer.cpp:829
virtual void emitCFIAdjustCfaOffset(int64_t Adjustment, SMLoc Loc={})
Definition MCStreamer.cpp:502
unsigned emitULEB128IntValue(uint64_t Value, unsigned PadTo=0)
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integ...
Definition MCStreamer.cpp:160
virtual void emitULEB128Value(const MCExpr *Value)
Definition MCStreamer.cpp:1336
ArrayRef< MCDwarfFrameInfo > getDwarfFrameInfos() const
Definition MCStreamer.cpp:115
virtual void emitCFIRelOffset(int64_t Register, int64_t Offset, SMLoc Loc)
Definition MCStreamer.cpp:545
virtual void emitValueToOffset(const MCExpr *Offset, unsigned char Value, SMLoc Loc)
Emit some number of copies of Value until the byte offset Offset is reached.
Definition MCStreamer.cpp:1344
MCSymbol * endSection(MCSection *Section)
Definition MCStreamer.cpp:1399
virtual void switchSection(MCSection *Section, uint32_t Subsec=0)
Set the current section where code is being emitted to Section.
Definition MCStreamer.cpp:1363
virtual void emitExplicitComments()
Emit added explicit comments.
Definition MCStreamer.cpp:122
WinEH::FrameInfo * EnsureValidWinFrameInfo(SMLoc Loc)
Retrieve the current frame info if one is available and it is not yet closed.
Definition MCStreamer.cpp:714
void emitCFIEndProc()
Definition MCStreamer.cpp:447
virtual void emitCFIRestoreState(SMLoc Loc)
Definition MCStreamer.cpp:582
virtual void emitXCOFFRefDirective(const MCSymbol *Symbol)
Emit a XCOFF .ref directive which creates R_REF type entry in the relocation table for one or more sy...
Definition MCStreamer.cpp:1289
virtual void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol)
Definition MCStreamer.cpp:387
virtual void emitCVDefRangeDirective(ArrayRef< std::pair< const MCSymbol *, const MCSymbol * > > Ranges, StringRef FixedSizePortion)
This implements the CodeView '.cv_def_range' assembler directive.
Definition MCStreamer.cpp:349
void emitInt32(uint64_t Value)
virtual void emitCFIOffset(int64_t Register, int64_t Offset, SMLoc Loc={})
Definition MCStreamer.cpp:535
virtual void emitWinCFISetFrame(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:897
void maybeEmitDwarf64Mark()
Emit a special value of 0xffffffff if producing 64-bit debugging info.
Definition MCStreamer.cpp:1111
virtual void emitCFIDefCfaOffset(int64_t Offset, SMLoc Loc={})
Definition MCStreamer.cpp:492
virtual void emitCVLocDirective(unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc)
This implements the CodeView '.cv_loc' assembler directive.
Definition MCStreamer.cpp:300
virtual void emitWinCFIAllocStack(unsigned Size, SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:919
virtual void emitFileDirective(StringRef Filename)
Switch to a new logical file.
Definition MCStreamer.cpp:1262
virtual void emitSLEB128Value(const MCExpr *Value)
Definition MCStreamer.cpp:1337
virtual void emitCFIValOffset(int64_t Register, int64_t Offset, SMLoc Loc={})
Definition MCStreamer.cpp:704
virtual void emitELFSymverDirective(const MCSymbol *OriginalSym, StringRef Name, bool KeepOriginalSym)
Emit an ELF .symver directive.
Definition MCStreamer.cpp:1308
virtual void emitXCOFFCInfoSym(StringRef Name, StringRef Metadata)
Emit a C_INFO symbol with XCOFF embedded metadata to the .info section.
Definition MCStreamer.cpp:1302
MCSection * getCurrentSectionOnly() const
virtual void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Emit the expression Value into the output as a native integer of the given Size bytes.
Definition MCStreamer.cpp:1333
void emitRawText(const Twine &String)
If this file is backed by a assembly streamer, this dumps the specified string in the output ....
Definition MCStreamer.cpp:1088
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
Definition MCStreamer.cpp:204
void addFragment(MCFragment *F)
Definition MCStreamer.cpp:1411
unsigned emitSLEB128IntValue(int64_t Value)
Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integ...
Definition MCStreamer.cpp:170
virtual bool emitCVInlineSiteIdDirective(unsigned FunctionId, unsigned IAFunc, unsigned IAFile, unsigned IALine, unsigned IACol, SMLoc Loc)
Introduces an inline call site id for use with .cv_loc.
Definition MCStreamer.cpp:286
virtual void emitCFISignalFrame()
Definition MCStreamer.cpp:633
virtual void emitVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion)
Specify the Mach-O minimum deployment target version.
virtual void emitCOFFSymbolStorageClass(int StorageClass)
Emit the storage class of the symbol.
Definition MCStreamer.cpp:1267
virtual void emitConditionalAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol, but only if Value is also emitted.
Definition MCStreamer.cpp:414
virtual void emitWinCFIStartChained(SMLoc Loc=SMLoc())
Definition MCStreamer.cpp:777
virtual void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, Align ByteAlignment=Align(1))
Emit a thread local bss (.tbss) symbol.
Definition MCStreamer.cpp:1314
virtual void emitCFIRestore(int64_t Register, SMLoc Loc={})
Definition MCStreamer.cpp:603
WinEH::FrameInfo::Epilog * CurrentWinEpilog
virtual void emitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
This implements the CodeView '.cv_inline_linetable' assembler directive.
Definition MCStreamer.cpp:331
void emitFill(uint64_t NumBytes, uint8_t FillValue)
Emit NumBytes bytes worth of the value specified by FillValue.
Definition MCStreamer.cpp:195
virtual void emitRawTextImpl(StringRef String)
EmitRawText - If this file is backed by an assembly streamer, this dumps the specified string in the ...
Definition MCStreamer.cpp:1079
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition MCStreamer.cpp:1331
void finish(SMLoc EndLoc=SMLoc())
Finish emission of machine code.
Definition MCStreamer.cpp:1097
virtual void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol)
Emit an weak reference from Alias to Symbol.
Definition MCStreamer.cpp:1330
void visitUsedExpr(const MCExpr &Expr)
Definition MCStreamer.cpp:1165
virtual void emitDwarfFile0Directive(StringRef Directory, StringRef Filename, std::optional< MD5::MD5Result > Checksum, std::optional< StringRef > Source, unsigned CUID=0)
Specify the "root" file of the compilation, using the ".file 0" extension.
Definition MCStreamer.cpp:214
virtual void emitBuildVersion(unsigned Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion)
Emit/Specify Mach-O build version command.
virtual void changeSection(MCSection *, uint32_t)
This is called by popSection and switchSection, if the current section changes.
Definition MCStreamer.cpp:1317
virtual void emitCFILLVMDefAspaceCfa(int64_t Register, int64_t Offset, int64_t AddressSpace, SMLoc Loc={})
Definition MCStreamer.cpp:523
Generic base class for all target subtargets.
Represent a reference to a symbol from inside an expression.
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 ...
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
StringRef getName() const
getName - Get the symbol name.
Target specific streamer interface.
virtual void emitDwarfFileDirective(StringRef Directive)
Definition MCStreamer.cpp:66
virtual void emitValue(const MCExpr *Value)
Definition MCStreamer.cpp:70
virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, uint64_t Address, const MCInst &Inst, const MCSubtargetInfo &STI, raw_ostream &OS)
Definition MCStreamer.cpp:1155
virtual ~MCTargetStreamer()
virtual void finish()
Definition MCStreamer.cpp:55
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Definition MCStreamer.cpp:90
virtual void emitRawBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition MCStreamer.cpp:78
MCTargetStreamer(MCStreamer &S)
Definition MCStreamer.cpp:46
virtual void changeSection(const MCSection *CurSection, MCSection *Section, uint32_t SubSection, raw_ostream &OS)
Update streamer for a new active section.
Definition MCStreamer.cpp:59
virtual void emitLabel(MCSymbol *Symbol)
Definition MCStreamer.cpp:53
virtual void emitConstantPools()
Definition MCStreamer.cpp:57
Wrapper class representing virtual and physical registers.
Represents a location in source code.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef str() const
Explicit conversion to StringRef.
pointer data()
Return a pointer to the vector's buffer, even if empty().
StringRef - Represent a constant reference to a string, i.e.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
bool isMacOSX() const
Is this a Mac OS X triple.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
Represents a version number in the form major[.minor[.subminor[.build]]].
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero).
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
StringRef str() const
Return a StringRef for the vector contents.
This class represents a function that is read from a sample profile.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ IMAGE_COMDAT_SELECT_ANY
@ C
The default llvm calling convention, compatible with C.
detail::packed_endian_specific_integral< uint16_t, llvm::endianness::little, unaligned > ulittle16_t
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
uint8_t getDwarfOffsetByteSize(DwarfFormat Format)
The size of a reference determined by the DWARF 32/64-bit format.
@ DW_LENGTH_lo_reserved
Special values for an initial length field.
@ DW_LENGTH_DWARF64
Indicator of 64-bit DWARF format.
value_type byte_swap(value_type value, endianness endian)
detail::packed_endian_specific_integral< uint16_t, llvm::endianness::little, unaligned > ulittle16_t
constexpr bool IsLittleEndianHost
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes)
StoreIntToMemory - Fills the StoreBytes bytes of memory starting from Dst with the integer held in In...
constexpr bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
FunctionAddr VTableAddr uintptr_t uintptr_t Version
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
SmallVector< InlineSite, 8 > MCPseudoProbeInlineStack
@ MCVM_WatchOSVersionMin
.watchos_version_min
@ MCVM_OSXVersionMin
.macosx_version_min
@ MCVM_TvOSVersionMin
.tvos_version_min
@ MCVM_IOSVersionMin
.ios_version_min
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
FunctionAddr VTableAddr Count
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
LLVM_ABI raw_ostream & nulls()
This returns a reference to a raw_ostream which simply discards output.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a SLEB128 value to an output stream.
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
constexpr bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a ULEB128 value to an output stream.
std::pair< MCSection *, uint32_t > MCSectionSubPair
This struct is a compact representation of a valid (non-zero power of two) alignment.
Information describing a function or inlined call site introduced by .cv_func_id or ....
MCSection * Section
The section of the first .cv_loc directive used for this function, or null if none has been seen yet.
const MCSymbol * Personality
unsigned PersonalityEncoding
std::vector< MCCFIInstruction > Instructions
unsigned CurrentCfaRegister
static WinEH::Instruction SaveXMM(MCSymbol *L, unsigned Reg, unsigned Offset)
static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg)
static WinEH::Instruction PushMachFrame(MCSymbol *L, bool Code)
static WinEH::Instruction SaveNonVol(MCSymbol *L, unsigned Reg, unsigned Offset)
static WinEH::Instruction Alloc(MCSymbol *L, unsigned Size)
static WinEH::Instruction SetFPReg(MCSymbol *L, unsigned Reg, unsigned Off)
std::vector< Instruction > Instructions
const MCSymbol * Function
const MCSymbol * PrologEnd
MapVector< MCSymbol *, Epilog > EpilogMap
const MCSymbol * FuncletOrFuncEnd
const FrameInfo * ChainedParent
static constexpr uint8_t DefaultVersion
const MCSymbol * ExceptionHandler