Lines Matching +full:os +full:- +full:data +full:- +full:offset
1 //===- lib/MC/MCAsmStreamer.cpp - Text Assembly Output ----------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
48 formatted_raw_ostream &OS; member in __anon0673dc030111::MCAsmStreamer
63 void PrintQuotedString(StringRef Data, raw_ostream &OS) const;
69 raw_svector_ostream &OS) const;
74 MCAsmStreamer(MCContext &Context, std::unique_ptr<formatted_raw_ostream> os, in MCAsmStreamer() argument
77 : MCStreamer(Context), OSOwner(std::move(os)), OS(*OSOwner), in MCAsmStreamer()
81 (asmbackend) ? asmbackend->createObjectWriter(NullStream) in MCAsmStreamer()
85 if (Assembler->getBackendPtr()) in MCAsmStreamer()
86 setAllowAutoPadding(Assembler->getBackend().allowAutoPadding()); in MCAsmStreamer()
93 IsVerboseAsm = TO->AsmVerbose; in MCAsmStreamer()
95 InstPrinter->setCommentStream(CommentStream); in MCAsmStreamer()
96 ShowInst = TO->ShowMCInst; in MCAsmStreamer()
97 switch (TO->MCUseDwarfDirectory) { in MCAsmStreamer()
106 Context.getAsmInfo()->enableDwarfFileDirectoryDefault(); in MCAsmStreamer()
119 OS << '\n'; in EmitEOL()
173 auto [Ptr, Bits] = InstPrinter->getMnemonic(&MI); in getMnemonic()
207 void emitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) override;
208 void emitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) override;
231 /// @param Symbol - The common symbol to emit.
232 /// @param Size - The size of the common symbol.
233 /// @param ByteAlignment - The alignment of the common symbol in bytes.
244 void emitBinaryData(StringRef Data) override;
246 void emitBytes(StringRef Data) override;
284 void emitValueToOffset(const MCExpr *Offset,
352 void emitCFIDefCfa(int64_t Register, int64_t Offset, SMLoc Loc) override;
353 void emitCFIDefCfaOffset(int64_t Offset, SMLoc Loc) override;
355 void emitCFILLVMDefAspaceCfa(int64_t Register, int64_t Offset,
357 void emitCFIOffset(int64_t Register, int64_t Offset, SMLoc Loc) override;
364 void emitCFIRelOffset(int64_t Register, int64_t Offset, SMLoc Loc) override;
383 void emitWinCFISetFrame(MCRegister Register, unsigned Offset,
386 void emitWinCFISaveReg(MCRegister Register, unsigned Offset,
388 void emitWinCFISaveXMM(MCRegister Register, unsigned Offset,
412 emitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr,
454 OS << '\n'; in EmitCommentsAndEOL()
464 OS.PadToColumn(MAI->getCommentColumn()); in EmitCommentsAndEOL()
466 OS << MAI->getCommentString() << ' ' << Comments.substr(0, Position) <<'\n'; in EmitCommentsAndEOL()
476 return Value & ((uint64_t) (int64_t) -1 >> (64 - Bytes * 8)); in truncateToSize()
481 OS << '\t'; in emitRawComment()
482 OS << MAI->getCommentString() << T; in emitRawComment()
488 if (c == MAI->getSeparatorString()) in addExplicitComment()
492 ExplicitCommentToEmit.append(MAI->getCommentString()); in addExplicitComment()
496 size_t p = 2, len = c.size() - 2; in addExplicitComment()
501 ExplicitCommentToEmit.append(MAI->getCommentString()); in addExplicitComment()
508 } else if (c.starts_with(StringRef(MAI->getCommentString()))) { in addExplicitComment()
514 ExplicitCommentToEmit.append(MAI->getCommentString()); in addExplicitComment()
526 OS << Comments; in emitExplicitComments()
532 TS->changeSection(getCurrentSection().first, Section, Subsection, OS); in changeSection()
534 Section->printSwitchToSection(*MAI, getContext().getTargetTriple(), OS, in changeSection()
543 OS << ".symver "; in emitELFSymverDirective()
544 OriginalSym->print(OS, MAI); in emitELFSymverDirective()
545 OS << ", " << Name; in emitELFSymverDirective()
547 OS << ", remove"; in emitELFSymverDirective()
554 Symbol->print(OS, MAI); in emitLabel()
555 OS << MAI->getLabelSuffix(); in emitLabel()
565 assert(NbArgs != -1 && ((size_t)NbArgs) == Args.size() && "Malformed LOH!"); in emitLOHDirective()
569 OS << "\t" << MCLOHDirectiveName() << " " << str << "\t"; in emitLOHDirective()
573 OS << ", "; in emitLOHDirective()
575 Arg->print(OS, MAI); in emitLOHDirective()
581 OS << "\t.gnu_attribute " << Tag << ", " << Value << "\n"; in emitGNUAttribute()
586 case MCAF_SyntaxUnified: OS << "\t.syntax unified"; break; in emitAssemblerFlag()
587 case MCAF_SubsectionsViaSymbols: OS << ".subsections_via_symbols"; break; in emitAssemblerFlag()
588 case MCAF_Code16: OS << '\t'<< MAI->getCode16Directive();break; in emitAssemblerFlag()
589 case MCAF_Code32: OS << '\t'<< MAI->getCode32Directive();break; in emitAssemblerFlag()
590 case MCAF_Code64: OS << '\t'<< MAI->getCode64Directive();break; in emitAssemblerFlag()
597 OS << "\t.linker_option \"" << Options[0] << '"'; in emitLinkerOptions()
599 OS << ", " << '"' << Opt << '"'; in emitLinkerOptions()
604 if (!MAI->doesSupportDataRegionDirectives()) in emitDataRegion()
607 case MCDR_DataRegion: OS << "\t.data_region"; break; in emitDataRegion()
608 case MCDR_DataRegionJT8: OS << "\t.data_region jt8"; break; in emitDataRegion()
609 case MCDR_DataRegionJT16: OS << "\t.data_region jt16"; break; in emitDataRegion()
610 case MCDR_DataRegionJT32: OS << "\t.data_region jt32"; break; in emitDataRegion()
611 case MCDR_DataRegionEnd: OS << "\t.end_data_region"; break; in emitDataRegion()
626 static void EmitSDKVersionSuffix(raw_ostream &OS, in EmitSDKVersionSuffix() argument
630 OS << '\t' << "sdk_version " << SDKVersion.getMajor(); in EmitSDKVersionSuffix()
632 OS << ", " << *Minor; in EmitSDKVersionSuffix()
634 OS << ", " << *Subminor; in EmitSDKVersionSuffix()
642 OS << '\t' << getVersionMinDirective(Type) << ' ' << Major << ", " << Minor; in emitVersionMin()
644 OS << ", " << Update; in emitVersionMin()
645 EmitSDKVersionSuffix(OS, SDKVersion); in emitVersionMin()
657 llvm_unreachable("Invalid Mach-O platform type"); in getPlatformName()
664 OS << "\t.build_version " << PlatformName << ", " << Major << ", " << Minor; in emitBuildVersion()
666 OS << ", " << Update; in emitBuildVersion()
667 EmitSDKVersionSuffix(OS, SDKVersion); in emitBuildVersion()
680 OS << "\t.thumb_func"; in emitThumbFunc()
681 // Only Mach-O hasSubsectionsViaSymbols() in emitThumbFunc()
682 if (MAI->hasSubsectionsViaSymbols()) { in emitThumbFunc()
683 OS << '\t'; in emitThumbFunc()
684 Func->print(OS, MAI); in emitThumbFunc()
693 if (E->inlineAssignedExpr()) in emitAssignment()
696 OS << ".set "; in emitAssignment()
697 Symbol->print(OS, MAI); in emitAssignment()
698 OS << ", "; in emitAssignment()
699 Value->print(OS, MAI); in emitAssignment()
709 OS << ".lto_set_conditional "; in emitConditionalAssignment()
710 Symbol->print(OS, MAI); in emitConditionalAssignment()
711 OS << ", "; in emitConditionalAssignment()
712 Value->print(OS, MAI); in emitConditionalAssignment()
717 OS << ".weakref "; in emitWeakReference()
718 Alias->print(OS, MAI); in emitWeakReference()
719 OS << ", "; in emitWeakReference()
720 Symbol->print(OS, MAI); in emitWeakReference()
735 if (!MAI->hasDotTypeDotSizeDirective()) in emitSymbolAttribute()
737 OS << "\t.type\t"; in emitSymbolAttribute()
738 Symbol->print(OS, MAI); in emitSymbolAttribute()
739 OS << ',' << ((MAI->getCommentString()[0] != '@') ? '@' : '%'); in emitSymbolAttribute()
742 case MCSA_ELF_TypeFunction: OS << "function"; break; in emitSymbolAttribute()
743 case MCSA_ELF_TypeIndFunction: OS << "gnu_indirect_function"; break; in emitSymbolAttribute()
744 case MCSA_ELF_TypeObject: OS << "object"; break; in emitSymbolAttribute()
745 case MCSA_ELF_TypeTLS: OS << "tls_object"; break; in emitSymbolAttribute()
746 case MCSA_ELF_TypeCommon: OS << "common"; break; in emitSymbolAttribute()
747 case MCSA_ELF_TypeNoType: OS << "notype"; break; in emitSymbolAttribute()
748 case MCSA_ELF_TypeGnuUniqueObject: OS << "gnu_unique_object"; break; in emitSymbolAttribute()
753 OS << MAI->getGlobalDirective(); in emitSymbolAttribute()
755 case MCSA_LGlobal: OS << "\t.lglobl\t"; break; in emitSymbolAttribute()
756 case MCSA_Hidden: OS << "\t.hidden\t"; break; in emitSymbolAttribute()
757 case MCSA_IndirectSymbol: OS << "\t.indirect_symbol\t"; break; in emitSymbolAttribute()
758 case MCSA_Internal: OS << "\t.internal\t"; break; in emitSymbolAttribute()
759 case MCSA_LazyReference: OS << "\t.lazy_reference\t"; break; in emitSymbolAttribute()
760 case MCSA_Local: OS << "\t.local\t"; break; in emitSymbolAttribute()
762 if (!MAI->hasNoDeadStrip()) in emitSymbolAttribute()
764 OS << "\t.no_dead_strip\t"; in emitSymbolAttribute()
766 case MCSA_SymbolResolver: OS << "\t.symbol_resolver\t"; break; in emitSymbolAttribute()
767 case MCSA_AltEntry: OS << "\t.alt_entry\t"; break; in emitSymbolAttribute()
769 OS << "\t.private_extern\t"; in emitSymbolAttribute()
771 case MCSA_Protected: OS << "\t.protected\t"; break; in emitSymbolAttribute()
772 case MCSA_Reference: OS << "\t.reference\t"; break; in emitSymbolAttribute()
774 OS << "\t.extern\t"; in emitSymbolAttribute()
776 case MCSA_Weak: OS << MAI->getWeakDirective(); break; in emitSymbolAttribute()
778 OS << "\t.weak_definition\t"; in emitSymbolAttribute()
781 case MCSA_WeakReference: OS << MAI->getWeakRefDirective(); break; in emitSymbolAttribute()
782 case MCSA_WeakDefAutoPrivate: OS << "\t.weak_def_can_be_hidden\t"; break; in emitSymbolAttribute()
786 // Non-AIX assemblers currently do not support exported visibility. in emitSymbolAttribute()
789 OS << "\t.memtag\t"; in emitSymbolAttribute()
792 OS << "\t.weak_anti_dep\t"; in emitSymbolAttribute()
796 Symbol->print(OS, MAI); in emitSymbolAttribute()
803 OS << ".desc" << ' '; in emitSymbolDesc()
804 Symbol->print(OS, MAI); in emitSymbolDesc()
805 OS << ',' << DescValue; in emitSymbolDesc()
810 if (MAI->getAssemblerDialect() == 1) { in emitSyntaxDirective()
811 OS << "\t.intel_syntax noprefix"; in emitSyntaxDirective()
820 OS << "\t.def\t"; in beginCOFFSymbolDef()
821 Symbol->print(OS, MAI); in beginCOFFSymbolDef()
822 OS << ';'; in beginCOFFSymbolDef()
827 OS << "\t.scl\t" << StorageClass << ';'; in emitCOFFSymbolStorageClass()
832 OS << "\t.type\t" << Type << ';'; in emitCOFFSymbolType()
837 OS << "\t.endef"; in endCOFFSymbolDef()
842 OS << "\t.safeseh\t"; in emitCOFFSafeSEH()
843 Symbol->print(OS, MAI); in emitCOFFSafeSEH()
848 OS << "\t.symidx\t"; in emitCOFFSymbolIndex()
849 Symbol->print(OS, MAI); in emitCOFFSymbolIndex()
854 OS << "\t.secidx\t"; in emitCOFFSectionIndex()
855 Symbol->print(OS, MAI); in emitCOFFSectionIndex()
859 void MCAsmStreamer::emitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) { in emitCOFFSecRel32() argument
860 OS << "\t.secrel32\t"; in emitCOFFSecRel32()
861 Symbol->print(OS, MAI); in emitCOFFSecRel32()
862 if (Offset != 0) in emitCOFFSecRel32()
863 OS << '+' << Offset; in emitCOFFSecRel32()
867 void MCAsmStreamer::emitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) { in emitCOFFImgRel32() argument
868 OS << "\t.rva\t"; in emitCOFFImgRel32()
869 Symbol->print(OS, MAI); in emitCOFFImgRel32()
870 if (Offset > 0) in emitCOFFImgRel32()
871 OS << '+' << Offset; in emitCOFFImgRel32()
872 else if (Offset < 0) in emitCOFFImgRel32()
873 OS << '-' << -Offset; in emitCOFFImgRel32()
877 // We need an XCOFF-specific version of this directive as the AIX syntax
884 assert(MAI->getLCOMMDirectiveAlignmentType() == LCOMM::Log2Alignment && in emitXCOFFLocalCommonSymbol()
885 "We only support writing log base-2 alignment format with XCOFF."); in emitXCOFFLocalCommonSymbol()
887 OS << "\t.lcomm\t"; in emitXCOFFLocalCommonSymbol()
888 LabelSym->print(OS, MAI); in emitXCOFFLocalCommonSymbol()
889 OS << ',' << Size << ','; in emitXCOFFLocalCommonSymbol()
890 CsectSym->print(OS, MAI); in emitXCOFFLocalCommonSymbol()
891 OS << ',' << Log2(Alignment); in emitXCOFFLocalCommonSymbol()
898 if (XSym->hasRename()) in emitXCOFFLocalCommonSymbol()
899 emitXCOFFRenameDirective(XSym, XSym->getSymbolTableName()); in emitXCOFFLocalCommonSymbol()
907 OS << MAI->getGlobalDirective(); in emitXCOFFSymbolLinkageWithVisibility()
910 OS << MAI->getWeakDirective(); in emitXCOFFSymbolLinkageWithVisibility()
913 OS << "\t.extern\t"; in emitXCOFFSymbolLinkageWithVisibility()
916 OS << "\t.lglobl\t"; in emitXCOFFSymbolLinkageWithVisibility()
922 Symbol->print(OS, MAI); in emitXCOFFSymbolLinkageWithVisibility()
929 OS << ",hidden"; in emitXCOFFSymbolLinkageWithVisibility()
932 OS << ",protected"; in emitXCOFFSymbolLinkageWithVisibility()
935 OS << ",exported"; in emitXCOFFSymbolLinkageWithVisibility()
944 if (cast<MCSymbolXCOFF>(Symbol)->hasRename()) in emitXCOFFSymbolLinkageWithVisibility()
946 cast<MCSymbolXCOFF>(Symbol)->getSymbolTableName()); in emitXCOFFSymbolLinkageWithVisibility()
951 OS << "\t.rename\t"; in emitXCOFFRenameDirective()
952 Name->print(OS, MAI); in emitXCOFFRenameDirective()
954 OS << ',' << DQ; in emitXCOFFRenameDirective()
958 OS << DQ; in emitXCOFFRenameDirective()
959 OS << C; in emitXCOFFRenameDirective()
961 OS << DQ; in emitXCOFFRenameDirective()
966 OS << "\t.ref "; in emitXCOFFRefDirective()
967 Symbol->print(OS, MAI); in emitXCOFFRefDirective()
977 OS << "\t.except\t"; in emitXCOFFExceptDirective()
978 Symbol->print(OS, MAI); in emitXCOFFExceptDirective()
979 OS << ", " << Lang << ", " << Reason; in emitXCOFFExceptDirective()
988 // Start by emitting the .info pseudo-op and C_INFO symbol name. in emitXCOFFCInfoSym()
989 OS << InfoDirective; in emitXCOFFCInfoSym()
990 PrintQuotedString(Name, OS); in emitXCOFFCInfoSym()
991 OS << Separator; in emitXCOFFCInfoSym()
995 // Emit the 4-byte length of the metadata. in emitXCOFFCInfoSym()
996 OS << format_hex(MetadataSize, 10) << Separator; in emitXCOFFCInfoSym()
1005 // assembly because the .info pseudo-op can only generate words of data. We in emitXCOFFCInfoSym()
1010 uint32_t PaddingSize = PaddedSize - MetadataSize; in emitXCOFFCInfoSym()
1015 // so we need multiple .info pseudo-ops. We choose a small number of words in emitXCOFFCInfoSym()
1016 // per pseudo-op to keep the assembly readable. in emitXCOFFCInfoSym()
1022 if (WordsBeforeNextDirective-- == 0) { in emitXCOFFCInfoSym()
1024 OS << InfoDirective; in emitXCOFFCInfoSym()
1027 OS << Separator; in emitXCOFFCInfoSym()
1029 OS << format_hex(Word, 10); in emitXCOFFCInfoSym()
1034 PrintWord(reinterpret_cast<const uint8_t *>(Metadata.data()) + Index); in emitXCOFFCInfoSym()
1039 assert(PaddedSize - Index == WordSize); in emitXCOFFCInfoSym()
1041 ::memcpy(LastWord.data(), Metadata.data() + Index, MetadataSize - Index); in emitXCOFFCInfoSym()
1042 PrintWord(LastWord.data()); in emitXCOFFCInfoSym()
1048 assert(MAI->hasDotTypeDotSizeDirective()); in emitELFSize()
1049 OS << "\t.size\t"; in emitELFSize()
1050 Symbol->print(OS, MAI); in emitELFSize()
1051 OS << ", "; in emitELFSize()
1052 Value->print(OS, MAI); in emitELFSize()
1058 OS << "\t.comm\t"; in emitCommonSymbol()
1059 Symbol->print(OS, MAI); in emitCommonSymbol()
1060 OS << ',' << Size; in emitCommonSymbol()
1062 if (MAI->getCOMMDirectiveAlignmentIsInBytes()) in emitCommonSymbol()
1063 OS << ',' << ByteAlignment.value(); in emitCommonSymbol()
1065 OS << ',' << Log2(ByteAlignment); in emitCommonSymbol()
1071 if (XSym && XSym->hasRename()) in emitCommonSymbol()
1072 emitXCOFFRenameDirective(XSym, XSym->getSymbolTableName()); in emitCommonSymbol()
1077 OS << "\t.lcomm\t"; in emitLocalCommonSymbol()
1078 Symbol->print(OS, MAI); in emitLocalCommonSymbol()
1079 OS << ',' << Size; in emitLocalCommonSymbol()
1082 switch (MAI->getLCOMMDirectiveAlignmentType()) { in emitLocalCommonSymbol()
1086 OS << ',' << ByteAlign.value(); in emitLocalCommonSymbol()
1089 OS << ',' << Log2(ByteAlign); in emitLocalCommonSymbol()
1100 Symbol->setFragment(&Section->getDummyFragment()); in emitZerofill()
1103 OS << ".zerofill "; in emitZerofill()
1105 assert(Section->getVariant() == MCSection::SV_MachO && in emitZerofill()
1106 ".zerofill is a Mach-O specific directive"); in emitZerofill()
1107 // This is a mach-o specific directive. in emitZerofill()
1110 OS << MOSection->getSegmentName() << "," << MOSection->getName(); in emitZerofill()
1113 OS << ','; in emitZerofill()
1114 Symbol->print(OS, MAI); in emitZerofill()
1115 OS << ',' << Size; in emitZerofill()
1116 OS << ',' << Log2(ByteAlignment); in emitZerofill()
1126 Symbol->setFragment(&Section->getDummyFragment()); in emitTBSSSymbol()
1130 assert(Section->getVariant() == MCSection::SV_MachO && in emitTBSSSymbol()
1131 ".zerofill is a Mach-O specific directive"); in emitTBSSSymbol()
1132 // This is a mach-o specific directive and section. in emitTBSSSymbol()
1134 OS << ".tbss "; in emitTBSSSymbol()
1135 Symbol->print(OS, MAI); in emitTBSSSymbol()
1136 OS << ", " << Size; in emitTBSSSymbol()
1141 OS << ", " << Log2(ByteAlignment); in emitTBSSSymbol()
1146 static inline bool isPrintableString(StringRef Data) { in isPrintableString() argument
1147 const auto BeginPtr = Data.begin(), EndPtr = Data.end(); in isPrintableString()
1148 for (const unsigned char C : make_range(BeginPtr, EndPtr - 1)) { in isPrintableString()
1152 return isPrint(Data.back()) || Data.back() == 0; in isPrintableString()
1157 static void PrintByteList(StringRef Data, raw_ostream &OS, in PrintByteList() argument
1159 assert(!Data.empty() && "Cannot generate an empty list."); in PrintByteList()
1160 const auto printCharacterInOctal = [&OS](unsigned char C) { in PrintByteList()
1161 OS << '0'; in PrintByteList()
1162 OS << toOctal(C >> 6); in PrintByteList()
1163 OS << toOctal(C >> 3); in PrintByteList()
1164 OS << toOctal(C >> 0); in PrintByteList()
1176 const auto printCharacterList = [Data, &OS](const auto &printOneCharacter) { in PrintByteList()
1177 const auto BeginPtr = Data.begin(), EndPtr = Data.end(); in PrintByteList()
1178 for (const unsigned char C : make_range(BeginPtr, EndPtr - 1)) { in PrintByteList()
1180 OS << ','; in PrintByteList()
1182 printOneCharacter(*(EndPtr - 1)); in PrintByteList()
1189 printCharacterList(printOneCharacterFor([&OS](char C) { in PrintByteList()
1191 OS << StringRef(AsmCharLitBuf, sizeof(AsmCharLitBuf)); in PrintByteList()
1198 void MCAsmStreamer::PrintQuotedString(StringRef Data, raw_ostream &OS) const { in PrintQuotedString() argument
1199 OS << '"'; in PrintQuotedString()
1201 if (MAI->hasPairedDoubleQuoteStringConstants()) { in PrintQuotedString()
1202 for (unsigned char C : Data) { in PrintQuotedString()
1204 OS << "\"\""; in PrintQuotedString()
1206 OS << (char)C; in PrintQuotedString()
1209 for (unsigned char C : Data) { in PrintQuotedString()
1211 OS << '\\' << (char)C; in PrintQuotedString()
1216 OS << (char)C; in PrintQuotedString()
1222 OS << "\\b"; in PrintQuotedString()
1225 OS << "\\f"; in PrintQuotedString()
1228 OS << "\\n"; in PrintQuotedString()
1231 OS << "\\r"; in PrintQuotedString()
1234 OS << "\\t"; in PrintQuotedString()
1237 OS << '\\'; in PrintQuotedString()
1238 OS << toOctal(C >> 6); in PrintQuotedString()
1239 OS << toOctal(C >> 3); in PrintQuotedString()
1240 OS << toOctal(C >> 0); in PrintQuotedString()
1246 OS << '"'; in PrintQuotedString()
1249 void MCAsmStreamer::emitBytes(StringRef Data) { in emitBytes() argument
1252 if (Data.empty()) return; in emitBytes()
1254 const auto emitAsString = [this](StringRef Data) { in emitBytes() argument
1255 // If the data ends with 0 and the target supports .asciz, use it, otherwise in emitBytes()
1256 // use .ascii or a byte-list directive in emitBytes()
1257 if (MAI->getAscizDirective() && Data.back() == 0) { in emitBytes()
1258 OS << MAI->getAscizDirective(); in emitBytes()
1259 Data = Data.substr(0, Data.size() - 1); in emitBytes()
1260 } else if (LLVM_LIKELY(MAI->getAsciiDirective())) { in emitBytes()
1261 OS << MAI->getAsciiDirective(); in emitBytes()
1262 } else if (MAI->hasPairedDoubleQuoteStringConstants() && in emitBytes()
1263 isPrintableString(Data)) { in emitBytes()
1266 assert(MAI->getPlainStringDirective() && in emitBytes()
1269 assert(MAI->getByteListDirective() && in emitBytes()
1272 if (Data.back() == 0) { in emitBytes()
1273 OS << MAI->getPlainStringDirective(); in emitBytes()
1274 Data = Data.substr(0, Data.size() - 1); in emitBytes()
1276 OS << MAI->getByteListDirective(); in emitBytes()
1278 } else if (MAI->getByteListDirective()) { in emitBytes()
1279 OS << MAI->getByteListDirective(); in emitBytes()
1280 PrintByteList(Data, OS, MAI->characterLiteralSyntax()); in emitBytes()
1287 PrintQuotedString(Data, OS); in emitBytes()
1292 if (Data.size() != 1 && emitAsString(Data)) in emitBytes()
1295 // Only single byte is provided or no ascii, asciz, or byte-list directives in emitBytes()
1296 // are applicable. Emit as vector of individual 8bits data elements. in emitBytes()
1298 TS->emitRawBytes(Data); in emitBytes()
1301 const char *Directive = MAI->getData8bitsDirective(); in emitBytes()
1302 for (const unsigned char C : Data.bytes()) { in emitBytes()
1303 OS << Directive << (unsigned)C; in emitBytes()
1308 void MCAsmStreamer::emitBinaryData(StringRef Data) { in emitBinaryData() argument
1309 // This is binary data. Print it in a grid of hex bytes for readability. in emitBinaryData()
1311 for (size_t I = 0, EI = alignTo(Data.size(), Cols); I < EI; I += Cols) { in emitBinaryData()
1312 size_t J = I, EJ = std::min(I + Cols, Data.size()); in emitBinaryData()
1314 OS << MAI->getData8bitsDirective(); in emitBinaryData()
1315 for (; J < EJ - 1; ++J) in emitBinaryData()
1316 OS << format("0x%02x", uint8_t(Data[J])) << ", "; in emitBinaryData()
1317 OS << format("0x%02x", uint8_t(Data[J])); in emitBinaryData()
1343 case 1: Directive = MAI->getData8bitsDirective(); break; in emitValueImpl()
1344 case 2: Directive = MAI->getData16bitsDirective(); break; in emitValueImpl()
1345 case 4: Directive = MAI->getData32bitsDirective(); break; in emitValueImpl()
1346 case 8: Directive = MAI->getData64bitsDirective(); break; in emitValueImpl()
1351 if (!Value->evaluateAsAbsolute(IntValue)) in emitValueImpl()
1358 bool IsLittleEndian = MAI->isLittleEndian(); in emitValueImpl()
1360 unsigned Remaining = Size - Emitted; in emitValueImpl()
1363 unsigned EmissionSize = llvm::bit_floor(std::min(Remaining, Size - 1)); in emitValueImpl()
1364 // Calculate the byte offset of our partial emission taking into account in emitValueImpl()
1367 IsLittleEndian ? Emitted : (Remaining - EmissionSize); in emitValueImpl()
1372 uint64_t Shift = 64 - EmissionSize * 8; in emitValueImpl()
1384 OS << Directive; in emitValueImpl()
1386 TS->emitValue(Value); in emitValueImpl()
1388 Value->print(OS, MAI); in emitValueImpl()
1395 if (Value->evaluateAsAbsolute(IntValue)) { in emitULEB128Value()
1399 OS << "\t.uleb128 "; in emitULEB128Value()
1400 Value->print(OS, MAI); in emitULEB128Value()
1406 if (Value->evaluateAsAbsolute(IntValue)) { in emitSLEB128Value()
1410 OS << "\t.sleb128 "; in emitSLEB128Value()
1411 Value->print(OS, MAI); in emitSLEB128Value()
1416 assert(MAI->getDTPRel64Directive() != nullptr); in emitDTPRel64Value()
1417 OS << MAI->getDTPRel64Directive(); in emitDTPRel64Value()
1418 Value->print(OS, MAI); in emitDTPRel64Value()
1423 assert(MAI->getDTPRel32Directive() != nullptr); in emitDTPRel32Value()
1424 OS << MAI->getDTPRel32Directive(); in emitDTPRel32Value()
1425 Value->print(OS, MAI); in emitDTPRel32Value()
1430 assert(MAI->getTPRel64Directive() != nullptr); in emitTPRel64Value()
1431 OS << MAI->getTPRel64Directive(); in emitTPRel64Value()
1432 Value->print(OS, MAI); in emitTPRel64Value()
1437 assert(MAI->getTPRel32Directive() != nullptr); in emitTPRel32Value()
1438 OS << MAI->getTPRel32Directive(); in emitTPRel32Value()
1439 Value->print(OS, MAI); in emitTPRel32Value()
1444 assert(MAI->getGPRel64Directive() != nullptr); in emitGPRel64Value()
1445 OS << MAI->getGPRel64Directive(); in emitGPRel64Value()
1446 Value->print(OS, MAI); in emitGPRel64Value()
1451 assert(MAI->getGPRel32Directive() != nullptr); in emitGPRel32Value()
1452 OS << MAI->getGPRel32Directive(); in emitGPRel32Value()
1453 Value->print(OS, MAI); in emitGPRel32Value()
1464 if (const char *ZeroDirective = MAI->getZeroDirective()) { in emitFill()
1465 if (MAI->doesZeroDirectiveSupportNonZeroValue() || FillValue == 0) { in emitFill()
1467 OS << ZeroDirective; in emitFill()
1468 NumBytes.print(OS, MAI); in emitFill()
1470 OS << ',' << (int)FillValue; in emitFill()
1475 "Cannot emit non-absolute expression lengths of fill."); in emitFill()
1477 OS << MAI->getData8bitsDirective() << (int)FillValue; in emitFill()
1490 OS << "\t.fill\t"; in emitFill()
1491 NumValues.print(OS, MAI); in emitFill()
1492 OS << ", " << Size << ", 0x"; in emitFill()
1493 OS.write_hex(truncateToSize(Expr, 4)); in emitFill()
1501 if (MAI->useDotAlignForAlignment()) { in emitAlignmentDirective()
1503 report_fatal_error("Only power-of-two alignments are supported " in emitAlignmentDirective()
1505 OS << "\t.align\t"; in emitAlignmentDirective()
1506 OS << Log2_64(ByteAlignment); in emitAlignmentDirective()
1511 // Some assemblers don't support non-power of two alignments, so we always in emitAlignmentDirective()
1518 OS << "\t.p2align\t"; in emitAlignmentDirective()
1521 OS << ".p2alignw "; in emitAlignmentDirective()
1524 OS << ".p2alignl "; in emitAlignmentDirective()
1530 OS << Log2_64(ByteAlignment); in emitAlignmentDirective()
1534 OS << ", 0x"; in emitAlignmentDirective()
1535 OS.write_hex(truncateToSize(*Value, ValueSize)); in emitAlignmentDirective()
1537 OS << ", "; in emitAlignmentDirective()
1541 OS << ", " << MaxBytesToEmit; in emitAlignmentDirective()
1547 // Non-power of two alignment. This is not widely supported by assemblers. in emitAlignmentDirective()
1551 case 1: OS << ".balign"; break; in emitAlignmentDirective()
1552 case 2: OS << ".balignw"; break; in emitAlignmentDirective()
1553 case 4: OS << ".balignl"; break; in emitAlignmentDirective()
1557 OS << ' ' << ByteAlignment; in emitAlignmentDirective()
1559 OS << ", " << truncateToSize(*Value, ValueSize); in emitAlignmentDirective()
1561 OS << ", "; in emitAlignmentDirective()
1563 OS << ", " << MaxBytesToEmit; in emitAlignmentDirective()
1577 if (MAI->getTextAlignFillValue()) in emitCodeAlignment()
1578 emitAlignmentDirective(Alignment.value(), MAI->getTextAlignFillValue(), 1, in emitCodeAlignment()
1584 void MCAsmStreamer::emitValueToOffset(const MCExpr *Offset, in emitValueToOffset() argument
1587 // FIXME: Verify that Offset is associated with the current section. in emitValueToOffset()
1588 OS << ".org "; in emitValueToOffset()
1589 Offset->print(OS, MAI); in emitValueToOffset()
1590 OS << ", " << (unsigned)Value; in emitValueToOffset()
1595 assert(MAI->hasSingleParameterDotFile()); in emitFileDirective()
1596 OS << "\t.file\t"; in emitFileDirective()
1597 PrintQuotedString(Filename, OS); in emitFileDirective()
1605 assert(MAI->hasFourStringsDotFile()); in emitFileDirective()
1606 OS << "\t.file\t"; in emitFileDirective()
1607 PrintQuotedString(Filename, OS); in emitFileDirective()
1612 OS << ","; in emitFileDirective()
1614 PrintQuotedString(TimeStamp, OS); in emitFileDirective()
1616 OS << ","; in emitFileDirective()
1618 PrintQuotedString(CompilerVersion, OS); in emitFileDirective()
1620 OS << ","; in emitFileDirective()
1621 PrintQuotedString(Description, OS); in emitFileDirective()
1631 bool UseDwarfDirectory, raw_svector_ostream &OS) const { in printDwarfFileDirective()
1645 OS << "\t.file\t" << FileNo << ' '; in printDwarfFileDirective()
1647 PrintQuotedString(Directory, OS); in printDwarfFileDirective()
1648 OS << ' '; in printDwarfFileDirective()
1650 PrintQuotedString(Filename, OS); in printDwarfFileDirective()
1652 OS << " md5 0x" << Checksum->digest(); in printDwarfFileDirective()
1654 OS << " source "; in printDwarfFileDirective()
1655 PrintQuotedString(*Source, OS); in printDwarfFileDirective()
1677 !MAI->usesDwarfFileAndLocDirectives()) in tryEmitDwarfFileDirective()
1686 TS->emitDwarfFileDirective(OS1.str()); in tryEmitDwarfFileDirective()
1706 if (!MAI->usesDwarfFileAndLocDirectives()) in emitDwarfFile0Directive()
1715 TS->emitDwarfFileDirective(OS1.str()); in emitDwarfFile0Directive()
1726 if (!MAI->usesDwarfFileAndLocDirectives()) { in emitDwarfLocDirective()
1730 this->MCStreamer::emitDwarfLocDirective(FileNo, Line, Column, Flags, Isa, in emitDwarfLocDirective()
1735 OS << "\t.loc\t" << FileNo << " " << Line << " " << Column; in emitDwarfLocDirective()
1736 if (MAI->supportsExtendedDwarfLocDirective()) { in emitDwarfLocDirective()
1738 OS << " basic_block"; in emitDwarfLocDirective()
1740 OS << " prologue_end"; in emitDwarfLocDirective()
1742 OS << " epilogue_begin"; in emitDwarfLocDirective()
1746 OS << " is_stmt "; in emitDwarfLocDirective()
1749 OS << "1"; in emitDwarfLocDirective()
1751 OS << "0"; in emitDwarfLocDirective()
1755 OS << " isa " << Isa; in emitDwarfLocDirective()
1757 OS << " discriminator " << Discriminator; in emitDwarfLocDirective()
1761 OS.PadToColumn(MAI->getCommentColumn()); in emitDwarfLocDirective()
1762 OS << MAI->getCommentString() << ' ' << FileName << ':' in emitDwarfLocDirective()
1766 this->MCStreamer::emitDwarfLocDirective(FileNo, Line, Column, Flags, Isa, in emitDwarfLocDirective()
1783 OS << "\t.cv_file\t" << FileNo << ' '; in emitCVFileDirective()
1784 PrintQuotedString(Filename, OS); in emitCVFileDirective()
1791 OS << ' '; in emitCVFileDirective()
1792 PrintQuotedString(toHex(Checksum), OS); in emitCVFileDirective()
1793 OS << ' ' << ChecksumKind; in emitCVFileDirective()
1800 OS << "\t.cv_func_id " << FuncId << '\n'; in emitCVFuncIdDirective()
1809 OS << "\t.cv_inline_site_id " << FunctionId << " within " << IAFunc in emitCVInlineSiteIdDirective()
1823 OS << "\t.cv_loc\t" << FunctionId << " " << FileNo << " " << Line << " " in emitCVLocDirective()
1826 OS << " prologue_end"; in emitCVLocDirective()
1829 OS << " is_stmt 1"; in emitCVLocDirective()
1832 OS.PadToColumn(MAI->getCommentColumn()); in emitCVLocDirective()
1833 OS << MAI->getCommentString() << ' ' << FileName << ':' << Line << ':' in emitCVLocDirective()
1842 OS << "\t.cv_linetable\t" << FunctionId << ", "; in emitCVLinetableDirective()
1843 FnStart->print(OS, MAI); in emitCVLinetableDirective()
1844 OS << ", "; in emitCVLinetableDirective()
1845 FnEnd->print(OS, MAI); in emitCVLinetableDirective()
1847 this->MCStreamer::emitCVLinetableDirective(FunctionId, FnStart, FnEnd); in emitCVLinetableDirective()
1855 OS << "\t.cv_inline_linetable\t" << PrimaryFunctionId << ' ' << SourceFileId in emitCVInlineLinetableDirective()
1857 FnStartSym->print(OS, MAI); in emitCVInlineLinetableDirective()
1858 OS << ' '; in emitCVInlineLinetableDirective()
1859 FnEndSym->print(OS, MAI); in emitCVInlineLinetableDirective()
1861 this->MCStreamer::emitCVInlineLinetableDirective( in emitCVInlineLinetableDirective()
1867 OS << "\t.cv_def_range\t"; in PrintCVDefRangePrefix()
1869 OS << ' '; in PrintCVDefRangePrefix()
1870 Range.first->print(OS, MAI); in PrintCVDefRangePrefix()
1871 OS << ' '; in PrintCVDefRangePrefix()
1872 Range.second->print(OS, MAI); in PrintCVDefRangePrefix()
1880 OS << ", reg_rel, "; in emitCVDefRangeDirective()
1881 OS << DRHdr.Register << ", " << DRHdr.Flags << ", " in emitCVDefRangeDirective()
1890 OS << ", subfield_reg, "; in emitCVDefRangeDirective()
1891 OS << DRHdr.Register << ", " << DRHdr.OffsetInParent; in emitCVDefRangeDirective()
1899 OS << ", reg, "; in emitCVDefRangeDirective()
1900 OS << DRHdr.Register; in emitCVDefRangeDirective()
1908 OS << ", frame_ptr_rel, "; in emitCVDefRangeDirective()
1909 OS << DRHdr.Offset; in emitCVDefRangeDirective()
1914 OS << "\t.cv_stringtable"; in emitCVStringTableDirective()
1919 OS << "\t.cv_filechecksums"; in emitCVFileChecksumsDirective()
1924 OS << "\t.cv_filechecksumoffset\t" << FileNo; in emitCVFileChecksumOffsetDirective()
1929 OS << "\t.cv_fpo_data\t"; in emitCVFPOData()
1930 ProcSym->print(OS, MAI); in emitCVFPOData()
1935 assert(MAI->hasIdentDirective() && ".ident directive not supported"); in emitIdent()
1936 OS << "\t.ident\t"; in emitIdent()
1937 PrintQuotedString(IdentString, OS); in emitIdent()
1943 OS << "\t.cfi_sections "; in emitCFISections()
1945 OS << ".eh_frame"; in emitCFISections()
1947 OS << ", .debug_frame"; in emitCFISections()
1949 OS << ".debug_frame"; in emitCFISections()
1956 OS << "\t.cfi_startproc"; in emitCFIStartProcImpl()
1958 OS << " simple"; in emitCFIStartProcImpl()
1964 OS << "\t.cfi_endproc"; in emitCFIEndProcImpl()
1969 if (!MAI->useDwarfRegNumForCFI()) { in EmitRegisterName()
1975 MRI->getLLVMRegNum(Register, true)) { in EmitRegisterName()
1976 InstPrinter->printRegName(OS, *LLVMRegister); in EmitRegisterName()
1980 OS << Register; in EmitRegisterName()
1983 void MCAsmStreamer::emitCFIDefCfa(int64_t Register, int64_t Offset, SMLoc Loc) { in emitCFIDefCfa() argument
1984 MCStreamer::emitCFIDefCfa(Register, Offset, Loc); in emitCFIDefCfa()
1985 OS << "\t.cfi_def_cfa "; in emitCFIDefCfa()
1987 OS << ", " << Offset; in emitCFIDefCfa()
1991 void MCAsmStreamer::emitCFIDefCfaOffset(int64_t Offset, SMLoc Loc) { in emitCFIDefCfaOffset() argument
1992 MCStreamer::emitCFIDefCfaOffset(Offset, Loc); in emitCFIDefCfaOffset()
1993 OS << "\t.cfi_def_cfa_offset " << Offset; in emitCFIDefCfaOffset()
1997 void MCAsmStreamer::emitCFILLVMDefAspaceCfa(int64_t Register, int64_t Offset, in emitCFILLVMDefAspaceCfa() argument
1999 MCStreamer::emitCFILLVMDefAspaceCfa(Register, Offset, AddressSpace, Loc); in emitCFILLVMDefAspaceCfa()
2000 OS << "\t.cfi_llvm_def_aspace_cfa "; in emitCFILLVMDefAspaceCfa()
2002 OS << ", " << Offset; in emitCFILLVMDefAspaceCfa()
2003 OS << ", " << AddressSpace; in emitCFILLVMDefAspaceCfa()
2007 static void PrintCFIEscape(llvm::formatted_raw_ostream &OS, StringRef Values) { in PrintCFIEscape() argument
2008 OS << "\t.cfi_escape "; in PrintCFIEscape()
2010 size_t e = Values.size() - 1; in PrintCFIEscape()
2012 OS << format("0x%02x", uint8_t(Values[i])) << ", "; in PrintCFIEscape()
2013 OS << format("0x%02x", uint8_t(Values[e])); in PrintCFIEscape()
2019 PrintCFIEscape(OS, Values); in emitCFIEscape()
2029 PrintCFIEscape(OS, StringRef((const char *)&Buffer[0], Len)); in emitCFIGnuArgsSize()
2035 OS << "\t.cfi_def_cfa_register "; in emitCFIDefCfaRegister()
2040 void MCAsmStreamer::emitCFIOffset(int64_t Register, int64_t Offset, SMLoc Loc) { in emitCFIOffset() argument
2041 MCStreamer::emitCFIOffset(Register, Offset, Loc); in emitCFIOffset()
2042 OS << "\t.cfi_offset "; in emitCFIOffset()
2044 OS << ", " << Offset; in emitCFIOffset()
2051 OS << "\t.cfi_personality " << Encoding << ", "; in emitCFIPersonality()
2052 Sym->print(OS, MAI); in emitCFIPersonality()
2058 OS << "\t.cfi_lsda " << Encoding << ", "; in emitCFILsda()
2059 Sym->print(OS, MAI); in emitCFILsda()
2065 OS << "\t.cfi_remember_state"; in emitCFIRememberState()
2071 OS << "\t.cfi_restore_state"; in emitCFIRestoreState()
2077 OS << "\t.cfi_restore "; in emitCFIRestore()
2084 OS << "\t.cfi_same_value "; in emitCFISameValue()
2089 void MCAsmStreamer::emitCFIRelOffset(int64_t Register, int64_t Offset, in emitCFIRelOffset() argument
2091 MCStreamer::emitCFIRelOffset(Register, Offset, Loc); in emitCFIRelOffset()
2092 OS << "\t.cfi_rel_offset "; in emitCFIRelOffset()
2094 OS << ", " << Offset; in emitCFIRelOffset()
2100 OS << "\t.cfi_adjust_cfa_offset " << Adjustment; in emitCFIAdjustCfaOffset()
2106 OS << "\t.cfi_signal_frame"; in emitCFISignalFrame()
2112 OS << "\t.cfi_undefined "; in emitCFIUndefined()
2120 OS << "\t.cfi_register "; in emitCFIRegister()
2122 OS << ", "; in emitCFIRegister()
2129 OS << "\t.cfi_window_save"; in emitCFIWindowSave()
2135 OS << "\t.cfi_negate_ra_state"; in emitCFINegateRAState()
2141 OS << "\t.cfi_return_column "; in emitCFIReturnColumn()
2148 OS << "\t.cfi_label " << Name; in emitCFILabelDirective()
2154 OS << "\t.cfi_b_key_frame"; in emitCFIBKeyFrame()
2160 OS << "\t.cfi_mte_tagged_frame"; in emitCFIMTETaggedFrame()
2167 OS << ".seh_proc "; in emitWinCFIStartProc()
2168 Symbol->print(OS, MAI); in emitWinCFIStartProc()
2175 OS << "\t.seh_endproc"; in emitWinCFIEndProc()
2182 OS << "\t.seh_endfunclet"; in emitWinCFIFuncletOrFuncEnd()
2189 OS << "\t.seh_startchained"; in emitWinCFIStartChained()
2196 OS << "\t.seh_endchained"; in emitWinCFIEndChained()
2204 OS << "\t.seh_handler "; in emitWinEHHandler()
2205 Sym->print(OS, MAI); in emitWinEHHandler()
2211 OS << ", " << Marker << "unwind"; in emitWinEHHandler()
2213 OS << ", " << Marker << "except"; in emitWinEHHandler()
2223 // data block is visible. in emitWinEHHandlerData()
2231 MCSection *TextSec = &CurFrame->Function->getSection(); in emitWinEHHandlerData()
2235 OS << "\t.seh_handlerdata"; in emitWinEHHandlerData()
2242 OS << "\t.seh_pushreg "; in emitWinCFIPushReg()
2243 InstPrinter->printRegName(OS, Register); in emitWinCFIPushReg()
2247 void MCAsmStreamer::emitWinCFISetFrame(MCRegister Register, unsigned Offset, in emitWinCFISetFrame() argument
2249 MCStreamer::emitWinCFISetFrame(Register, Offset, Loc); in emitWinCFISetFrame()
2251 OS << "\t.seh_setframe "; in emitWinCFISetFrame()
2252 InstPrinter->printRegName(OS, Register); in emitWinCFISetFrame()
2253 OS << ", " << Offset; in emitWinCFISetFrame()
2260 OS << "\t.seh_stackalloc " << Size; in emitWinCFIAllocStack()
2264 void MCAsmStreamer::emitWinCFISaveReg(MCRegister Register, unsigned Offset, in emitWinCFISaveReg() argument
2266 MCStreamer::emitWinCFISaveReg(Register, Offset, Loc); in emitWinCFISaveReg()
2268 OS << "\t.seh_savereg "; in emitWinCFISaveReg()
2269 InstPrinter->printRegName(OS, Register); in emitWinCFISaveReg()
2270 OS << ", " << Offset; in emitWinCFISaveReg()
2274 void MCAsmStreamer::emitWinCFISaveXMM(MCRegister Register, unsigned Offset, in emitWinCFISaveXMM() argument
2276 MCStreamer::emitWinCFISaveXMM(Register, Offset, Loc); in emitWinCFISaveXMM()
2278 OS << "\t.seh_savexmm "; in emitWinCFISaveXMM()
2279 InstPrinter->printRegName(OS, Register); in emitWinCFISaveXMM()
2280 OS << ", " << Offset; in emitWinCFISaveXMM()
2287 OS << "\t.seh_pushframe"; in emitWinCFIPushFrame()
2289 OS << " @code"; in emitWinCFIPushFrame()
2296 OS << "\t.seh_endprologue"; in emitWinCFIEndProlog()
2303 OS << "\t.cg_profile "; in emitCGProfileEntry()
2304 From->getSymbol().print(OS, MAI); in emitCGProfileEntry()
2305 OS << ", "; in emitCGProfileEntry()
2306 To->getSymbol().print(OS, MAI); in emitCGProfileEntry()
2307 OS << ", " << Count; in emitCGProfileEntry()
2313 raw_ostream &OS = getCommentOS(); in AddEncodingComment() local
2324 // representation. We do this by making a per-bit map to the fixup item index, in AddEncodingComment()
2337 assert(Index < Code.size() * 8 && "Invalid offset in fixup!"); in AddEncodingComment()
2343 // high order halfword of a 32-bit Thumb2 instruction is emitted first. in AddEncodingComment()
2344 OS << "encoding: ["; in AddEncodingComment()
2347 OS << ','; in AddEncodingComment()
2361 OS << format("0x%02x", uint8_t(Code[i])); in AddEncodingComment()
2365 OS << format("0x%02x", uint8_t(Code[i])) << '\'' in AddEncodingComment()
2366 << char('A' + MapEntry - 1) << '\''; in AddEncodingComment()
2368 OS << char('A' + MapEntry - 1); in AddEncodingComment()
2372 OS << "0b"; in AddEncodingComment()
2373 for (unsigned j = 8; j--;) { in AddEncodingComment()
2377 if (MAI->isLittleEndian()) in AddEncodingComment()
2380 FixupBit = i * 8 + (7-j); in AddEncodingComment()
2384 OS << char('A' + MapEntry - 1); in AddEncodingComment()
2386 OS << Bit; in AddEncodingComment()
2390 OS << "]\n"; in AddEncodingComment()
2396 OS << " fixup " << char('A' + i) << " - " in AddEncodingComment()
2397 << "offset: " << F.getOffset() << ", value: "; in AddEncodingComment()
2398 F.getValue()->print(OS, MAI); in AddEncodingComment()
2399 OS << ", kind: " << Info.Name << "\n"; in AddEncodingComment()
2408 if (!MAI->usesDwarfFileAndLocDirectives()) in emitInstruction()
2423 getTargetStreamer()->prettyPrintAsm(*InstPrinter, 0, Inst, STI, OS); in emitInstruction()
2425 InstPrinter->printInst(&Inst, 0, "", STI, OS); in emitInstruction()
2439 OS << "\t.pseudoprobe\t" << Guid << " " << Index << " " << Type << " " << Attr; in emitPseudoProbe()
2441 OS << " " << Discriminator; in emitPseudoProbe()
2445 OS << " @ " << std::get<0>(Site) << ":" << std::get<1>(Site); in emitPseudoProbe()
2447 OS << " " << FnSym->getName(); in emitPseudoProbe()
2453 OS << "\t.bundle_align_mode " << Log2(Alignment); in emitBundleAlignMode()
2458 OS << "\t.bundle_lock"; in emitBundleLock()
2460 OS << " align_to_end"; in emitBundleLock()
2465 OS << "\t.bundle_unlock"; in emitBundleUnlock()
2470 MCAsmStreamer::emitRelocDirective(const MCExpr &Offset, StringRef Name, in emitRelocDirective() argument
2473 OS << "\t.reloc "; in emitRelocDirective()
2474 Offset.print(OS, MAI); in emitRelocDirective()
2475 OS << ", " << Name; in emitRelocDirective()
2477 OS << ", "; in emitRelocDirective()
2478 Expr->print(OS, MAI); in emitRelocDirective()
2485 OS << "\t.addrsig"; in emitAddrsig()
2490 OS << "\t.addrsig_sym "; in emitAddrsigSym()
2491 Sym->print(OS, MAI); in emitAddrsigSym()
2495 /// EmitRawText - If this file is backed by an assembly streamer, this dumps
2500 OS << String; in emitRawTextImpl()
2511 if (!MAI->usesDwarfFileAndLocDirectives()) { in finishImpl()
2516 // Emit the label for the line table, if requested - since the rest of the in finishImpl()
2522 if (auto *Label = Tables.begin()->second.getLabel()) { in finishImpl()
2523 switchSection(getContext().getObjectFileInfo()->getDwarfLineSection()); in finishImpl()
2535 // to account for the offset introduced by the inserted length field. in emitDwarfUnitLength()
2536 if (!MAI->needsDwarfSectionSizeInHeader()) in emitDwarfUnitLength()
2548 // to account for the offset introduced by the inserted length field. in emitDwarfUnitLength()
2549 if (!MAI->needsDwarfSectionSizeInHeader()) in emitDwarfUnitLength()
2560 // to account for the offset introduced by the inserted length field. in emitDwarfLineStartLabel()
2562 if (!MAI->needsDwarfSectionSizeInHeader()) { in emitDwarfLineStartLabel()
2567 // Adjust the outer reference to account for the offset introduced by the in emitDwarfLineStartLabel()
2583 // If the targets write the raw debug line data for assembly output (We can in emitDwarfLineEndEntry()
2588 assert(!MAI->usesDwarfFileAndLocDirectives() && in emitDwarfLineEndEntry()
2589 ".loc should not be generated together with raw data!"); in emitDwarfLineEndEntry()
2594 // the explicit sections and -ffunction-sections when we try to generate or in emitDwarfLineEndEntry()
2596 MCSection *TextSection = Ctx.getObjectFileInfo()->getTextSection(); in emitDwarfLineEndEntry()
2597 assert(TextSection->hasEnded() && ".text section is not end!"); in emitDwarfLineEndEntry()
2599 MCSymbol *SectionEnd = TextSection->getEndSymbol(Ctx); in emitDwarfLineEndEntry()
2602 AsmInfo->getCodePointerSize()); in emitDwarfLineEndEntry()
2610 assert(!MAI->usesDwarfFileAndLocDirectives() && in emitDwarfAdvanceLineAddr()
2611 ".loc/.file don't need raw data in debug line section!"); in emitDwarfAdvanceLineAddr()
2614 AddComment("Set address to " + Label->getName()); in emitDwarfAdvanceLineAddr()
2647 if (MAI->usesDwarfFileAndLocDirectives()) in doFinalizationAtSectionEnd()
2652 MCSymbol *Sym = getCurrentSectionOnly()->getEndSymbol(getContext()); in doFinalizationAtSectionEnd()
2654 if (!Sym->isInSection()) in doFinalizationAtSectionEnd()
2659 std::unique_ptr<formatted_raw_ostream> OS, in createAsmStreamer() argument
2663 return new MCAsmStreamer(Context, std::move(OS), IP, std::move(CE), in createAsmStreamer()