Lines Matching refs:MCOS
49 void MCLineEntry::Make(MCObjectStreamer *MCOS, MCSection *Section) { in Make() argument
50 if (!MCOS->getContext().getDwarfLocSeen()) in Make()
54 MCSymbol *LineSym = MCOS->getContext().createTempSymbol(); in Make()
56 MCOS->EmitLabel(LineSym); in Make()
59 const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc(); in Make()
65 MCOS->getContext().clearDwarfLocSeen(); in Make()
68 MCOS->getContext() in Make()
69 .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID()) in Make()
77 static inline const MCExpr *MakeStartMinusEndExpr(const MCStreamer &MCOS, in MakeStartMinusEndExpr() argument
83 MCSymbolRefExpr::create(&End, Variant, MCOS.getContext()); in MakeStartMinusEndExpr()
85 MCSymbolRefExpr::create(&Start, Variant, MCOS.getContext()); in MakeStartMinusEndExpr()
87 MCBinaryExpr::create(MCBinaryExpr::Sub, Res, RHS, MCOS.getContext()); in MakeStartMinusEndExpr()
89 MCConstantExpr::create(IntVal, MCOS.getContext()); in MakeStartMinusEndExpr()
91 MCBinaryExpr::create(MCBinaryExpr::Sub, Res1, Res2, MCOS.getContext()); in MakeStartMinusEndExpr()
100 EmitDwarfLineTable(MCObjectStreamer *MCOS, MCSection *Section, in EmitDwarfLineTable() argument
117 MCOS->EmitIntValue(dwarf::DW_LNS_set_file, 1); in EmitDwarfLineTable()
118 MCOS->EmitULEB128IntValue(FileNum); in EmitDwarfLineTable()
122 MCOS->EmitIntValue(dwarf::DW_LNS_set_column, 1); in EmitDwarfLineTable()
123 MCOS->EmitULEB128IntValue(Column); in EmitDwarfLineTable()
128 MCOS->EmitIntValue(dwarf::DW_LNS_extended_op, 1); in EmitDwarfLineTable()
129 MCOS->EmitULEB128IntValue(Size + 1); in EmitDwarfLineTable()
130 MCOS->EmitIntValue(dwarf::DW_LNE_set_discriminator, 1); in EmitDwarfLineTable()
131 MCOS->EmitULEB128IntValue(Discriminator); in EmitDwarfLineTable()
135 MCOS->EmitIntValue(dwarf::DW_LNS_set_isa, 1); in EmitDwarfLineTable()
136 MCOS->EmitULEB128IntValue(Isa); in EmitDwarfLineTable()
140 MCOS->EmitIntValue(dwarf::DW_LNS_negate_stmt, 1); in EmitDwarfLineTable()
143 MCOS->EmitIntValue(dwarf::DW_LNS_set_basic_block, 1); in EmitDwarfLineTable()
145 MCOS->EmitIntValue(dwarf::DW_LNS_set_prologue_end, 1); in EmitDwarfLineTable()
147 MCOS->EmitIntValue(dwarf::DW_LNS_set_epilogue_begin, 1); in EmitDwarfLineTable()
155 const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo(); in EmitDwarfLineTable()
156 MCOS->EmitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label, in EmitDwarfLineTable()
167 MCSymbol *SectionEnd = MCOS->endSection(Section); in EmitDwarfLineTable()
171 MCContext &Ctx = MCOS->getContext(); in EmitDwarfLineTable()
172 MCOS->SwitchSection(Ctx.getObjectFileInfo()->getDwarfLineSection()); in EmitDwarfLineTable()
175 MCOS->EmitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, SectionEnd, in EmitDwarfLineTable()
182 void MCDwarfLineTable::Emit(MCObjectStreamer *MCOS, in Emit() argument
184 MCContext &context = MCOS->getContext(); in Emit()
194 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfLineSection()); in Emit()
198 CUIDTablePair.second.EmitCU(MCOS, Params); in Emit()
201 void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, in Emit() argument
203 MCOS.EmitLabel(Header.Emit(&MCOS, Params, None).second); in Emit()
207 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, in Emit() argument
225 return Emit(MCOS, Params, makeArrayRef(StandardOpcodeLengths, in Emit()
246 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
248 MCContext &context = MCOS->getContext(); in Emit()
255 MCOS->EmitLabel(LineStartSym); in Emit()
262 emitAbsValue(*MCOS, in Emit()
263 MakeStartMinusEndExpr(*MCOS, *LineStartSym, *LineEndSym, 4), 4); in Emit()
266 MCOS->EmitIntValue(2, 2); in Emit()
276 *MCOS, in Emit()
277 MakeStartMinusEndExpr(*MCOS, *LineStartSym, *ProEndSym, (4 + 2 + 4)), 4); in Emit()
280 MCOS->EmitIntValue(context.getAsmInfo()->getMinInstAlignment(), 1); in Emit()
281 MCOS->EmitIntValue(DWARF2_LINE_DEFAULT_IS_STMT, 1); in Emit()
282 MCOS->EmitIntValue(Params.DWARF2LineBase, 1); in Emit()
283 MCOS->EmitIntValue(Params.DWARF2LineRange, 1); in Emit()
284 MCOS->EmitIntValue(StandardOpcodeLengths.size() + 1, 1); in Emit()
288 MCOS->EmitIntValue(Length, 1); in Emit()
294 MCOS->EmitBytes(MCDwarfDirs[i]); // the DirectoryName in Emit()
295 MCOS->EmitBytes(StringRef("\0", 1)); // the null term. of the string in Emit()
297 MCOS->EmitIntValue(0, 1); // Terminate the directory list in Emit()
302 MCOS->EmitBytes(MCDwarfFiles[i].Name); // FileName in Emit()
303 MCOS->EmitBytes(StringRef("\0", 1)); // the null term. of the string in Emit()
305 MCOS->EmitULEB128IntValue(MCDwarfFiles[i].DirIndex); in Emit()
306 MCOS->EmitIntValue(0, 1); // last modification timestamp (always 0) in Emit()
307 MCOS->EmitIntValue(0, 1); // filesize (always 0) in Emit()
309 MCOS->EmitIntValue(0, 1); // Terminate the file list in Emit()
313 MCOS->EmitLabel(ProEndSym); in Emit()
318 void MCDwarfLineTable::EmitCU(MCObjectStreamer *MCOS, in EmitCU() argument
320 MCSymbol *LineEndSym = Header.Emit(MCOS, Params).second; in EmitCU()
324 EmitDwarfLineTable(MCOS, LineSec.first, LineSec.second); in EmitCU()
328 MCOS->EmitLabel(LineEndSym); in EmitCU()
406 void MCDwarfLineAddr::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, in Emit() argument
408 MCContext &Context = MCOS->getContext(); in Emit()
412 MCOS->EmitBytes(OS.str()); in Emit()
502 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
503 MCOS->EmitULEB128IntValue(Name); in EmitAbbrev()
504 MCOS->EmitULEB128IntValue(Form); in EmitAbbrev()
509 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
510 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
511 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
514 MCOS->EmitULEB128IntValue(1); in EmitGenDwarfAbbrev()
515 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
516 MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1); in EmitGenDwarfAbbrev()
517 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
518 if (MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in EmitGenDwarfAbbrev()
519 MCOS->getContext().getDwarfVersion() >= 3) { in EmitGenDwarfAbbrev()
520 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
522 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
523 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
525 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
527 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
530 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
531 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
532 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
533 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
536 MCOS->EmitULEB128IntValue(2); in EmitGenDwarfAbbrev()
537 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
538 MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1); in EmitGenDwarfAbbrev()
539 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
540 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
541 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
542 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
543 EmitAbbrev(MCOS, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag); in EmitGenDwarfAbbrev()
544 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
547 MCOS->EmitULEB128IntValue(3); in EmitGenDwarfAbbrev()
548 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_unspecified_parameters); in EmitGenDwarfAbbrev()
549 MCOS->EmitIntValue(dwarf::DW_CHILDREN_no, 1); in EmitGenDwarfAbbrev()
550 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
553 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAbbrev()
560 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
562 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
566 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
590 MCOS->EmitIntValue(Length - 4, 4); in EmitGenDwarfAranges()
592 MCOS->EmitIntValue(2, 2); in EmitGenDwarfAranges()
596 MCOS->EmitSymbolValue(InfoSectionSymbol, 4, in EmitGenDwarfAranges()
599 MCOS->EmitIntValue(0, 4); in EmitGenDwarfAranges()
601 MCOS->EmitIntValue(AddrSize, 1); in EmitGenDwarfAranges()
603 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAranges()
606 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAranges()
618 const MCExpr *Size = MakeStartMinusEndExpr(*MCOS, in EmitGenDwarfAranges()
620 MCOS->EmitValue(Addr, AddrSize); in EmitGenDwarfAranges()
621 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
625 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfAranges()
626 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfAranges()
632 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
636 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
638 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
643 MCOS->EmitLabel(InfoStart); in EmitGenDwarfInfo()
650 const MCExpr *Length = MakeStartMinusEndExpr(*MCOS, *InfoStart, *InfoEnd, 4); in EmitGenDwarfInfo()
651 emitAbsValue(*MCOS, Length, 4); in EmitGenDwarfInfo()
654 MCOS->EmitIntValue(context.getDwarfVersion(), 2); in EmitGenDwarfInfo()
660 MCOS->EmitIntValue(0, 4); in EmitGenDwarfInfo()
662 MCOS->EmitSymbolValue(AbbrevSectionSymbol, 4, in EmitGenDwarfInfo()
668 MCOS->EmitIntValue(AddrSize, 1); in EmitGenDwarfInfo()
673 MCOS->EmitULEB128IntValue(1); in EmitGenDwarfInfo()
678 MCOS->EmitSymbolValue(LineSectionSymbol, 4, in EmitGenDwarfInfo()
681 MCOS->EmitIntValue(0, 4); in EmitGenDwarfInfo()
689 MCOS->EmitSymbolValue(RangesSectionSymbol, 4); in EmitGenDwarfInfo()
707 MCOS->EmitValue(Start, AddrSize); in EmitGenDwarfInfo()
712 MCOS->EmitValue(End, AddrSize); in EmitGenDwarfInfo()
719 MCOS->EmitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
720 MCOS->EmitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
723 MCOS->getContext().getMCDwarfFiles(); in EmitGenDwarfInfo()
724 MCOS->EmitBytes(MCDwarfFiles[1].Name); in EmitGenDwarfInfo()
725 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
729 MCOS->EmitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
730 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
736 MCOS->EmitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
737 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
743 MCOS->EmitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
745 MCOS->EmitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
746 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
750 MCOS->EmitIntValue(dwarf::DW_LANG_Mips_Assembler, 2); in EmitGenDwarfInfo()
756 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
759 MCOS->EmitULEB128IntValue(2); in EmitGenDwarfInfo()
762 MCOS->EmitBytes(Entry.getName()); in EmitGenDwarfInfo()
763 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
766 MCOS->EmitIntValue(Entry.getFileNumber(), 4); in EmitGenDwarfInfo()
769 MCOS->EmitIntValue(Entry.getLineNumber(), 4); in EmitGenDwarfInfo()
774 MCOS->EmitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
777 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
780 MCOS->EmitULEB128IntValue(3); in EmitGenDwarfInfo()
783 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
787 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
790 MCOS->EmitLabel(InfoEnd); in EmitGenDwarfInfo()
796 static void EmitGenDwarfRanges(MCStreamer *MCOS) { in EmitGenDwarfRanges() argument
797 MCContext &context = MCOS->getContext(); in EmitGenDwarfRanges()
803 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in EmitGenDwarfRanges()
814 MCOS->EmitFill(AddrSize, 0xFF); in EmitGenDwarfRanges()
815 MCOS->EmitValue(SectionStartAddr, AddrSize); in EmitGenDwarfRanges()
818 const MCExpr *SectionSize = MakeStartMinusEndExpr(*MCOS, in EmitGenDwarfRanges()
820 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
821 emitAbsValue(*MCOS, SectionSize, AddrSize); in EmitGenDwarfRanges()
825 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
826 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
833 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
834 MCContext &context = MCOS->getContext(); in Emit()
842 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
848 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
852 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
858 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
859 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
862 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
865 MCOS->EmitLabel(InfoSectionSymbol); in Emit()
867 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
870 MCOS->EmitLabel(AbbrevSectionSymbol); in Emit()
873 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in Emit()
876 MCOS->EmitLabel(RangesSectionSymbol); in Emit()
882 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
885 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
888 EmitGenDwarfRanges(MCOS); in Emit()
891 EmitGenDwarfAbbrev(MCOS); in Emit()
894 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, in Emit()
904 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
909 MCContext &context = MCOS->getContext(); in Make()
912 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSection().first)) in Make()
934 MCOS->EmitLabel(Label); in Make()
937 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()