Lines Matching refs:MCOS
50 void MCDwarfLineEntry::Make(MCObjectStreamer *MCOS, MCSection *Section) { in Make() argument
51 if (!MCOS->getContext().getDwarfLocSeen()) in Make()
55 MCSymbol *LineSym = MCOS->getContext().createTempSymbol(); in Make()
57 MCOS->EmitLabel(LineSym); in Make()
60 const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc(); in Make()
66 MCOS->getContext().clearDwarfLocSeen(); in Make()
69 MCOS->getContext() in Make()
70 .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID()) in Make()
78 static inline const MCExpr *MakeStartMinusEndExpr(const MCStreamer &MCOS, in MakeStartMinusEndExpr() argument
84 MCSymbolRefExpr::create(&End, Variant, MCOS.getContext()); in MakeStartMinusEndExpr()
86 MCSymbolRefExpr::create(&Start, Variant, MCOS.getContext()); in MakeStartMinusEndExpr()
88 MCBinaryExpr::create(MCBinaryExpr::Sub, Res, RHS, MCOS.getContext()); in MakeStartMinusEndExpr()
90 MCConstantExpr::create(IntVal, MCOS.getContext()); in MakeStartMinusEndExpr()
92 MCBinaryExpr::create(MCBinaryExpr::Sub, Res1, Res2, MCOS.getContext()); in MakeStartMinusEndExpr()
101 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()
154 const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo(); in EmitDwarfLineTable()
155 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()
505 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
506 MCOS->EmitULEB128IntValue(Name); in EmitAbbrev()
507 MCOS->EmitULEB128IntValue(Form); in EmitAbbrev()
512 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
513 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
514 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
517 MCOS->EmitULEB128IntValue(1); in EmitGenDwarfAbbrev()
518 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
519 MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1); in EmitGenDwarfAbbrev()
520 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, context.getDwarfVersion() >= 4 in EmitGenDwarfAbbrev()
525 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, context.getDwarfVersion() >= 4 in EmitGenDwarfAbbrev()
529 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
530 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
532 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
534 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
537 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
538 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
539 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
540 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
543 MCOS->EmitULEB128IntValue(2); in EmitGenDwarfAbbrev()
544 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
545 MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1); in EmitGenDwarfAbbrev()
546 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
547 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
548 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
549 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
550 EmitAbbrev(MCOS, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag); in EmitGenDwarfAbbrev()
551 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
554 MCOS->EmitULEB128IntValue(3); in EmitGenDwarfAbbrev()
555 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_unspecified_parameters); in EmitGenDwarfAbbrev()
556 MCOS->EmitIntValue(dwarf::DW_CHILDREN_no, 1); in EmitGenDwarfAbbrev()
557 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
560 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAbbrev()
567 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
569 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
573 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
597 MCOS->EmitIntValue(Length - 4, 4); in EmitGenDwarfAranges()
599 MCOS->EmitIntValue(2, 2); in EmitGenDwarfAranges()
603 MCOS->EmitSymbolValue(InfoSectionSymbol, 4, in EmitGenDwarfAranges()
606 MCOS->EmitIntValue(0, 4); in EmitGenDwarfAranges()
608 MCOS->EmitIntValue(AddrSize, 1); in EmitGenDwarfAranges()
610 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAranges()
613 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAranges()
625 const MCExpr *Size = MakeStartMinusEndExpr(*MCOS, in EmitGenDwarfAranges()
627 MCOS->EmitValue(Addr, AddrSize); in EmitGenDwarfAranges()
628 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
632 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfAranges()
633 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfAranges()
639 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
643 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
645 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
650 MCOS->EmitLabel(InfoStart); in EmitGenDwarfInfo()
657 const MCExpr *Length = MakeStartMinusEndExpr(*MCOS, *InfoStart, *InfoEnd, 4); in EmitGenDwarfInfo()
658 emitAbsValue(*MCOS, Length, 4); in EmitGenDwarfInfo()
661 MCOS->EmitIntValue(context.getDwarfVersion(), 2); in EmitGenDwarfInfo()
667 MCOS->EmitIntValue(0, 4); in EmitGenDwarfInfo()
669 MCOS->EmitSymbolValue(AbbrevSectionSymbol, 4, in EmitGenDwarfInfo()
675 MCOS->EmitIntValue(AddrSize, 1); in EmitGenDwarfInfo()
680 MCOS->EmitULEB128IntValue(1); in EmitGenDwarfInfo()
685 MCOS->EmitSymbolValue(LineSectionSymbol, 4, in EmitGenDwarfInfo()
688 MCOS->EmitIntValue(0, 4); in EmitGenDwarfInfo()
696 MCOS->EmitSymbolValue(RangesSectionSymbol, 4); in EmitGenDwarfInfo()
714 MCOS->EmitValue(Start, AddrSize); in EmitGenDwarfInfo()
719 MCOS->EmitValue(End, AddrSize); in EmitGenDwarfInfo()
726 MCOS->EmitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
727 MCOS->EmitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
730 MCOS->getContext().getMCDwarfFiles(); in EmitGenDwarfInfo()
731 MCOS->EmitBytes(MCDwarfFiles[1].Name); in EmitGenDwarfInfo()
732 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
736 MCOS->EmitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
737 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
743 MCOS->EmitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
744 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
750 MCOS->EmitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
752 MCOS->EmitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
753 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
757 MCOS->EmitIntValue(dwarf::DW_LANG_Mips_Assembler, 2); in EmitGenDwarfInfo()
763 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
766 MCOS->EmitULEB128IntValue(2); in EmitGenDwarfInfo()
769 MCOS->EmitBytes(Entry.getName()); in EmitGenDwarfInfo()
770 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
773 MCOS->EmitIntValue(Entry.getFileNumber(), 4); in EmitGenDwarfInfo()
776 MCOS->EmitIntValue(Entry.getLineNumber(), 4); in EmitGenDwarfInfo()
781 MCOS->EmitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
784 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
787 MCOS->EmitULEB128IntValue(3); in EmitGenDwarfInfo()
790 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
794 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
797 MCOS->EmitLabel(InfoEnd); in EmitGenDwarfInfo()
803 static void EmitGenDwarfRanges(MCStreamer *MCOS) { in EmitGenDwarfRanges() argument
804 MCContext &context = MCOS->getContext(); in EmitGenDwarfRanges()
810 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in EmitGenDwarfRanges()
821 MCOS->emitFill(AddrSize, 0xFF); in EmitGenDwarfRanges()
822 MCOS->EmitValue(SectionStartAddr, AddrSize); in EmitGenDwarfRanges()
825 const MCExpr *SectionSize = MakeStartMinusEndExpr(*MCOS, in EmitGenDwarfRanges()
827 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
828 emitAbsValue(*MCOS, SectionSize, AddrSize); in EmitGenDwarfRanges()
832 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
833 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
840 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
841 MCContext &context = MCOS->getContext(); in Emit()
849 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
855 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
859 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
865 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
866 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
869 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
872 MCOS->EmitLabel(InfoSectionSymbol); in Emit()
874 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
877 MCOS->EmitLabel(AbbrevSectionSymbol); in Emit()
880 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in Emit()
883 MCOS->EmitLabel(RangesSectionSymbol); in Emit()
889 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
892 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
895 EmitGenDwarfRanges(MCOS); in Emit()
898 EmitGenDwarfAbbrev(MCOS); in Emit()
901 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, in Emit()
911 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
916 MCContext &context = MCOS->getContext(); in Make()
919 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSection().first)) in Make()
941 MCOS->EmitLabel(Label); in Make()
944 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()