Lines Matching refs:MCOS

91 void MCDwarfLineEntry::make(MCStreamer *MCOS, MCSection *Section) {  in make()  argument
92 if (!MCOS->getContext().getDwarfLocSeen()) in make()
96 MCSymbol *LineSym = MCOS->getContext().createTempSymbol(); in make()
98 MCOS->emitLabel(LineSym); in make()
101 const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc(); in make()
107 MCOS->getContext().clearDwarfLocSeen(); in make()
110 MCOS->getContext() in make()
111 .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID()) in make()
167 MCStreamer *MCOS, MCSection *Section, in emitOne() argument
187 const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo(); in emitOne()
189 MCOS->emitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, Label, in emitOne()
200 MCOS->emitInt8(dwarf::DW_LNS_set_file); in emitOne()
201 MCOS->emitULEB128IntValue(FileNum); in emitOne()
205 MCOS->emitInt8(dwarf::DW_LNS_set_column); in emitOne()
206 MCOS->emitULEB128IntValue(Column); in emitOne()
209 MCOS->getContext().getDwarfVersion() >= 4) { in emitOne()
212 MCOS->emitInt8(dwarf::DW_LNS_extended_op); in emitOne()
213 MCOS->emitULEB128IntValue(Size + 1); in emitOne()
214 MCOS->emitInt8(dwarf::DW_LNE_set_discriminator); in emitOne()
215 MCOS->emitULEB128IntValue(Discriminator); in emitOne()
219 MCOS->emitInt8(dwarf::DW_LNS_set_isa); in emitOne()
220 MCOS->emitULEB128IntValue(Isa); in emitOne()
224 MCOS->emitInt8(dwarf::DW_LNS_negate_stmt); in emitOne()
227 MCOS->emitInt8(dwarf::DW_LNS_set_basic_block); in emitOne()
229 MCOS->emitInt8(dwarf::DW_LNS_set_prologue_end); in emitOne()
231 MCOS->emitInt8(dwarf::DW_LNS_set_epilogue_begin); in emitOne()
236 MCOS->emitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label, in emitOne()
250 MCOS->emitDwarfLineEndEntry(Section, LastLabel); in emitOne()
256 void MCDwarfLineTable::emit(MCStreamer *MCOS, MCDwarfLineTableParams Params) { in emit() argument
257 MCContext &context = MCOS->getContext(); in emit()
272 MCOS->switchSection(context.getObjectFileInfo()->getDwarfLineSection()); in emit()
276 CUIDTablePair.second.emitCU(MCOS, Params, LineStr); in emit()
280 LineStr->emitSection(MCOS); in emit()
283 void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params, in Emit() argument
288 MCOS.switchSection(Section); in Emit()
289 MCOS.emitLabel(Header.Emit(&MCOS, Params, None, NoLineStr).second); in Emit()
293 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
312 MCOS, Params, in Emit()
333 void MCDwarfLineStr::emitSection(MCStreamer *MCOS) { in emitSection() argument
335 MCOS->switchSection( in emitSection()
336 MCOS->getContext().getObjectFileInfo()->getDwarfLineStrSection()); in emitSection()
338 MCOS->emitBinaryData(Data.str()); in emitSection()
351 void MCDwarfLineStr::emitRef(MCStreamer *MCOS, StringRef Path) { in emitRef() argument
353 dwarf::getDwarfOffsetByteSize(MCOS->getContext().getDwarfFormat()); in emitRef()
356 MCContext &Ctx = MCOS->getContext(); in emitRef()
357 MCOS->emitValue(makeStartPlusIntExpr(Ctx, *LineStrLabel, Offset), RefSize); in emitRef()
359 MCOS->emitIntValue(Offset, RefSize); in emitRef()
362 void MCDwarfLineTableHeader::emitV2FileDirTables(MCStreamer *MCOS) const { in emitV2FileDirTables()
365 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV2FileDirTables()
366 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
368 MCOS->emitInt8(0); // Terminate the directory list. in emitV2FileDirTables()
373 MCOS->emitBytes(MCDwarfFiles[i].Name); // FileName and... in emitV2FileDirTables()
374 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
375 MCOS->emitULEB128IntValue(MCDwarfFiles[i].DirIndex); // Directory number. in emitV2FileDirTables()
376 MCOS->emitInt8(0); // Last modification timestamp (always 0). in emitV2FileDirTables()
377 MCOS->emitInt8(0); // File size (always 0). in emitV2FileDirTables()
379 MCOS->emitInt8(0); // Terminate the file list. in emitV2FileDirTables()
382 static void emitOneV5FileEntry(MCStreamer *MCOS, const MCDwarfFile &DwarfFile, in emitOneV5FileEntry() argument
387 LineStr->emitRef(MCOS, DwarfFile.Name); in emitOneV5FileEntry()
389 MCOS->emitBytes(DwarfFile.Name); // FileName and... in emitOneV5FileEntry()
390 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
392 MCOS->emitULEB128IntValue(DwarfFile.DirIndex); // Directory number. in emitOneV5FileEntry()
395 MCOS->emitBinaryData( in emitOneV5FileEntry()
400 LineStr->emitRef(MCOS, DwarfFile.Source.value_or(StringRef())); in emitOneV5FileEntry()
402 MCOS->emitBytes(DwarfFile.Source.value_or(StringRef())); // Source and... in emitOneV5FileEntry()
403 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
409 MCStreamer *MCOS, Optional<MCDwarfLineStr> &LineStr) const { in emitV5FileDirTables() argument
413 MCOS->emitInt8(1); in emitV5FileDirTables()
414 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
415 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
417 MCOS->emitULEB128IntValue(MCDwarfDirs.size() + 1); in emitV5FileDirTables()
420 StringRef CompDir = MCOS->getContext().getCompilationDir(); in emitV5FileDirTables()
423 MCOS->getContext().remapDebugPath(Dir); in emitV5FileDirTables()
430 LineStr->emitRef(MCOS, CompDir); in emitV5FileDirTables()
432 LineStr->emitRef(MCOS, Dir); in emitV5FileDirTables()
435 MCOS->emitBytes(CompDir); in emitV5FileDirTables()
436 MCOS->emitBytes(StringRef("\0", 1)); in emitV5FileDirTables()
438 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV5FileDirTables()
439 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV5FileDirTables()
451 MCOS->emitInt8(Entries); in emitV5FileDirTables()
452 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
453 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
455 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_directory_index); in emitV5FileDirTables()
456 MCOS->emitULEB128IntValue(dwarf::DW_FORM_udata); in emitV5FileDirTables()
458 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_MD5); in emitV5FileDirTables()
459 MCOS->emitULEB128IntValue(dwarf::DW_FORM_data16); in emitV5FileDirTables()
462 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_LLVM_source); in emitV5FileDirTables()
463 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
470 MCOS->emitULEB128IntValue(MCDwarfFiles.empty() ? 1 : MCDwarfFiles.size()); in emitV5FileDirTables()
475 emitOneV5FileEntry(MCOS, RootFile.Name.empty() ? MCDwarfFiles[1] : RootFile, in emitV5FileDirTables()
478 emitOneV5FileEntry(MCOS, MCDwarfFiles[i], HasAllMD5, HasSource, LineStr); in emitV5FileDirTables()
482 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
485 MCContext &context = MCOS->getContext(); in Emit()
493 MCOS->emitDwarfLineStartLabel(LineStartSym); in Emit()
497 MCSymbol *LineEndSym = MCOS->emitDwarfUnitLength("debug_line", "unit length"); in Emit()
501 MCOS->emitInt16(LineTableVersion); in Emit()
505 MCOS->emitInt8(context.getAsmInfo()->getCodePointerSize()); in Emit()
506 MCOS->emitInt8(0); // Segment selector; same as EmitGenDwarfAranges. in Emit()
515 MCOS->emitAbsoluteSymbolDiff(ProEndSym, ProStartSym, OffsetSize); in Emit()
517 MCOS->emitLabel(ProStartSym); in Emit()
520 MCOS->emitInt8(context.getAsmInfo()->getMinInstAlignment()); in Emit()
525 MCOS->emitInt8(1); in Emit()
526 MCOS->emitInt8(DWARF2_LINE_DEFAULT_IS_STMT); in Emit()
527 MCOS->emitInt8(Params.DWARF2LineBase); in Emit()
528 MCOS->emitInt8(Params.DWARF2LineRange); in Emit()
529 MCOS->emitInt8(StandardOpcodeLengths.size() + 1); in Emit()
533 MCOS->emitInt8(Length); in Emit()
538 emitV5FileDirTables(MCOS, LineStr); in Emit()
540 emitV2FileDirTables(MCOS); in Emit()
544 MCOS->emitLabel(ProEndSym); in Emit()
549 void MCDwarfLineTable::emitCU(MCStreamer *MCOS, MCDwarfLineTableParams Params, in emitCU() argument
551 MCSymbol *LineEndSym = Header.Emit(MCOS, Params, LineStr).second; in emitCU()
555 emitOne(MCOS, LineSec.first, LineSec.second); in emitCU()
559 MCOS->emitLabel(LineEndSym); in emitCU()
669 void MCDwarfLineAddr::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
671 MCContext &Context = MCOS->getContext(); in Emit()
675 MCOS->emitBytes(OS.str()); in Emit()
768 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
769 MCOS->emitULEB128IntValue(Name); in EmitAbbrev()
770 MCOS->emitULEB128IntValue(Form); in EmitAbbrev()
775 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
776 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
777 MCOS->switchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
780 MCOS->emitULEB128IntValue(1); in EmitGenDwarfAbbrev()
781 MCOS->emitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
782 MCOS->emitInt8(dwarf::DW_CHILDREN_yes); in EmitGenDwarfAbbrev()
788 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, SecOffsetForm); in EmitGenDwarfAbbrev()
791 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, SecOffsetForm); in EmitGenDwarfAbbrev()
793 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
794 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
796 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
798 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
801 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
802 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
803 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
804 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
807 MCOS->emitULEB128IntValue(2); in EmitGenDwarfAbbrev()
808 MCOS->emitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
809 MCOS->emitInt8(dwarf::DW_CHILDREN_no); in EmitGenDwarfAbbrev()
810 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
811 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
812 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
813 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
814 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
817 MCOS->emitInt8(0); in EmitGenDwarfAbbrev()
824 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
826 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
830 MCOS->switchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
858 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfAranges()
861 MCOS->emitIntValue(Length - UnitLengthBytes, OffsetSize); in EmitGenDwarfAranges()
863 MCOS->emitInt16(2); in EmitGenDwarfAranges()
867 MCOS->emitSymbolValue(InfoSectionSymbol, OffsetSize, in EmitGenDwarfAranges()
870 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfAranges()
872 MCOS->emitInt8(AddrSize); in EmitGenDwarfAranges()
874 MCOS->emitInt8(0); in EmitGenDwarfAranges()
877 MCOS->emitInt8(0); in EmitGenDwarfAranges()
891 MCOS->emitValue(Addr, AddrSize); in EmitGenDwarfAranges()
892 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
896 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
897 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
903 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
907 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
909 MCOS->switchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
914 MCOS->emitLabel(InfoStart); in EmitGenDwarfInfo()
925 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfInfo()
931 emitAbsValue(*MCOS, Length, OffsetSize); in EmitGenDwarfInfo()
934 MCOS->emitInt16(context.getDwarfVersion()); in EmitGenDwarfInfo()
941 MCOS->emitInt8(dwarf::DW_UT_compile); in EmitGenDwarfInfo()
942 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
947 MCOS->emitSymbolValue(AbbrevSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
951 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
953 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
958 MCOS->emitULEB128IntValue(1); in EmitGenDwarfInfo()
963 MCOS->emitSymbolValue(LineSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
967 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
973 MCOS->emitSymbolValue(RangesSymbol, OffsetSize); in EmitGenDwarfInfo()
991 MCOS->emitValue(Start, AddrSize); in EmitGenDwarfInfo()
996 MCOS->emitValue(End, AddrSize); in EmitGenDwarfInfo()
1003 MCOS->emitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
1004 MCOS->emitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
1014 MCOS->emitBytes(RootFile.Name); in EmitGenDwarfInfo()
1015 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1019 MCOS->emitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
1020 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1026 MCOS->emitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
1027 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1033 MCOS->emitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
1035 MCOS->emitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
1036 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1040 MCOS->emitInt16(dwarf::DW_LANG_Mips_Assembler); in EmitGenDwarfInfo()
1046 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
1049 MCOS->emitULEB128IntValue(2); in EmitGenDwarfInfo()
1052 MCOS->emitBytes(Entry.getName()); in EmitGenDwarfInfo()
1053 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1056 MCOS->emitInt32(Entry.getFileNumber()); in EmitGenDwarfInfo()
1059 MCOS->emitInt32(Entry.getLineNumber()); in EmitGenDwarfInfo()
1064 MCOS->emitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
1068 MCOS->emitInt8(0); in EmitGenDwarfInfo()
1071 MCOS->emitLabel(InfoEnd); in EmitGenDwarfInfo()
1077 static MCSymbol *emitGenDwarfRanges(MCStreamer *MCOS) { in emitGenDwarfRanges() argument
1078 MCContext &context = MCOS->getContext(); in emitGenDwarfRanges()
1085 if (MCOS->getContext().getDwarfVersion() >= 5) { in emitGenDwarfRanges()
1086 MCOS->switchSection(context.getObjectFileInfo()->getDwarfRnglistsSection()); in emitGenDwarfRanges()
1087 MCSymbol *EndSymbol = mcdwarf::emitListsTableHeaderStart(*MCOS); in emitGenDwarfRanges()
1088 MCOS->AddComment("Offset entry count"); in emitGenDwarfRanges()
1089 MCOS->emitInt32(0); in emitGenDwarfRanges()
1091 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1099 MCOS->emitInt8(dwarf::DW_RLE_start_length); in emitGenDwarfRanges()
1100 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1101 MCOS->emitULEB128Value(SectionSize); in emitGenDwarfRanges()
1103 MCOS->emitInt8(dwarf::DW_RLE_end_of_list); in emitGenDwarfRanges()
1104 MCOS->emitLabel(EndSymbol); in emitGenDwarfRanges()
1106 MCOS->switchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in emitGenDwarfRanges()
1108 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1116 MCOS->emitFill(AddrSize, 0xFF); in emitGenDwarfRanges()
1117 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1122 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1123 emitAbsValue(*MCOS, SectionSize, AddrSize); in emitGenDwarfRanges()
1127 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1128 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1138 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
1139 MCContext &context = MCOS->getContext(); in Emit()
1147 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
1153 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
1157 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
1163 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
1164 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
1167 MCOS->switchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
1170 MCOS->emitLabel(InfoSectionSymbol); in Emit()
1172 MCOS->switchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
1175 MCOS->emitLabel(AbbrevSectionSymbol); in Emit()
1178 MCOS->switchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
1181 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
1184 RangesSymbol = emitGenDwarfRanges(MCOS); in Emit()
1189 EmitGenDwarfAbbrev(MCOS); in Emit()
1192 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, RangesSymbol); in Emit()
1201 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
1206 MCContext &context = MCOS->getContext(); in Make()
1209 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSectionOnly())) in Make()
1231 MCOS->emitLabel(Label); in Make()
1234 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()