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()
738 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
739 MCOS->emitULEB128IntValue(Name); in EmitAbbrev()
740 MCOS->emitULEB128IntValue(Form); in EmitAbbrev()
745 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
746 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
747 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
750 MCOS->emitULEB128IntValue(1); in EmitGenDwarfAbbrev()
751 MCOS->emitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
752 MCOS->emitInt8(dwarf::DW_CHILDREN_yes); in EmitGenDwarfAbbrev()
758 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, SecOffsetForm); in EmitGenDwarfAbbrev()
761 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, SecOffsetForm); in EmitGenDwarfAbbrev()
763 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
764 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
766 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
768 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
771 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
772 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
773 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
774 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
777 MCOS->emitULEB128IntValue(2); in EmitGenDwarfAbbrev()
778 MCOS->emitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
779 MCOS->emitInt8(dwarf::DW_CHILDREN_no); in EmitGenDwarfAbbrev()
780 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
781 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
782 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
783 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
784 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
787 MCOS->emitInt8(0); in EmitGenDwarfAbbrev()
794 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
796 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
800 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
828 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfAranges()
831 MCOS->emitIntValue(Length - UnitLengthBytes, OffsetSize); in EmitGenDwarfAranges()
833 MCOS->emitInt16(2); in EmitGenDwarfAranges()
837 MCOS->emitSymbolValue(InfoSectionSymbol, OffsetSize, in EmitGenDwarfAranges()
840 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfAranges()
842 MCOS->emitInt8(AddrSize); in EmitGenDwarfAranges()
844 MCOS->emitInt8(0); in EmitGenDwarfAranges()
847 MCOS->emitInt8(0); in EmitGenDwarfAranges()
861 MCOS->emitValue(Addr, AddrSize); in EmitGenDwarfAranges()
862 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
866 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
867 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
873 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
877 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
879 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
884 MCOS->emitLabel(InfoStart); in EmitGenDwarfInfo()
895 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfInfo()
901 emitAbsValue(*MCOS, Length, OffsetSize); in EmitGenDwarfInfo()
904 MCOS->emitInt16(context.getDwarfVersion()); in EmitGenDwarfInfo()
911 MCOS->emitInt8(dwarf::DW_UT_compile); in EmitGenDwarfInfo()
912 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
917 MCOS->emitSymbolValue(AbbrevSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
921 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
923 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
928 MCOS->emitULEB128IntValue(1); in EmitGenDwarfInfo()
933 MCOS->emitSymbolValue(LineSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
937 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
943 MCOS->emitSymbolValue(RangesSymbol, OffsetSize); in EmitGenDwarfInfo()
961 MCOS->emitValue(Start, AddrSize); in EmitGenDwarfInfo()
966 MCOS->emitValue(End, AddrSize); in EmitGenDwarfInfo()
973 MCOS->emitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
974 MCOS->emitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
984 MCOS->emitBytes(RootFile.Name); in EmitGenDwarfInfo()
985 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
989 MCOS->emitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
990 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
996 MCOS->emitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
997 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1003 MCOS->emitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
1005 MCOS->emitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
1006 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1010 MCOS->emitInt16(dwarf::DW_LANG_Mips_Assembler); in EmitGenDwarfInfo()
1016 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
1019 MCOS->emitULEB128IntValue(2); in EmitGenDwarfInfo()
1022 MCOS->emitBytes(Entry.getName()); in EmitGenDwarfInfo()
1023 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1026 MCOS->emitInt32(Entry.getFileNumber()); in EmitGenDwarfInfo()
1029 MCOS->emitInt32(Entry.getLineNumber()); in EmitGenDwarfInfo()
1034 MCOS->emitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
1038 MCOS->emitInt8(0); in EmitGenDwarfInfo()
1041 MCOS->emitLabel(InfoEnd); in EmitGenDwarfInfo()
1047 static MCSymbol *emitGenDwarfRanges(MCStreamer *MCOS) { in emitGenDwarfRanges() argument
1048 MCContext &context = MCOS->getContext(); in emitGenDwarfRanges()
1055 if (MCOS->getContext().getDwarfVersion() >= 5) { in emitGenDwarfRanges()
1056 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRnglistsSection()); in emitGenDwarfRanges()
1057 MCSymbol *EndSymbol = mcdwarf::emitListsTableHeaderStart(*MCOS); in emitGenDwarfRanges()
1058 MCOS->AddComment("Offset entry count"); in emitGenDwarfRanges()
1059 MCOS->emitInt32(0); in emitGenDwarfRanges()
1061 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1069 MCOS->emitInt8(dwarf::DW_RLE_start_length); in emitGenDwarfRanges()
1070 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1071 MCOS->emitULEB128Value(SectionSize); in emitGenDwarfRanges()
1073 MCOS->emitInt8(dwarf::DW_RLE_end_of_list); in emitGenDwarfRanges()
1074 MCOS->emitLabel(EndSymbol); in emitGenDwarfRanges()
1076 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in emitGenDwarfRanges()
1078 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1086 MCOS->emitFill(AddrSize, 0xFF); in emitGenDwarfRanges()
1087 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1092 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1093 emitAbsValue(*MCOS, SectionSize, AddrSize); in emitGenDwarfRanges()
1097 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1098 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1108 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
1109 MCContext &context = MCOS->getContext(); in Emit()
1117 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
1123 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
1127 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
1133 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
1134 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
1137 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
1140 MCOS->emitLabel(InfoSectionSymbol); in Emit()
1142 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
1145 MCOS->emitLabel(AbbrevSectionSymbol); in Emit()
1148 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
1151 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
1154 RangesSymbol = emitGenDwarfRanges(MCOS); in Emit()
1159 EmitGenDwarfAbbrev(MCOS); in Emit()
1162 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, RangesSymbol); in Emit()
1171 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
1176 MCContext &context = MCOS->getContext(); in Make()
1179 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSectionOnly())) in Make()
1201 MCOS->emitLabel(Label); in Make()
1204 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()