Lines Matching refs:MCOS

94 void MCDwarfLineEntry::make(MCStreamer *MCOS, MCSection *Section) {  in make()  argument
95 if (!MCOS->getContext().getDwarfLocSeen()) in make()
99 MCSymbol *LineSym = MCOS->getContext().createTempSymbol(); in make()
101 MCOS->emitLabel(LineSym); in make()
104 const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc(); in make()
110 MCOS->getContext().clearDwarfLocSeen(); in make()
113 MCOS->getContext() in make()
114 .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID()) in make()
170 MCStreamer *MCOS, MCSection *Section, in emitOne() argument
190 const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo(); in emitOne()
192 MCOS->emitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, Label, in emitOne()
203 MCOS->emitInt8(dwarf::DW_LNS_set_file); in emitOne()
204 MCOS->emitULEB128IntValue(FileNum); in emitOne()
208 MCOS->emitInt8(dwarf::DW_LNS_set_column); in emitOne()
209 MCOS->emitULEB128IntValue(Column); in emitOne()
212 MCOS->getContext().getDwarfVersion() >= 4) { in emitOne()
215 MCOS->emitInt8(dwarf::DW_LNS_extended_op); in emitOne()
216 MCOS->emitULEB128IntValue(Size + 1); in emitOne()
217 MCOS->emitInt8(dwarf::DW_LNE_set_discriminator); in emitOne()
218 MCOS->emitULEB128IntValue(Discriminator); in emitOne()
222 MCOS->emitInt8(dwarf::DW_LNS_set_isa); in emitOne()
223 MCOS->emitULEB128IntValue(Isa); in emitOne()
227 MCOS->emitInt8(dwarf::DW_LNS_negate_stmt); in emitOne()
230 MCOS->emitInt8(dwarf::DW_LNS_set_basic_block); in emitOne()
232 MCOS->emitInt8(dwarf::DW_LNS_set_prologue_end); in emitOne()
234 MCOS->emitInt8(dwarf::DW_LNS_set_epilogue_begin); in emitOne()
239 MCOS->emitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label, in emitOne()
253 MCOS->emitDwarfLineEndEntry(Section, LastLabel); in emitOne()
259 void MCDwarfLineTable::emit(MCStreamer *MCOS, MCDwarfLineTableParams Params) { in emit() argument
260 MCContext &context = MCOS->getContext(); in emit()
275 MCOS->switchSection(context.getObjectFileInfo()->getDwarfLineSection()); in emit()
279 CUIDTablePair.second.emitCU(MCOS, Params, LineStr); in emit()
283 LineStr->emitSection(MCOS); in emit()
286 void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params, in Emit() argument
291 MCOS.switchSection(Section); in Emit()
292 MCOS.emitLabel(Header.Emit(&MCOS, Params, std::nullopt, NoLineStr).second); in Emit()
296 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
314 return Emit(MCOS, Params, in Emit()
335 void MCDwarfLineStr::emitSection(MCStreamer *MCOS) { in emitSection() argument
337 MCOS->switchSection( in emitSection()
338 MCOS->getContext().getObjectFileInfo()->getDwarfLineStrSection()); in emitSection()
340 MCOS->emitBinaryData(Data.str()); in emitSection()
357 void MCDwarfLineStr::emitRef(MCStreamer *MCOS, StringRef Path) { in emitRef() argument
359 dwarf::getDwarfOffsetByteSize(MCOS->getContext().getDwarfFormat()); in emitRef()
362 MCContext &Ctx = MCOS->getContext(); in emitRef()
363 MCOS->emitValue(makeStartPlusIntExpr(Ctx, *LineStrLabel, Offset), RefSize); in emitRef()
365 MCOS->emitIntValue(Offset, RefSize); in emitRef()
368 void MCDwarfLineTableHeader::emitV2FileDirTables(MCStreamer *MCOS) const { in emitV2FileDirTables()
371 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV2FileDirTables()
372 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
374 MCOS->emitInt8(0); // Terminate the directory list. in emitV2FileDirTables()
379 MCOS->emitBytes(MCDwarfFiles[i].Name); // FileName and... in emitV2FileDirTables()
380 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
381 MCOS->emitULEB128IntValue(MCDwarfFiles[i].DirIndex); // Directory number. in emitV2FileDirTables()
382 MCOS->emitInt8(0); // Last modification timestamp (always 0). in emitV2FileDirTables()
383 MCOS->emitInt8(0); // File size (always 0). in emitV2FileDirTables()
385 MCOS->emitInt8(0); // Terminate the file list. in emitV2FileDirTables()
388 static void emitOneV5FileEntry(MCStreamer *MCOS, const MCDwarfFile &DwarfFile, in emitOneV5FileEntry() argument
393 LineStr->emitRef(MCOS, DwarfFile.Name); in emitOneV5FileEntry()
395 MCOS->emitBytes(DwarfFile.Name); // FileName and... in emitOneV5FileEntry()
396 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
398 MCOS->emitULEB128IntValue(DwarfFile.DirIndex); // Directory number. in emitOneV5FileEntry()
401 MCOS->emitBinaryData( in emitOneV5FileEntry()
406 LineStr->emitRef(MCOS, DwarfFile.Source.value_or(StringRef())); in emitOneV5FileEntry()
408 MCOS->emitBytes(DwarfFile.Source.value_or(StringRef())); // Source and... in emitOneV5FileEntry()
409 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
415 MCStreamer *MCOS, std::optional<MCDwarfLineStr> &LineStr) const { in emitV5FileDirTables() argument
419 MCOS->emitInt8(1); in emitV5FileDirTables()
420 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
421 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
423 MCOS->emitULEB128IntValue(MCDwarfDirs.size() + 1); in emitV5FileDirTables()
426 StringRef CompDir = MCOS->getContext().getCompilationDir(); in emitV5FileDirTables()
429 MCOS->getContext().remapDebugPath(Dir); in emitV5FileDirTables()
436 LineStr->emitRef(MCOS, CompDir); in emitV5FileDirTables()
438 LineStr->emitRef(MCOS, Dir); in emitV5FileDirTables()
441 MCOS->emitBytes(CompDir); in emitV5FileDirTables()
442 MCOS->emitBytes(StringRef("\0", 1)); in emitV5FileDirTables()
444 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV5FileDirTables()
445 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV5FileDirTables()
457 MCOS->emitInt8(Entries); in emitV5FileDirTables()
458 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
459 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
461 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_directory_index); in emitV5FileDirTables()
462 MCOS->emitULEB128IntValue(dwarf::DW_FORM_udata); in emitV5FileDirTables()
464 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_MD5); in emitV5FileDirTables()
465 MCOS->emitULEB128IntValue(dwarf::DW_FORM_data16); in emitV5FileDirTables()
468 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_LLVM_source); in emitV5FileDirTables()
469 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
476 MCOS->emitULEB128IntValue(MCDwarfFiles.empty() ? 1 : MCDwarfFiles.size()); in emitV5FileDirTables()
481 emitOneV5FileEntry(MCOS, RootFile.Name.empty() ? MCDwarfFiles[1] : RootFile, in emitV5FileDirTables()
484 emitOneV5FileEntry(MCOS, MCDwarfFiles[i], HasAllMD5, HasAnySource, LineStr); in emitV5FileDirTables()
488 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
491 MCContext &context = MCOS->getContext(); in Emit()
499 MCOS->emitDwarfLineStartLabel(LineStartSym); in Emit()
503 MCSymbol *LineEndSym = MCOS->emitDwarfUnitLength("debug_line", "unit length"); in Emit()
507 MCOS->emitInt16(LineTableVersion); in Emit()
511 MCOS->emitInt8(context.getAsmInfo()->getCodePointerSize()); in Emit()
512 MCOS->emitInt8(0); // Segment selector; same as EmitGenDwarfAranges. in Emit()
521 MCOS->emitAbsoluteSymbolDiff(ProEndSym, ProStartSym, OffsetSize); in Emit()
523 MCOS->emitLabel(ProStartSym); in Emit()
526 MCOS->emitInt8(context.getAsmInfo()->getMinInstAlignment()); in Emit()
531 MCOS->emitInt8(1); in Emit()
532 MCOS->emitInt8(DWARF2_LINE_DEFAULT_IS_STMT); in Emit()
533 MCOS->emitInt8(Params.DWARF2LineBase); in Emit()
534 MCOS->emitInt8(Params.DWARF2LineRange); in Emit()
535 MCOS->emitInt8(StandardOpcodeLengths.size() + 1); in Emit()
539 MCOS->emitInt8(Length); in Emit()
544 emitV5FileDirTables(MCOS, LineStr); in Emit()
546 emitV2FileDirTables(MCOS); in Emit()
550 MCOS->emitLabel(ProEndSym); in Emit()
555 void MCDwarfLineTable::emitCU(MCStreamer *MCOS, MCDwarfLineTableParams Params, in emitCU() argument
557 MCSymbol *LineEndSym = Header.Emit(MCOS, Params, LineStr).second; in emitCU()
561 emitOne(MCOS, LineSec.first, LineSec.second); in emitCU()
565 MCOS->emitLabel(LineEndSym); in emitCU()
668 void MCDwarfLineAddr::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
670 MCContext &Context = MCOS->getContext(); in Emit()
673 MCOS->emitBytes(Tmp); in Emit()
767 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
768 MCOS->emitULEB128IntValue(Name); in EmitAbbrev()
769 MCOS->emitULEB128IntValue(Form); in EmitAbbrev()
774 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
775 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
776 MCOS->switchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
779 MCOS->emitULEB128IntValue(1); in EmitGenDwarfAbbrev()
780 MCOS->emitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
781 MCOS->emitInt8(dwarf::DW_CHILDREN_yes); in EmitGenDwarfAbbrev()
787 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, SecOffsetForm); in EmitGenDwarfAbbrev()
790 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, SecOffsetForm); in EmitGenDwarfAbbrev()
792 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
793 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
795 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
797 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
800 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
801 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
802 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
803 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
806 MCOS->emitULEB128IntValue(2); in EmitGenDwarfAbbrev()
807 MCOS->emitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
808 MCOS->emitInt8(dwarf::DW_CHILDREN_no); in EmitGenDwarfAbbrev()
809 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
810 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
811 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
812 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
813 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
816 MCOS->emitInt8(0); in EmitGenDwarfAbbrev()
823 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
825 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
829 MCOS->switchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
857 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfAranges()
860 MCOS->emitIntValue(Length - UnitLengthBytes, OffsetSize); in EmitGenDwarfAranges()
862 MCOS->emitInt16(2); in EmitGenDwarfAranges()
866 MCOS->emitSymbolValue(InfoSectionSymbol, OffsetSize, in EmitGenDwarfAranges()
869 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfAranges()
871 MCOS->emitInt8(AddrSize); in EmitGenDwarfAranges()
873 MCOS->emitInt8(0); in EmitGenDwarfAranges()
876 MCOS->emitInt8(0); in EmitGenDwarfAranges()
890 MCOS->emitValue(Addr, AddrSize); in EmitGenDwarfAranges()
891 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
895 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
896 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
902 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
906 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
908 MCOS->switchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
913 MCOS->emitLabel(InfoStart); in EmitGenDwarfInfo()
924 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfInfo()
930 emitAbsValue(*MCOS, Length, OffsetSize); in EmitGenDwarfInfo()
933 MCOS->emitInt16(context.getDwarfVersion()); in EmitGenDwarfInfo()
940 MCOS->emitInt8(dwarf::DW_UT_compile); in EmitGenDwarfInfo()
941 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
946 MCOS->emitSymbolValue(AbbrevSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
950 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
952 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
957 MCOS->emitULEB128IntValue(1); in EmitGenDwarfInfo()
962 MCOS->emitSymbolValue(LineSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
966 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
972 MCOS->emitSymbolValue(RangesSymbol, OffsetSize); in EmitGenDwarfInfo()
990 MCOS->emitValue(Start, AddrSize); in EmitGenDwarfInfo()
995 MCOS->emitValue(End, AddrSize); in EmitGenDwarfInfo()
1002 MCOS->emitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
1003 MCOS->emitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
1013 MCOS->emitBytes(RootFile.Name); in EmitGenDwarfInfo()
1014 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1018 MCOS->emitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
1019 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1025 MCOS->emitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
1026 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1032 MCOS->emitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
1034 MCOS->emitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
1035 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1039 MCOS->emitInt16(dwarf::DW_LANG_Mips_Assembler); in EmitGenDwarfInfo()
1045 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
1048 MCOS->emitULEB128IntValue(2); in EmitGenDwarfInfo()
1051 MCOS->emitBytes(Entry.getName()); in EmitGenDwarfInfo()
1052 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1055 MCOS->emitInt32(Entry.getFileNumber()); in EmitGenDwarfInfo()
1058 MCOS->emitInt32(Entry.getLineNumber()); in EmitGenDwarfInfo()
1063 MCOS->emitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
1067 MCOS->emitInt8(0); in EmitGenDwarfInfo()
1070 MCOS->emitLabel(InfoEnd); in EmitGenDwarfInfo()
1076 static MCSymbol *emitGenDwarfRanges(MCStreamer *MCOS) { in emitGenDwarfRanges() argument
1077 MCContext &context = MCOS->getContext(); in emitGenDwarfRanges()
1084 if (MCOS->getContext().getDwarfVersion() >= 5) { in emitGenDwarfRanges()
1085 MCOS->switchSection(context.getObjectFileInfo()->getDwarfRnglistsSection()); in emitGenDwarfRanges()
1086 MCSymbol *EndSymbol = mcdwarf::emitListsTableHeaderStart(*MCOS); in emitGenDwarfRanges()
1087 MCOS->AddComment("Offset entry count"); in emitGenDwarfRanges()
1088 MCOS->emitInt32(0); in emitGenDwarfRanges()
1090 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1098 MCOS->emitInt8(dwarf::DW_RLE_start_length); in emitGenDwarfRanges()
1099 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1100 MCOS->emitULEB128Value(SectionSize); in emitGenDwarfRanges()
1102 MCOS->emitInt8(dwarf::DW_RLE_end_of_list); in emitGenDwarfRanges()
1103 MCOS->emitLabel(EndSymbol); in emitGenDwarfRanges()
1105 MCOS->switchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in emitGenDwarfRanges()
1107 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1115 MCOS->emitFill(AddrSize, 0xFF); in emitGenDwarfRanges()
1116 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1121 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1122 emitAbsValue(*MCOS, SectionSize, AddrSize); in emitGenDwarfRanges()
1126 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1127 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1137 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
1138 MCContext &context = MCOS->getContext(); in Emit()
1146 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
1152 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
1156 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
1162 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
1163 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
1166 MCOS->switchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
1169 MCOS->emitLabel(InfoSectionSymbol); in Emit()
1171 MCOS->switchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
1174 MCOS->emitLabel(AbbrevSectionSymbol); in Emit()
1177 MCOS->switchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
1180 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
1183 RangesSymbol = emitGenDwarfRanges(MCOS); in Emit()
1188 EmitGenDwarfAbbrev(MCOS); in Emit()
1191 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, RangesSymbol); in Emit()
1200 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
1205 MCContext &context = MCOS->getContext(); in Make()
1208 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSectionOnly())) in Make()
1230 MCOS->emitLabel(Label); in Make()
1233 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()