Lines Matching refs:MCOS
88 void emitRef(MCStreamer *MCOS, StringRef Path);
91 void emitSection(MCStreamer *MCOS);
110 void MCDwarfLineEntry::Make(MCObjectStreamer *MCOS, MCSection *Section) { in Make() argument
111 if (!MCOS->getContext().getDwarfLocSeen()) in Make()
115 MCSymbol *LineSym = MCOS->getContext().createTempSymbol(); in Make()
117 MCOS->emitLabel(LineSym); in Make()
120 const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc(); in Make()
126 MCOS->getContext().clearDwarfLocSeen(); in Make()
129 MCOS->getContext() in Make()
130 .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID()) in Make()
168 MCObjectStreamer *MCOS, MCSection *Section, in emitDwarfLineTable() argument
184 MCOS->emitInt8(dwarf::DW_LNS_set_file); in emitDwarfLineTable()
185 MCOS->emitULEB128IntValue(FileNum); in emitDwarfLineTable()
189 MCOS->emitInt8(dwarf::DW_LNS_set_column); in emitDwarfLineTable()
190 MCOS->emitULEB128IntValue(Column); in emitDwarfLineTable()
193 MCOS->getContext().getDwarfVersion() >= 4) { in emitDwarfLineTable()
196 MCOS->emitInt8(dwarf::DW_LNS_extended_op); in emitDwarfLineTable()
197 MCOS->emitULEB128IntValue(Size + 1); in emitDwarfLineTable()
198 MCOS->emitInt8(dwarf::DW_LNE_set_discriminator); in emitDwarfLineTable()
199 MCOS->emitULEB128IntValue(Discriminator); in emitDwarfLineTable()
203 MCOS->emitInt8(dwarf::DW_LNS_set_isa); in emitDwarfLineTable()
204 MCOS->emitULEB128IntValue(Isa); in emitDwarfLineTable()
208 MCOS->emitInt8(dwarf::DW_LNS_negate_stmt); in emitDwarfLineTable()
211 MCOS->emitInt8(dwarf::DW_LNS_set_basic_block); in emitDwarfLineTable()
213 MCOS->emitInt8(dwarf::DW_LNS_set_prologue_end); in emitDwarfLineTable()
215 MCOS->emitInt8(dwarf::DW_LNS_set_epilogue_begin); in emitDwarfLineTable()
222 const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo(); in emitDwarfLineTable()
223 MCOS->emitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label, in emitDwarfLineTable()
235 MCSymbol *SectionEnd = MCOS->endSection(Section); in emitDwarfLineTable()
239 MCContext &Ctx = MCOS->getContext(); in emitDwarfLineTable()
240 MCOS->SwitchSection(Ctx.getObjectFileInfo()->getDwarfLineSection()); in emitDwarfLineTable()
243 MCOS->emitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, SectionEnd, in emitDwarfLineTable()
250 void MCDwarfLineTable::Emit(MCObjectStreamer *MCOS, in Emit() argument
252 MCContext &context = MCOS->getContext(); in Emit()
267 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfLineSection()); in Emit()
271 CUIDTablePair.second.EmitCU(MCOS, Params, LineStr); in Emit()
275 LineStr->emitSection(MCOS); in Emit()
278 void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params, in Emit() argument
283 MCOS.SwitchSection(Section); in Emit()
284 MCOS.emitLabel(Header.Emit(&MCOS, Params, None, NoLineStr).second); in Emit()
288 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
307 MCOS, Params, in Emit()
328 void MCDwarfLineStr::emitSection(MCStreamer *MCOS) { in emitSection() argument
330 MCOS->SwitchSection( in emitSection()
331 MCOS->getContext().getObjectFileInfo()->getDwarfLineStrSection()); in emitSection()
337 MCOS->emitBinaryData(Data.str()); in emitSection()
340 void MCDwarfLineStr::emitRef(MCStreamer *MCOS, StringRef Path) { in emitRef() argument
342 dwarf::getDwarfOffsetByteSize(MCOS->getContext().getDwarfFormat()); in emitRef()
345 MCContext &Ctx = MCOS->getContext(); in emitRef()
346 MCOS->emitValue(makeStartPlusIntExpr(Ctx, *LineStrLabel, Offset), RefSize); in emitRef()
348 MCOS->emitIntValue(Offset, RefSize); in emitRef()
351 void MCDwarfLineTableHeader::emitV2FileDirTables(MCStreamer *MCOS) const { in emitV2FileDirTables()
354 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV2FileDirTables()
355 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
357 MCOS->emitInt8(0); // Terminate the directory list. in emitV2FileDirTables()
362 MCOS->emitBytes(MCDwarfFiles[i].Name); // FileName and... in emitV2FileDirTables()
363 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV2FileDirTables()
364 MCOS->emitULEB128IntValue(MCDwarfFiles[i].DirIndex); // Directory number. in emitV2FileDirTables()
365 MCOS->emitInt8(0); // Last modification timestamp (always 0). in emitV2FileDirTables()
366 MCOS->emitInt8(0); // File size (always 0). in emitV2FileDirTables()
368 MCOS->emitInt8(0); // Terminate the file list. in emitV2FileDirTables()
371 static void emitOneV5FileEntry(MCStreamer *MCOS, const MCDwarfFile &DwarfFile, in emitOneV5FileEntry() argument
376 LineStr->emitRef(MCOS, DwarfFile.Name); in emitOneV5FileEntry()
378 MCOS->emitBytes(DwarfFile.Name); // FileName and... in emitOneV5FileEntry()
379 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
381 MCOS->emitULEB128IntValue(DwarfFile.DirIndex); // Directory number. in emitOneV5FileEntry()
384 MCOS->emitBinaryData( in emitOneV5FileEntry()
390 LineStr->emitRef(MCOS, DwarfFile.Source.getValueOr(StringRef())); in emitOneV5FileEntry()
392 MCOS->emitBytes( in emitOneV5FileEntry()
394 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitOneV5FileEntry()
400 MCStreamer *MCOS, Optional<MCDwarfLineStr> &LineStr) const { in emitV5FileDirTables() argument
404 MCOS->emitInt8(1); in emitV5FileDirTables()
405 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
406 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
408 MCOS->emitULEB128IntValue(MCDwarfDirs.size() + 1); in emitV5FileDirTables()
411 ? MCOS->getContext().getCompilationDir() in emitV5FileDirTables()
415 LineStr->emitRef(MCOS, CompDir); in emitV5FileDirTables()
417 LineStr->emitRef(MCOS, Dir); in emitV5FileDirTables()
420 MCOS->emitBytes(CompDir); in emitV5FileDirTables()
421 MCOS->emitBytes(StringRef("\0", 1)); in emitV5FileDirTables()
423 MCOS->emitBytes(Dir); // The DirectoryName, and... in emitV5FileDirTables()
424 MCOS->emitBytes(StringRef("\0", 1)); // its null terminator. in emitV5FileDirTables()
436 MCOS->emitInt8(Entries); in emitV5FileDirTables()
437 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path); in emitV5FileDirTables()
438 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
440 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_directory_index); in emitV5FileDirTables()
441 MCOS->emitULEB128IntValue(dwarf::DW_FORM_udata); in emitV5FileDirTables()
443 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_MD5); in emitV5FileDirTables()
444 MCOS->emitULEB128IntValue(dwarf::DW_FORM_data16); in emitV5FileDirTables()
447 MCOS->emitULEB128IntValue(dwarf::DW_LNCT_LLVM_source); in emitV5FileDirTables()
448 MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp in emitV5FileDirTables()
455 MCOS->emitULEB128IntValue(MCDwarfFiles.empty() ? 1 : MCDwarfFiles.size()); in emitV5FileDirTables()
460 emitOneV5FileEntry(MCOS, RootFile.Name.empty() ? MCDwarfFiles[1] : RootFile, in emitV5FileDirTables()
463 emitOneV5FileEntry(MCOS, MCDwarfFiles[i], HasAllMD5, HasSource, LineStr); in emitV5FileDirTables()
467 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
470 MCContext &context = MCOS->getContext(); in Emit()
477 MCOS->emitLabel(LineStartSym); in Emit()
488 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in Emit()
492 emitAbsValue(*MCOS, in Emit()
499 MCOS->emitInt16(LineTableVersion); in Emit()
507 MCOS->emitInt8(context.getAsmInfo()->getCodePointerSize()); in Emit()
508 MCOS->emitInt8(0); // Segment selector; same as EmitGenDwarfAranges. in Emit()
517 emitAbsValue(*MCOS, in Emit()
523 MCOS->emitInt8(context.getAsmInfo()->getMinInstAlignment()); in Emit()
528 MCOS->emitInt8(1); in Emit()
529 MCOS->emitInt8(DWARF2_LINE_DEFAULT_IS_STMT); in Emit()
530 MCOS->emitInt8(Params.DWARF2LineBase); in Emit()
531 MCOS->emitInt8(Params.DWARF2LineRange); in Emit()
532 MCOS->emitInt8(StandardOpcodeLengths.size() + 1); in Emit()
536 MCOS->emitInt8(Length); in Emit()
541 emitV5FileDirTables(MCOS, LineStr); in Emit()
543 emitV2FileDirTables(MCOS); in Emit()
547 MCOS->emitLabel(ProEndSym); in Emit()
552 void MCDwarfLineTable::EmitCU(MCObjectStreamer *MCOS, in EmitCU() argument
555 MCSymbol *LineEndSym = Header.Emit(MCOS, Params, LineStr).second; in EmitCU()
559 emitDwarfLineTable(MCOS, LineSec.first, LineSec.second); in EmitCU()
563 MCOS->emitLabel(LineEndSym); in EmitCU()
673 void MCDwarfLineAddr::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
675 MCContext &Context = MCOS->getContext(); in Emit()
679 MCOS->emitBytes(OS.str()); in Emit()
821 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
822 MCOS->emitULEB128IntValue(Name); in EmitAbbrev()
823 MCOS->emitULEB128IntValue(Form); in EmitAbbrev()
828 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
829 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
830 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
833 MCOS->emitULEB128IntValue(1); in EmitGenDwarfAbbrev()
834 MCOS->emitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
835 MCOS->emitInt8(dwarf::DW_CHILDREN_yes); in EmitGenDwarfAbbrev()
841 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, SecOffsetForm); in EmitGenDwarfAbbrev()
844 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, SecOffsetForm); in EmitGenDwarfAbbrev()
846 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
847 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
849 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
851 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
854 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
855 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
856 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
857 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
860 MCOS->emitULEB128IntValue(2); in EmitGenDwarfAbbrev()
861 MCOS->emitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
862 MCOS->emitInt8(dwarf::DW_CHILDREN_no); in EmitGenDwarfAbbrev()
863 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
864 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
865 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
866 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
867 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
870 MCOS->emitInt8(0); in EmitGenDwarfAbbrev()
877 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
879 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
883 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
911 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfAranges()
914 MCOS->emitIntValue(Length - UnitLengthBytes, OffsetSize); in EmitGenDwarfAranges()
916 MCOS->emitInt16(2); in EmitGenDwarfAranges()
920 MCOS->emitSymbolValue(InfoSectionSymbol, OffsetSize, in EmitGenDwarfAranges()
923 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfAranges()
925 MCOS->emitInt8(AddrSize); in EmitGenDwarfAranges()
927 MCOS->emitInt8(0); in EmitGenDwarfAranges()
930 MCOS->emitInt8(0); in EmitGenDwarfAranges()
944 MCOS->emitValue(Addr, AddrSize); in EmitGenDwarfAranges()
945 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
949 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
950 MCOS->emitIntValue(0, AddrSize); in EmitGenDwarfAranges()
956 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
960 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
962 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
967 MCOS->emitLabel(InfoStart); in EmitGenDwarfInfo()
978 MCOS->emitInt32(dwarf::DW_LENGTH_DWARF64); in EmitGenDwarfInfo()
984 emitAbsValue(*MCOS, Length, OffsetSize); in EmitGenDwarfInfo()
987 MCOS->emitInt16(context.getDwarfVersion()); in EmitGenDwarfInfo()
994 MCOS->emitInt8(dwarf::DW_UT_compile); in EmitGenDwarfInfo()
995 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
1000 MCOS->emitSymbolValue(AbbrevSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
1004 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
1006 MCOS->emitInt8(AddrSize); in EmitGenDwarfInfo()
1011 MCOS->emitULEB128IntValue(1); in EmitGenDwarfInfo()
1016 MCOS->emitSymbolValue(LineSectionSymbol, OffsetSize, in EmitGenDwarfInfo()
1020 MCOS->emitIntValue(0, OffsetSize); in EmitGenDwarfInfo()
1026 MCOS->emitSymbolValue(RangesSymbol, OffsetSize); in EmitGenDwarfInfo()
1044 MCOS->emitValue(Start, AddrSize); in EmitGenDwarfInfo()
1049 MCOS->emitValue(End, AddrSize); in EmitGenDwarfInfo()
1056 MCOS->emitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
1057 MCOS->emitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
1067 MCOS->emitBytes(RootFile.Name); in EmitGenDwarfInfo()
1068 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1072 MCOS->emitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
1073 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1079 MCOS->emitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
1080 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1086 MCOS->emitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
1088 MCOS->emitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
1089 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1093 MCOS->emitInt16(dwarf::DW_LANG_Mips_Assembler); in EmitGenDwarfInfo()
1099 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
1102 MCOS->emitULEB128IntValue(2); in EmitGenDwarfInfo()
1105 MCOS->emitBytes(Entry.getName()); in EmitGenDwarfInfo()
1106 MCOS->emitInt8(0); // NULL byte to terminate the string. in EmitGenDwarfInfo()
1109 MCOS->emitInt32(Entry.getFileNumber()); in EmitGenDwarfInfo()
1112 MCOS->emitInt32(Entry.getLineNumber()); in EmitGenDwarfInfo()
1117 MCOS->emitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
1121 MCOS->emitInt8(0); in EmitGenDwarfInfo()
1124 MCOS->emitLabel(InfoEnd); in EmitGenDwarfInfo()
1130 static MCSymbol *emitGenDwarfRanges(MCStreamer *MCOS) { in emitGenDwarfRanges() argument
1131 MCContext &context = MCOS->getContext(); in emitGenDwarfRanges()
1138 if (MCOS->getContext().getDwarfVersion() >= 5) { in emitGenDwarfRanges()
1139 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRnglistsSection()); in emitGenDwarfRanges()
1140 MCSymbol *EndSymbol = mcdwarf::emitListsTableHeaderStart(*MCOS); in emitGenDwarfRanges()
1141 MCOS->AddComment("Offset entry count"); in emitGenDwarfRanges()
1142 MCOS->emitInt32(0); in emitGenDwarfRanges()
1144 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1152 MCOS->emitInt8(dwarf::DW_RLE_start_length); in emitGenDwarfRanges()
1153 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1154 MCOS->emitULEB128Value(SectionSize); in emitGenDwarfRanges()
1156 MCOS->emitInt8(dwarf::DW_RLE_end_of_list); in emitGenDwarfRanges()
1157 MCOS->emitLabel(EndSymbol); in emitGenDwarfRanges()
1159 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in emitGenDwarfRanges()
1161 MCOS->emitLabel(RangesSymbol); in emitGenDwarfRanges()
1169 MCOS->emitFill(AddrSize, 0xFF); in emitGenDwarfRanges()
1170 MCOS->emitValue(SectionStartAddr, AddrSize); in emitGenDwarfRanges()
1175 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1176 emitAbsValue(*MCOS, SectionSize, AddrSize); in emitGenDwarfRanges()
1180 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1181 MCOS->emitIntValue(0, AddrSize); in emitGenDwarfRanges()
1191 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
1192 MCContext &context = MCOS->getContext(); in Emit()
1200 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
1206 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
1210 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
1216 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
1217 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
1220 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
1223 MCOS->emitLabel(InfoSectionSymbol); in Emit()
1225 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
1228 MCOS->emitLabel(AbbrevSectionSymbol); in Emit()
1231 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
1234 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
1237 RangesSymbol = emitGenDwarfRanges(MCOS); in Emit()
1242 EmitGenDwarfAbbrev(MCOS); in Emit()
1245 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, RangesSymbol); in Emit()
1254 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
1259 MCContext &context = MCOS->getContext(); in Make()
1262 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSectionOnly())) in Make()
1284 MCOS->emitLabel(Label); in Make()
1287 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()