Lines Matching refs:MCOS
67 void MCLineEntry::Make(MCObjectStreamer *MCOS, const MCSection *Section) { in Make() argument
68 if (!MCOS->getContext().getDwarfLocSeen()) in Make()
72 MCSymbol *LineSym = MCOS->getContext().CreateTempSymbol(); in Make()
74 MCOS->EmitLabel(LineSym); in Make()
77 const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc(); in Make()
83 MCOS->getContext().ClearDwarfLocSeen(); in Make()
86 MCOS->getContext() in Make()
87 .getMCDwarfLineTable(MCOS->getContext().getDwarfCompileUnitID()) in Make()
95 static inline const MCExpr *MakeStartMinusEndExpr(const MCStreamer &MCOS, in MakeStartMinusEndExpr() argument
101 MCSymbolRefExpr::Create(&End, Variant, MCOS.getContext()); in MakeStartMinusEndExpr()
103 MCSymbolRefExpr::Create(&Start, Variant, MCOS.getContext()); in MakeStartMinusEndExpr()
105 MCBinaryExpr::Create(MCBinaryExpr::Sub, Res, RHS, MCOS.getContext()); in MakeStartMinusEndExpr()
107 MCConstantExpr::Create(IntVal, MCOS.getContext()); in MakeStartMinusEndExpr()
109 MCBinaryExpr::Create(MCBinaryExpr::Sub, Res1, Res2, MCOS.getContext()); in MakeStartMinusEndExpr()
118 EmitDwarfLineTable(MCObjectStreamer *MCOS, const MCSection *Section, in EmitDwarfLineTable() argument
135 MCOS->EmitIntValue(dwarf::DW_LNS_set_file, 1); in EmitDwarfLineTable()
136 MCOS->EmitULEB128IntValue(FileNum); in EmitDwarfLineTable()
140 MCOS->EmitIntValue(dwarf::DW_LNS_set_column, 1); in EmitDwarfLineTable()
141 MCOS->EmitULEB128IntValue(Column); in EmitDwarfLineTable()
146 MCOS->EmitIntValue(dwarf::DW_LNS_extended_op, 1); in EmitDwarfLineTable()
147 MCOS->EmitULEB128IntValue(Size + 1); in EmitDwarfLineTable()
148 MCOS->EmitIntValue(dwarf::DW_LNE_set_discriminator, 1); in EmitDwarfLineTable()
149 MCOS->EmitULEB128IntValue(Discriminator); in EmitDwarfLineTable()
153 MCOS->EmitIntValue(dwarf::DW_LNS_set_isa, 1); in EmitDwarfLineTable()
154 MCOS->EmitULEB128IntValue(Isa); in EmitDwarfLineTable()
158 MCOS->EmitIntValue(dwarf::DW_LNS_negate_stmt, 1); in EmitDwarfLineTable()
161 MCOS->EmitIntValue(dwarf::DW_LNS_set_basic_block, 1); in EmitDwarfLineTable()
163 MCOS->EmitIntValue(dwarf::DW_LNS_set_prologue_end, 1); in EmitDwarfLineTable()
165 MCOS->EmitIntValue(dwarf::DW_LNS_set_epilogue_begin, 1); in EmitDwarfLineTable()
173 const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo(); in EmitDwarfLineTable()
174 MCOS->EmitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label, in EmitDwarfLineTable()
185 MCSymbol *SectionEnd = MCOS->endSection(Section); in EmitDwarfLineTable()
189 MCContext &Ctx = MCOS->getContext(); in EmitDwarfLineTable()
190 MCOS->SwitchSection(Ctx.getObjectFileInfo()->getDwarfLineSection()); in EmitDwarfLineTable()
193 MCOS->EmitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, SectionEnd, in EmitDwarfLineTable()
200 void MCDwarfLineTable::Emit(MCObjectStreamer *MCOS) { in Emit() argument
201 MCContext &context = MCOS->getContext(); in Emit()
211 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfLineSection()); in Emit()
215 CUIDTablePair.second.EmitCU(MCOS); in Emit()
218 void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS) const { in Emit()
219 MCOS.EmitLabel(Header.Emit(&MCOS, None).second); in Emit()
222 std::pair<MCSymbol *, MCSymbol *> MCDwarfLineTableHeader::Emit(MCStreamer *MCOS) const { in Emit()
239 return Emit(MCOS, StandardOpcodeLengths); in Emit()
259 MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, in Emit() argument
262 MCContext &context = MCOS->getContext(); in Emit()
269 MCOS->EmitLabel(LineStartSym); in Emit()
276 emitAbsValue(*MCOS, in Emit()
277 MakeStartMinusEndExpr(*MCOS, *LineStartSym, *LineEndSym, 4), 4); in Emit()
280 MCOS->EmitIntValue(2, 2); in Emit()
290 *MCOS, in Emit()
291 MakeStartMinusEndExpr(*MCOS, *LineStartSym, *ProEndSym, (4 + 2 + 4)), 4); in Emit()
294 MCOS->EmitIntValue(context.getAsmInfo()->getMinInstAlignment(), 1); in Emit()
295 MCOS->EmitIntValue(DWARF2_LINE_DEFAULT_IS_STMT, 1); in Emit()
296 MCOS->EmitIntValue(DWARF2_LINE_BASE, 1); in Emit()
297 MCOS->EmitIntValue(DWARF2_LINE_RANGE, 1); in Emit()
298 MCOS->EmitIntValue(StandardOpcodeLengths.size() + 1, 1); in Emit()
302 MCOS->EmitIntValue(Length, 1); in Emit()
308 MCOS->EmitBytes(MCDwarfDirs[i]); // the DirectoryName in Emit()
309 MCOS->EmitBytes(StringRef("\0", 1)); // the null term. of the string in Emit()
311 MCOS->EmitIntValue(0, 1); // Terminate the directory list in Emit()
316 MCOS->EmitBytes(MCDwarfFiles[i].Name); // FileName in Emit()
317 MCOS->EmitBytes(StringRef("\0", 1)); // the null term. of the string in Emit()
319 MCOS->EmitULEB128IntValue(MCDwarfFiles[i].DirIndex); in Emit()
320 MCOS->EmitIntValue(0, 1); // last modification timestamp (always 0) in Emit()
321 MCOS->EmitIntValue(0, 1); // filesize (always 0) in Emit()
323 MCOS->EmitIntValue(0, 1); // Terminate the file list in Emit()
327 MCOS->EmitLabel(ProEndSym); in Emit()
332 void MCDwarfLineTable::EmitCU(MCObjectStreamer *MCOS) const { in EmitCU()
333 MCSymbol *LineEndSym = Header.Emit(MCOS).second; in EmitCU()
337 EmitDwarfLineTable(MCOS, LineSec.first, LineSec.second); in EmitCU()
341 MCOS->EmitLabel(LineEndSym); in EmitCU()
417 void MCDwarfLineAddr::Emit(MCStreamer *MCOS, int64_t LineDelta, in Emit() argument
419 MCContext &Context = MCOS->getContext(); in Emit()
423 MCOS->EmitBytes(OS.str()); in Emit()
503 static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) { in EmitAbbrev() argument
504 MCOS->EmitULEB128IntValue(Name); in EmitAbbrev()
505 MCOS->EmitULEB128IntValue(Form); in EmitAbbrev()
510 static void EmitGenDwarfAbbrev(MCStreamer *MCOS) { in EmitGenDwarfAbbrev() argument
511 MCContext &context = MCOS->getContext(); in EmitGenDwarfAbbrev()
512 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in EmitGenDwarfAbbrev()
515 MCOS->EmitULEB128IntValue(1); in EmitGenDwarfAbbrev()
516 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_compile_unit); in EmitGenDwarfAbbrev()
517 MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1); in EmitGenDwarfAbbrev()
518 EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
519 if (MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in EmitGenDwarfAbbrev()
520 MCOS->getContext().getDwarfVersion() >= 3) { in EmitGenDwarfAbbrev()
521 EmitAbbrev(MCOS, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
523 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
524 EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
526 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
528 EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
531 EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
532 EmitAbbrev(MCOS, dwarf::DW_AT_producer, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
533 EmitAbbrev(MCOS, dwarf::DW_AT_language, dwarf::DW_FORM_data2); in EmitGenDwarfAbbrev()
534 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
537 MCOS->EmitULEB128IntValue(2); in EmitGenDwarfAbbrev()
538 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_label); in EmitGenDwarfAbbrev()
539 MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1); in EmitGenDwarfAbbrev()
540 EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); in EmitGenDwarfAbbrev()
541 EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
542 EmitAbbrev(MCOS, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data4); in EmitGenDwarfAbbrev()
543 EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); in EmitGenDwarfAbbrev()
544 EmitAbbrev(MCOS, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag); in EmitGenDwarfAbbrev()
545 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
548 MCOS->EmitULEB128IntValue(3); in EmitGenDwarfAbbrev()
549 MCOS->EmitULEB128IntValue(dwarf::DW_TAG_unspecified_parameters); in EmitGenDwarfAbbrev()
550 MCOS->EmitIntValue(dwarf::DW_CHILDREN_no, 1); in EmitGenDwarfAbbrev()
551 EmitAbbrev(MCOS, 0, 0); in EmitGenDwarfAbbrev()
554 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAbbrev()
561 static void EmitGenDwarfAranges(MCStreamer *MCOS, in EmitGenDwarfAranges() argument
563 MCContext &context = MCOS->getContext(); in EmitGenDwarfAranges()
567 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in EmitGenDwarfAranges()
591 MCOS->EmitIntValue(Length - 4, 4); in EmitGenDwarfAranges()
593 MCOS->EmitIntValue(2, 2); in EmitGenDwarfAranges()
597 MCOS->EmitSymbolValue(InfoSectionSymbol, 4, in EmitGenDwarfAranges()
600 MCOS->EmitIntValue(0, 4); in EmitGenDwarfAranges()
602 MCOS->EmitIntValue(AddrSize, 1); in EmitGenDwarfAranges()
604 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAranges()
607 MCOS->EmitIntValue(0, 1); in EmitGenDwarfAranges()
619 const MCExpr *Size = MakeStartMinusEndExpr(*MCOS, in EmitGenDwarfAranges()
621 MCOS->EmitValue(Addr, AddrSize); in EmitGenDwarfAranges()
622 emitAbsValue(*MCOS, Size, AddrSize); in EmitGenDwarfAranges()
626 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfAranges()
627 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfAranges()
633 static void EmitGenDwarfInfo(MCStreamer *MCOS, in EmitGenDwarfInfo() argument
637 MCContext &context = MCOS->getContext(); in EmitGenDwarfInfo()
639 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in EmitGenDwarfInfo()
644 MCOS->EmitLabel(InfoStart); in EmitGenDwarfInfo()
651 const MCExpr *Length = MakeStartMinusEndExpr(*MCOS, *InfoStart, *InfoEnd, 4); in EmitGenDwarfInfo()
652 emitAbsValue(*MCOS, Length, 4); in EmitGenDwarfInfo()
655 MCOS->EmitIntValue(context.getDwarfVersion(), 2); in EmitGenDwarfInfo()
661 MCOS->EmitIntValue(0, 4); in EmitGenDwarfInfo()
663 MCOS->EmitSymbolValue(AbbrevSectionSymbol, 4, in EmitGenDwarfInfo()
669 MCOS->EmitIntValue(AddrSize, 1); in EmitGenDwarfInfo()
674 MCOS->EmitULEB128IntValue(1); in EmitGenDwarfInfo()
679 MCOS->EmitSymbolValue(LineSectionSymbol, 4, in EmitGenDwarfInfo()
682 MCOS->EmitIntValue(0, 4); in EmitGenDwarfInfo()
690 MCOS->EmitSymbolValue(RangesSectionSymbol, 4); in EmitGenDwarfInfo()
708 MCOS->EmitValue(Start, AddrSize); in EmitGenDwarfInfo()
713 MCOS->EmitValue(End, AddrSize); in EmitGenDwarfInfo()
720 MCOS->EmitBytes(MCDwarfDirs[0]); in EmitGenDwarfInfo()
721 MCOS->EmitBytes(sys::path::get_separator()); in EmitGenDwarfInfo()
724 MCOS->getContext().getMCDwarfFiles(); in EmitGenDwarfInfo()
725 MCOS->EmitBytes(MCDwarfFiles[1].Name); in EmitGenDwarfInfo()
726 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
730 MCOS->EmitBytes(context.getCompilationDir()); in EmitGenDwarfInfo()
731 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
737 MCOS->EmitBytes(DwarfDebugFlags); in EmitGenDwarfInfo()
738 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
744 MCOS->EmitBytes(DwarfDebugProducer); in EmitGenDwarfInfo()
746 MCOS->EmitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); in EmitGenDwarfInfo()
747 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
751 MCOS->EmitIntValue(dwarf::DW_LANG_Mips_Assembler, 2); in EmitGenDwarfInfo()
757 MCOS->getContext().getMCGenDwarfLabelEntries(); in EmitGenDwarfInfo()
760 MCOS->EmitULEB128IntValue(2); in EmitGenDwarfInfo()
763 MCOS->EmitBytes(Entry.getName()); in EmitGenDwarfInfo()
764 MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. in EmitGenDwarfInfo()
767 MCOS->EmitIntValue(Entry.getFileNumber(), 4); in EmitGenDwarfInfo()
770 MCOS->EmitIntValue(Entry.getLineNumber(), 4); in EmitGenDwarfInfo()
775 MCOS->EmitValue(AT_low_pc, AddrSize); in EmitGenDwarfInfo()
778 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
781 MCOS->EmitULEB128IntValue(3); in EmitGenDwarfInfo()
784 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
788 MCOS->EmitIntValue(0, 1); in EmitGenDwarfInfo()
791 MCOS->EmitLabel(InfoEnd); in EmitGenDwarfInfo()
797 static void EmitGenDwarfRanges(MCStreamer *MCOS) { in EmitGenDwarfRanges() argument
798 MCContext &context = MCOS->getContext(); in EmitGenDwarfRanges()
804 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in EmitGenDwarfRanges()
816 MCOS->EmitFill(AddrSize, 0xFF); in EmitGenDwarfRanges()
817 MCOS->EmitValue(SectionStartAddr, AddrSize); in EmitGenDwarfRanges()
820 const MCExpr *SectionSize = MakeStartMinusEndExpr(*MCOS, in EmitGenDwarfRanges()
822 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
823 emitAbsValue(*MCOS, SectionSize, AddrSize); in EmitGenDwarfRanges()
827 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
828 MCOS->EmitIntValue(0, AddrSize); in EmitGenDwarfRanges()
835 void MCGenDwarfInfo::Emit(MCStreamer *MCOS) { in Emit() argument
836 MCContext &context = MCOS->getContext(); in Emit()
844 LineSectionSymbol = MCOS->getDwarfLineTableSymbol(0); in Emit()
850 MCOS->getContext().finalizeDwarfSections(*MCOS); in Emit()
854 if (MCOS->getContext().getGenDwarfSectionSyms().empty()) in Emit()
860 MCOS->getContext().getGenDwarfSectionSyms().size() > 1 && in Emit()
861 MCOS->getContext().getDwarfVersion() >= 3; in Emit()
864 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); in Emit()
867 MCOS->EmitLabel(InfoSectionSymbol); in Emit()
869 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); in Emit()
872 MCOS->EmitLabel(AbbrevSectionSymbol); in Emit()
875 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); in Emit()
878 MCOS->EmitLabel(RangesSectionSymbol); in Emit()
884 MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfARangesSection()); in Emit()
887 EmitGenDwarfAranges(MCOS, InfoSectionSymbol); in Emit()
890 EmitGenDwarfRanges(MCOS); in Emit()
893 EmitGenDwarfAbbrev(MCOS); in Emit()
896 EmitGenDwarfInfo(MCOS, AbbrevSectionSymbol, LineSectionSymbol, in Emit()
906 void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS, in Make() argument
911 MCContext &context = MCOS->getContext(); in Make()
914 if (!context.getGenDwarfSectionSyms().count(MCOS->getCurrentSection().first)) in Make()
936 MCOS->EmitLabel(Label); in Make()
939 MCOS->getContext().addMCGenDwarfLabelEntry( in Make()