Lines Matching refs:MCOS

86   void emitRef(MCStreamer *MCOS, StringRef Path);
89 void emitSection(MCStreamer *MCOS);
108 void MCDwarfLineEntry::make(MCStreamer *MCOS, MCSection *Section) { in make() argument
109 if (!MCOS->getContext().getDwarfLocSeen()) in make()
113 MCSymbol *LineSym = MCOS->getContext().createTempSymbol(); in make()
115 MCOS->emitLabel(LineSym); in make()
118 const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc(); in make()
124 MCOS->getContext().clearDwarfLocSeen(); in make()
127 MCOS->getContext() in make()
128 .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID()) in make()
166 MCStreamer *MCOS, MCSection *Section, in emitDwarfLineTable() argument
182 MCOS->emitInt8(dwarf::DW_LNS_set_file); in emitDwarfLineTable()
183 MCOS->emitULEB128IntValue(FileNum); in emitDwarfLineTable()
187 MCOS->emitInt8(dwarf::DW_LNS_set_column); in emitDwarfLineTable()
188 MCOS->emitULEB128IntValue(Column); in emitDwarfLineTable()
191 MCOS->getContext().getDwarfVersion() >= 4) { in emitDwarfLineTable()
194 MCOS->emitInt8(dwarf::DW_LNS_extended_op); in emitDwarfLineTable()
195 MCOS->emitULEB128IntValue(Size + 1); in emitDwarfLineTable()
196 MCOS->emitInt8(dwarf::DW_LNE_set_discriminator); in emitDwarfLineTable()
197 MCOS->emitULEB128IntValue(Discriminator); in emitDwarfLineTable()
201 MCOS->emitInt8(dwarf::DW_LNS_set_isa); in emitDwarfLineTable()
202 MCOS->emitULEB128IntValue(Isa); in emitDwarfLineTable()
206 MCOS->emitInt8(dwarf::DW_LNS_negate_stmt); in emitDwarfLineTable()
209 MCOS->emitInt8(dwarf::DW_LNS_set_basic_block); in emitDwarfLineTable()
211 MCOS->emitInt8(dwarf::DW_LNS_set_prologue_end); in emitDwarfLineTable()
213 MCOS->emitInt8(dwarf::DW_LNS_set_epilogue_begin); in emitDwarfLineTable()
220 const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo(); in emitDwarfLineTable()
221 MCOS->emitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label, in emitDwarfLineTable()
230 MCOS->emitDwarfLineEndEntry(Section, LastLabel); in emitDwarfLineTable()
236 void MCDwarfLineTable::emit(MCStreamer *MCOS, MCDwarfLineTableParams Params) { in emit() argument
237 MCContext &context = MCOS->getContext(); in emit()
252 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfLineSection()); in emit()
256 CUIDTablePair.second.emitCU(MCOS, Params, LineStr); in emit()
260 LineStr->emitSection(MCOS); in emit()
263 void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params, in Emit() argument
268 MCOS.SwitchSection(Section); in Emit()
269 MCOS.emitLabel(Header.Emit(&MCOS, Params, None, NoLineStr).second); in Emit()
273 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
292 MCOS, Params, in Emit()
313 void MCDwarfLineStr::emitSection(MCStreamer *MCOS) { in emitSection() argument
315 MCOS->SwitchSection( in emitSection()
316 MCOS->getContext().getObjectFileInfo()->getDwarfLineStrSection()); in emitSection()
322 MCOS->emitBinaryData(Data.str()); in emitSection()
325 void MCDwarfLineStr::emitRef(MCStreamer *MCOS, StringRef Path) { in emitRef() argument
327 dwarf::getDwarfOffsetByteSize(MCOS->getContext().getDwarfFormat()); in emitRef()
330 MCContext &Ctx = MCOS->getContext(); in emitRef()
331 MCOS->emitValue(makeStartPlusIntExpr(Ctx, *LineStrLabel, Offset), RefSize); in emitRef()
333 MCOS->emitIntValue(Offset, RefSize); in emitRef()
336 void MCDwarfLineTableHeader::emitV2FileDirTables(MCStreamer *MCOS) const { in emitV2FileDirTables()
339 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV2FileDirTables()
340 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
342 MCOS->emitInt8(0); // Terminate the directory list. in emitV2FileDirTables()
347 MCOS->emitBytes(MCDwarfFiles[i].Name); // FileName and... in emitV2FileDirTables()
348 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
349 MCOS->emitULEB128IntValue(MCDwarfFiles[i].DirIndex); // Directory number. in emitV2FileDirTables()
350 MCOS->emitInt8(0); // Last modification timestamp (always 0). in emitV2FileDirTables()
351 MCOS->emitInt8(0); // File size (always 0). in emitV2FileDirTables()
353 MCOS->emitInt8(0); // Terminate the file list. in emitV2FileDirTables()
356 static void emitOneV5FileEntry(MCStreamer *MCOS, const MCDwarfFile &DwarfFile, in emitOneV5FileEntry() argument
361 LineStr->emitRef(MCOS, DwarfFile.Name); in emitOneV5FileEntry()
363 MCOS->emitBytes(DwarfFile.Name); // FileName and... in emitOneV5FileEntry()
364 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
366 MCOS->emitULEB128IntValue(DwarfFile.DirIndex); // Directory number. in emitOneV5FileEntry()
369 MCOS->emitBinaryData( in emitOneV5FileEntry()
375 LineStr->emitRef(MCOS, DwarfFile.Source.getValueOr(StringRef())); in emitOneV5FileEntry()
377 MCOS->emitBytes( in emitOneV5FileEntry()
379 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
385 MCStreamer *MCOS, Optional<MCDwarfLineStr> &LineStr) const { in emitV5FileDirTables() argument
389 MCOS->emitInt8(1); in emitV5FileDirTables()
390 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
391 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
393 MCOS->emitULEB128IntValue(MCDwarfDirs.size() + 1); in emitV5FileDirTables()
396 ? MCOS->getContext().getCompilationDir() in emitV5FileDirTables()
400 LineStr->emitRef(MCOS, CompDir); in emitV5FileDirTables()
402 LineStr->emitRef(MCOS, Dir); in emitV5FileDirTables()
405 MCOS->emitBytes(CompDir); in emitV5FileDirTables()
406 MCOS->emitBytes(StringRef("\0", 1)); in emitV5FileDirTables()
408 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV5FileDirTables()
409 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV5FileDirTables()
421 MCOS->emitInt8(Entries); in emitV5FileDirTables()
422 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
423 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
425 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_directory_index); in emitV5FileDirTables()
426 MCOS->emitULEB128IntValue(dwarf::DW_FORM_udata); in emitV5FileDirTables()
428 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_MD5); in emitV5FileDirTables()
429 MCOS->emitULEB128IntValue(dwarf::DW_FORM_data16); in emitV5FileDirTables()
432 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_LLVM_source); in emitV5FileDirTables()
433 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
440 MCOS->emitULEB128IntValue(MCDwarfFiles.empty() ? 1 : MCDwarfFiles.size()); in emitV5FileDirTables()
445 emitOneV5FileEntry(MCOS, RootFile.Name.empty() ? MCDwarfFiles[1] : RootFile, in emitV5FileDirTables()
448 emitOneV5FileEntry(MCOS, MCDwarfFiles[i], HasAllMD5, HasSource, LineStr); in emitV5FileDirTables()
452 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
455 MCContext &context = MCOS->getContext(); in Emit()
463 MCOS->emitDwarfLineStartLabel(LineStartSym); in Emit()
467 MCSymbol *LineEndSym = MCOS->emitDwarfUnitLength("debug_line", "unit length"); in Emit()
471 MCOS->emitInt16(LineTableVersion); in Emit()
475 MCOS->emitInt8(context.getAsmInfo()->getCodePointerSize()); in Emit()
476 MCOS->emitInt8(0); // Segment selector; same as EmitGenDwarfAranges. in Emit()
485 MCOS->emitAbsoluteSymbolDiff(ProEndSym, ProStartSym, OffsetSize); in Emit()
487 MCOS->emitLabel(ProStartSym); in Emit()
490 MCOS->emitInt8(context.getAsmInfo()->getMinInstAlignment()); in Emit()
495 MCOS->emitInt8(1); in Emit()
496 MCOS->emitInt8(DWARF2_LINE_DEFAULT_IS_STMT); in Emit()
497 MCOS->emitInt8(Params.DWARF2LineBase); in Emit()
498 MCOS->emitInt8(Params.DWARF2LineRange); in Emit()
499 MCOS->emitInt8(StandardOpcodeLengths.size() + 1); in Emit()
503 MCOS->emitInt8(Length); in Emit()
508 emitV5FileDirTables(MCOS, LineStr); in Emit()
510 emitV2FileDirTables(MCOS); in Emit()
514 MCOS->emitLabel(ProEndSym); in Emit()
519 void MCDwarfLineTable::emitCU(MCStreamer *MCOS, MCDwarfLineTableParams Params, in emitCU() argument
521 MCSymbol *LineEndSym = Header.Emit(MCOS, Params, LineStr).second; in emitCU()
525 emitDwarfLineTable(MCOS, LineSec.first, LineSec.second); in emitCU()
529 MCOS->emitLabel(LineEndSym); in emitCU()
639 void MCDwarfLineAddr::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
641 MCContext &Context = MCOS->getContext(); in Emit()
645 MCOS->emitBytes(OS.str()); in Emit()
786 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
787 MCOS->emitULEB128IntValue(Name); in EmitAbbrev()
788 MCOS->emitULEB128IntValue(Form); in EmitAbbrev()
793 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
794 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
795 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
798 MCOS->emitULEB128IntValue(1); in EmitGenDwarfAbbrev()
799 MCOS->emitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
800 MCOS->emitInt8(dwarf::DW_CHILDREN_yes); in EmitGenDwarfAbbrev()
806 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, SecOffsetForm); in EmitGenDwarfAbbrev()
809 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, SecOffsetForm); in EmitGenDwarfAbbrev()
811 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
812 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
814 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
816 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
819 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
820 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
821 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
822 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
825 MCOS->emitULEB128IntValue(2); in EmitGenDwarfAbbrev()
826 MCOS->emitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
827 MCOS->emitInt8(dwarf::DW_CHILDREN_no); in EmitGenDwarfAbbrev()
828 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
829 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
830 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
831 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
832 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
835 MCOS->emitInt8(0); in EmitGenDwarfAbbrev()
842 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
844 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
848 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
876 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfAranges()
879 MCOS->emitIntValue(Length - UnitLengthBytes, OffsetSize); in EmitGenDwarfAranges()
881 MCOS->emitInt16(2); in EmitGenDwarfAranges()
885 MCOS->emitSymbolValue(InfoSectionSymbol, OffsetSize, in EmitGenDwarfAranges()
888 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfAranges()
890 MCOS->emitInt8(AddrSize); in EmitGenDwarfAranges()
892 MCOS->emitInt8(0); in EmitGenDwarfAranges()
895 MCOS->emitInt8(0); in EmitGenDwarfAranges()
909 MCOS->emitValue(Addr, AddrSize); in EmitGenDwarfAranges()
910 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
914 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
915 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
921 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
925 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
927 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
932 MCOS->emitLabel(InfoStart); in EmitGenDwarfInfo()
943 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfInfo()
949 emitAbsValue(*MCOS, Length, OffsetSize); in EmitGenDwarfInfo()
952 MCOS->emitInt16(context.getDwarfVersion()); in EmitGenDwarfInfo()
959 MCOS->emitInt8(dwarf::DW_UT_compile); in EmitGenDwarfInfo()
960 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
965 MCOS->emitSymbolValue(AbbrevSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
969 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
971 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
976 MCOS->emitULEB128IntValue(1); in EmitGenDwarfInfo()
981 MCOS->emitSymbolValue(LineSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
985 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
991 MCOS->emitSymbolValue(RangesSymbol, OffsetSize); in EmitGenDwarfInfo()
1009 MCOS->emitValue(Start, AddrSize); in EmitGenDwarfInfo()
1014 MCOS->emitValue(End, AddrSize); in EmitGenDwarfInfo()
1021 MCOS->emitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
1022 MCOS->emitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
1032 MCOS->emitBytes(RootFile.Name); in EmitGenDwarfInfo()
1033 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1037 MCOS->emitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
1038 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1044 MCOS->emitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
1045 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1051 MCOS->emitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
1053 MCOS->emitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
1054 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1058 MCOS->emitInt16(dwarf::DW_LANG_Mips_Assembler); in EmitGenDwarfInfo()
1064 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
1067 MCOS->emitULEB128IntValue(2); in EmitGenDwarfInfo()
1070 MCOS->emitBytes(Entry.getName()); in EmitGenDwarfInfo()
1071 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1074 MCOS->emitInt32(Entry.getFileNumber()); in EmitGenDwarfInfo()
1077 MCOS->emitInt32(Entry.getLineNumber()); in EmitGenDwarfInfo()
1082 MCOS->emitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
1086 MCOS->emitInt8(0); in EmitGenDwarfInfo()
1089 MCOS->emitLabel(InfoEnd); in EmitGenDwarfInfo()
1095 static MCSymbol *emitGenDwarfRanges(MCStreamer *MCOS) { in emitGenDwarfRanges() argument
1096 MCContext &context = MCOS->getContext(); in emitGenDwarfRanges()
1103 if (MCOS->getContext().getDwarfVersion() >= 5) { in emitGenDwarfRanges()
1104 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRnglistsSection()); in emitGenDwarfRanges()
1105 MCSymbol *EndSymbol = mcdwarf::emitListsTableHeaderStart(*MCOS); in emitGenDwarfRanges()
1106 MCOS->AddComment("Offset entry count"); in emitGenDwarfRanges()
1107 MCOS->emitInt32(0); in emitGenDwarfRanges()
1109 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1117 MCOS->emitInt8(dwarf::DW_RLE_start_length); in emitGenDwarfRanges()
1118 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1119 MCOS->emitULEB128Value(SectionSize); in emitGenDwarfRanges()
1121 MCOS->emitInt8(dwarf::DW_RLE_end_of_list); in emitGenDwarfRanges()
1122 MCOS->emitLabel(EndSymbol); in emitGenDwarfRanges()
1124 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in emitGenDwarfRanges()
1126 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1134 MCOS->emitFill(AddrSize, 0xFF); in emitGenDwarfRanges()
1135 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1140 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1141 emitAbsValue(*MCOS, SectionSize, AddrSize); in emitGenDwarfRanges()
1145 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1146 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1156 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
1157 MCContext &context = MCOS->getContext(); in Emit()
1165 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
1171 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
1175 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
1181 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
1182 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
1185 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
1188 MCOS->emitLabel(InfoSectionSymbol); in Emit()
1190 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
1193 MCOS->emitLabel(AbbrevSectionSymbol); in Emit()
1196 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
1199 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
1202 RangesSymbol = emitGenDwarfRanges(MCOS); in Emit()
1207 EmitGenDwarfAbbrev(MCOS); in Emit()
1210 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, RangesSymbol); in Emit()
1219 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
1224 MCContext &context = MCOS->getContext(); in Make()
1227 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSectionOnly())) in Make()
1249 MCOS->emitLabel(Label); in Make()
1252 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()