Lines Matching refs:MCOS

95 void MCDwarfLineEntry::make(MCStreamer *MCOS, MCSection *Section) {  in make()  argument
96 if (!MCOS->getContext().getDwarfLocSeen()) in make()
100 MCSymbol *LineSym = MCOS->getContext().createTempSymbol(); in make()
102 MCOS->emitLabel(LineSym); in make()
105 const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc(); in make()
111 MCOS->getContext().clearDwarfLocSeen(); in make()
114 MCOS->getContext() in make()
115 .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID()) in make()
171 MCStreamer *MCOS, MCSection *Section, in emitOne() argument
191 const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo(); in emitOne()
193 MCOS->emitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, Label, in emitOne()
204 MCOS->emitInt8(dwarf::DW_LNS_set_file); in emitOne()
205 MCOS->emitULEB128IntValue(FileNum); in emitOne()
209 MCOS->emitInt8(dwarf::DW_LNS_set_column); in emitOne()
210 MCOS->emitULEB128IntValue(Column); in emitOne()
213 MCOS->getContext().getDwarfVersion() >= 4) { in emitOne()
216 MCOS->emitInt8(dwarf::DW_LNS_extended_op); in emitOne()
217 MCOS->emitULEB128IntValue(Size + 1); in emitOne()
218 MCOS->emitInt8(dwarf::DW_LNE_set_discriminator); in emitOne()
219 MCOS->emitULEB128IntValue(Discriminator); in emitOne()
223 MCOS->emitInt8(dwarf::DW_LNS_set_isa); in emitOne()
224 MCOS->emitULEB128IntValue(Isa); in emitOne()
228 MCOS->emitInt8(dwarf::DW_LNS_negate_stmt); in emitOne()
231 MCOS->emitInt8(dwarf::DW_LNS_set_basic_block); in emitOne()
233 MCOS->emitInt8(dwarf::DW_LNS_set_prologue_end); in emitOne()
235 MCOS->emitInt8(dwarf::DW_LNS_set_epilogue_begin); in emitOne()
240 MCOS->emitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label, in emitOne()
254 MCOS->emitDwarfLineEndEntry(Section, LastLabel); in emitOne()
260 void MCDwarfLineTable::emit(MCStreamer *MCOS, MCDwarfLineTableParams Params) { in emit() argument
261 MCContext &context = MCOS->getContext(); in emit()
276 MCOS->switchSection(context.getObjectFileInfo()->getDwarfLineSection()); in emit()
280 CUIDTablePair.second.emitCU(MCOS, Params, LineStr); in emit()
284 LineStr->emitSection(MCOS); in emit()
287 void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params, in Emit() argument
292 MCOS.switchSection(Section); in Emit()
293 MCOS.emitLabel(Header.Emit(&MCOS, Params, std::nullopt, NoLineStr).second); in Emit()
297 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
315 return Emit(MCOS, Params, in Emit()
336 void MCDwarfLineStr::emitSection(MCStreamer *MCOS) { in emitSection() argument
338 MCOS->switchSection( in emitSection()
339 MCOS->getContext().getObjectFileInfo()->getDwarfLineStrSection()); in emitSection()
341 MCOS->emitBinaryData(Data.str()); in emitSection()
358 void MCDwarfLineStr::emitRef(MCStreamer *MCOS, StringRef Path) { in emitRef() argument
360 dwarf::getDwarfOffsetByteSize(MCOS->getContext().getDwarfFormat()); in emitRef()
363 MCContext &Ctx = MCOS->getContext(); in emitRef()
365 MCOS->emitCOFFSecRel32(LineStrLabel, Offset); in emitRef()
367 MCOS->emitValue(makeStartPlusIntExpr(Ctx, *LineStrLabel, Offset), in emitRef()
371 MCOS->emitIntValue(Offset, RefSize); in emitRef()
374 void MCDwarfLineTableHeader::emitV2FileDirTables(MCStreamer *MCOS) const { in emitV2FileDirTables()
377 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV2FileDirTables()
378 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
380 MCOS->emitInt8(0); // Terminate the directory list. in emitV2FileDirTables()
385 MCOS->emitBytes(MCDwarfFiles[i].Name); // FileName and... in emitV2FileDirTables()
386 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
387 MCOS->emitULEB128IntValue(MCDwarfFiles[i].DirIndex); // Directory number. in emitV2FileDirTables()
388 MCOS->emitInt8(0); // Last modification timestamp (always 0). in emitV2FileDirTables()
389 MCOS->emitInt8(0); // File size (always 0). in emitV2FileDirTables()
391 MCOS->emitInt8(0); // Terminate the file list. in emitV2FileDirTables()
394 static void emitOneV5FileEntry(MCStreamer *MCOS, const MCDwarfFile &DwarfFile, in emitOneV5FileEntry() argument
399 LineStr->emitRef(MCOS, DwarfFile.Name); in emitOneV5FileEntry()
401 MCOS->emitBytes(DwarfFile.Name); // FileName and... in emitOneV5FileEntry()
402 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
404 MCOS->emitULEB128IntValue(DwarfFile.DirIndex); // Directory number. in emitOneV5FileEntry()
407 MCOS->emitBinaryData( in emitOneV5FileEntry()
412 LineStr->emitRef(MCOS, DwarfFile.Source.value_or(StringRef())); in emitOneV5FileEntry()
414 MCOS->emitBytes(DwarfFile.Source.value_or(StringRef())); // Source and... in emitOneV5FileEntry()
415 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
421 MCStreamer *MCOS, std::optional<MCDwarfLineStr> &LineStr) const { in emitV5FileDirTables() argument
425 MCOS->emitInt8(1); in emitV5FileDirTables()
426 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
427 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
429 MCOS->emitULEB128IntValue(MCDwarfDirs.size() + 1); in emitV5FileDirTables()
432 StringRef CompDir = MCOS->getContext().getCompilationDir(); in emitV5FileDirTables()
435 MCOS->getContext().remapDebugPath(Dir); in emitV5FileDirTables()
442 LineStr->emitRef(MCOS, CompDir); in emitV5FileDirTables()
444 LineStr->emitRef(MCOS, Dir); in emitV5FileDirTables()
447 MCOS->emitBytes(CompDir); in emitV5FileDirTables()
448 MCOS->emitBytes(StringRef("\0", 1)); in emitV5FileDirTables()
450 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV5FileDirTables()
451 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV5FileDirTables()
463 MCOS->emitInt8(Entries); in emitV5FileDirTables()
464 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
465 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
467 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_directory_index); in emitV5FileDirTables()
468 MCOS->emitULEB128IntValue(dwarf::DW_FORM_udata); in emitV5FileDirTables()
470 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_MD5); in emitV5FileDirTables()
471 MCOS->emitULEB128IntValue(dwarf::DW_FORM_data16); in emitV5FileDirTables()
474 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_LLVM_source); in emitV5FileDirTables()
475 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
482 MCOS->emitULEB128IntValue(MCDwarfFiles.empty() ? 1 : MCDwarfFiles.size()); in emitV5FileDirTables()
487 emitOneV5FileEntry(MCOS, RootFile.Name.empty() ? MCDwarfFiles[1] : RootFile, in emitV5FileDirTables()
490 emitOneV5FileEntry(MCOS, MCDwarfFiles[i], HasAllMD5, HasAnySource, LineStr); in emitV5FileDirTables()
494 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
497 MCContext &context = MCOS->getContext(); in Emit()
505 MCOS->emitDwarfLineStartLabel(LineStartSym); in Emit()
509 MCSymbol *LineEndSym = MCOS->emitDwarfUnitLength("debug_line", "unit length"); in Emit()
513 MCOS->emitInt16(LineTableVersion); in Emit()
517 MCOS->emitInt8(context.getAsmInfo()->getCodePointerSize()); in Emit()
518 MCOS->emitInt8(0); // Segment selector; same as EmitGenDwarfAranges. in Emit()
527 MCOS->emitAbsoluteSymbolDiff(ProEndSym, ProStartSym, OffsetSize); in Emit()
529 MCOS->emitLabel(ProStartSym); in Emit()
532 MCOS->emitInt8(context.getAsmInfo()->getMinInstAlignment()); in Emit()
537 MCOS->emitInt8(1); in Emit()
538 MCOS->emitInt8(DWARF2_LINE_DEFAULT_IS_STMT); in Emit()
539 MCOS->emitInt8(Params.DWARF2LineBase); in Emit()
540 MCOS->emitInt8(Params.DWARF2LineRange); in Emit()
541 MCOS->emitInt8(StandardOpcodeLengths.size() + 1); in Emit()
545 MCOS->emitInt8(Length); in Emit()
550 emitV5FileDirTables(MCOS, LineStr); in Emit()
552 emitV2FileDirTables(MCOS); in Emit()
556 MCOS->emitLabel(ProEndSym); in Emit()
561 void MCDwarfLineTable::emitCU(MCStreamer *MCOS, MCDwarfLineTableParams Params, in emitCU() argument
563 MCSymbol *LineEndSym = Header.Emit(MCOS, Params, LineStr).second; in emitCU()
567 emitOne(MCOS, LineSec.first, LineSec.second); in emitCU()
571 MCOS->emitLabel(LineEndSym); in emitCU()
674 void MCDwarfLineAddr::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
676 MCContext &Context = MCOS->getContext(); in Emit()
679 MCOS->emitBytes(Tmp); in Emit()
773 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
774 MCOS->emitULEB128IntValue(Name); in EmitAbbrev()
775 MCOS->emitULEB128IntValue(Form); in EmitAbbrev()
780 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
781 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
782 MCOS->switchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
785 MCOS->emitULEB128IntValue(1); in EmitGenDwarfAbbrev()
786 MCOS->emitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
787 MCOS->emitInt8(dwarf::DW_CHILDREN_yes); in EmitGenDwarfAbbrev()
793 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, SecOffsetForm); in EmitGenDwarfAbbrev()
796 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, SecOffsetForm); in EmitGenDwarfAbbrev()
798 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
799 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
801 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
803 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
806 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
807 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
808 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
809 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
812 MCOS->emitULEB128IntValue(2); in EmitGenDwarfAbbrev()
813 MCOS->emitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
814 MCOS->emitInt8(dwarf::DW_CHILDREN_no); in EmitGenDwarfAbbrev()
815 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
816 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
817 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
818 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
819 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
822 MCOS->emitInt8(0); in EmitGenDwarfAbbrev()
829 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
831 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
835 MCOS->switchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
863 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfAranges()
866 MCOS->emitIntValue(Length - UnitLengthBytes, OffsetSize); in EmitGenDwarfAranges()
868 MCOS->emitInt16(2); in EmitGenDwarfAranges()
872 MCOS->emitSymbolValue(InfoSectionSymbol, OffsetSize, in EmitGenDwarfAranges()
875 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfAranges()
877 MCOS->emitInt8(AddrSize); in EmitGenDwarfAranges()
879 MCOS->emitInt8(0); in EmitGenDwarfAranges()
882 MCOS->emitInt8(0); in EmitGenDwarfAranges()
896 MCOS->emitValue(Addr, AddrSize); in EmitGenDwarfAranges()
897 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
901 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
902 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
908 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
912 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
914 MCOS->switchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
919 MCOS->emitLabel(InfoStart); in EmitGenDwarfInfo()
930 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfInfo()
936 emitAbsValue(*MCOS, Length, OffsetSize); in EmitGenDwarfInfo()
939 MCOS->emitInt16(context.getDwarfVersion()); in EmitGenDwarfInfo()
946 MCOS->emitInt8(dwarf::DW_UT_compile); in EmitGenDwarfInfo()
947 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
952 MCOS->emitSymbolValue(AbbrevSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
956 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
958 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
963 MCOS->emitULEB128IntValue(1); in EmitGenDwarfInfo()
968 MCOS->emitSymbolValue(LineSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
972 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
978 MCOS->emitSymbolValue(RangesSymbol, OffsetSize); in EmitGenDwarfInfo()
996 MCOS->emitValue(Start, AddrSize); in EmitGenDwarfInfo()
1001 MCOS->emitValue(End, AddrSize); in EmitGenDwarfInfo()
1008 MCOS->emitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
1009 MCOS->emitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
1019 MCOS->emitBytes(RootFile.Name); in EmitGenDwarfInfo()
1020 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1024 MCOS->emitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
1025 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1031 MCOS->emitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
1032 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1038 MCOS->emitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
1040 MCOS->emitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
1041 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1045 MCOS->emitInt16(dwarf::DW_LANG_Mips_Assembler); in EmitGenDwarfInfo()
1051 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
1054 MCOS->emitULEB128IntValue(2); in EmitGenDwarfInfo()
1057 MCOS->emitBytes(Entry.getName()); in EmitGenDwarfInfo()
1058 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1061 MCOS->emitInt32(Entry.getFileNumber()); in EmitGenDwarfInfo()
1064 MCOS->emitInt32(Entry.getLineNumber()); in EmitGenDwarfInfo()
1069 MCOS->emitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
1073 MCOS->emitInt8(0); in EmitGenDwarfInfo()
1076 MCOS->emitLabel(InfoEnd); in EmitGenDwarfInfo()
1082 static MCSymbol *emitGenDwarfRanges(MCStreamer *MCOS) { in emitGenDwarfRanges() argument
1083 MCContext &context = MCOS->getContext(); in emitGenDwarfRanges()
1090 if (MCOS->getContext().getDwarfVersion() >= 5) { in emitGenDwarfRanges()
1091 MCOS->switchSection(context.getObjectFileInfo()->getDwarfRnglistsSection()); in emitGenDwarfRanges()
1092 MCSymbol *EndSymbol = mcdwarf::emitListsTableHeaderStart(*MCOS); in emitGenDwarfRanges()
1093 MCOS->AddComment("Offset entry count"); in emitGenDwarfRanges()
1094 MCOS->emitInt32(0); in emitGenDwarfRanges()
1096 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1104 MCOS->emitInt8(dwarf::DW_RLE_start_length); in emitGenDwarfRanges()
1105 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1106 MCOS->emitULEB128Value(SectionSize); in emitGenDwarfRanges()
1108 MCOS->emitInt8(dwarf::DW_RLE_end_of_list); in emitGenDwarfRanges()
1109 MCOS->emitLabel(EndSymbol); in emitGenDwarfRanges()
1111 MCOS->switchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in emitGenDwarfRanges()
1113 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1121 MCOS->emitFill(AddrSize, 0xFF); in emitGenDwarfRanges()
1122 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1127 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1128 emitAbsValue(*MCOS, SectionSize, AddrSize); in emitGenDwarfRanges()
1132 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1133 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1143 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
1144 MCContext &context = MCOS->getContext(); in Emit()
1152 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
1158 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
1162 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
1168 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
1169 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
1172 MCOS->switchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
1175 MCOS->emitLabel(InfoSectionSymbol); in Emit()
1177 MCOS->switchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
1180 MCOS->emitLabel(AbbrevSectionSymbol); in Emit()
1183 MCOS->switchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
1186 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
1189 RangesSymbol = emitGenDwarfRanges(MCOS); in Emit()
1194 EmitGenDwarfAbbrev(MCOS); in Emit()
1197 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, RangesSymbol); in Emit()
1206 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
1211 MCContext &context = MCOS->getContext(); in Make()
1214 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSectionOnly())) in Make()
1236 MCOS->emitLabel(Label); in Make()
1239 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()