Home | History | Annotate | Download | only in MC

Lines Matching refs:Streamer

335 /// Utility function to emit the encoding to a streamer.
434 static int getDataAlignmentFactor(MCStreamer &streamer) {
435 MCContext &context = streamer.getContext();
444 static unsigned getSizeForEncoding(MCStreamer &streamer,
446 MCContext &context = streamer.getContext();
466 static void EmitSymbol(MCStreamer &streamer, const MCSymbol &symbol,
468 MCContext &context = streamer.getContext();
472 streamer);
473 unsigned size = getSizeForEncoding(streamer, symbolEncoding);
474 if (streamer.isVerboseAsm() && comment) streamer.AddComment(comment);
475 streamer.EmitAbsValue(v, size);
478 static void EmitPersonality(MCStreamer &streamer, const MCSymbol &symbol,
480 MCContext &context = streamer.getContext();
484 streamer);
485 unsigned size = getSizeForEncoding(streamer, symbolEncoding);
486 streamer.EmitValue(v, size);
516 bool EmitCompactUnwind(MCStreamer &streamer,
519 const MCSymbol &EmitCIE(MCStreamer &streamer,
524 MCSymbol *EmitFDE(MCStreamer &streamer,
527 void EmitCFIInstructions(MCStreamer &streamer,
530 void EmitCFIInstruction(MCStreamer &Streamer,
536 static void EmitEncodingByte(MCStreamer &Streamer, unsigned Encoding,
538 if (Streamer.isVerboseAsm()) {
563 Streamer.AddComment(Twine(Prefix) + " = " + EncStr);
566 Streamer.EmitIntValue(Encoding, 1);
569 void FrameEmitterImpl::EmitCFIInstruction(MCStreamer &Streamer,
571 int dataAlignmentFactor = getDataAlignmentFactor(Streamer);
572 bool VerboseAsm = Streamer.isVerboseAsm();
584 if (VerboseAsm) Streamer.AddComment("DW_CFA_def_cfa_offset");
585 Streamer.EmitIntValue(dwarf::DW_CFA_def_cfa_offset, 1);
587 if (VerboseAsm) Streamer.AddComment("DW_CFA_def_cfa");
588 Streamer.EmitIntValue(dwarf::DW_CFA_def_cfa, 1);
589 if (VerboseAsm) Streamer.AddComment(Twine("Reg ") +
591 Streamer.EmitULEB128IntValue(Src.getReg());
599 if (VerboseAsm) Streamer.AddComment(Twine("Offset " + Twine(CFAOffset)));
600 Streamer.EmitULEB128IntValue(CFAOffset);
606 if (VerboseAsm) Streamer.AddComment("DW_CFA_def_cfa_register");
607 Streamer.EmitIntValue(dwarf::DW_CFA_def_cfa_register, 1);
608 if (VerboseAsm) Streamer.AddComment(Twine("Reg ") + Twine(Dst.getReg()));
609 Streamer.EmitULEB128IntValue(Dst.getReg());
620 if (VerboseAsm) Streamer.AddComment("DW_CFA_offset_extended_sf");
621 Streamer.EmitIntValue(dwarf::DW_CFA_offset_extended_sf, 1);
622 if (VerboseAsm) Streamer.AddComment(Twine("Reg ") + Twine(Reg));
623 Streamer.EmitULEB128IntValue(Reg);
624 if (VerboseAsm) Streamer.AddComment(Twine("Offset ") + Twine(Offset));
625 Streamer.EmitSLEB128IntValue(Offset);
627 if (VerboseAsm) Streamer.AddComment(Twine("DW_CFA_offset + Reg(") +
629 Streamer.EmitIntValue(dwarf::DW_CFA_offset + Reg, 1);
630 if (VerboseAsm) Streamer.AddComment(Twine("Offset ") + Twine(Offset));
631 Streamer.EmitULEB128IntValue(Offset);
633 if (VerboseAsm) Streamer.AddComment("DW_CFA_offset_extended");
634 Streamer.EmitIntValue(dwarf::DW_CFA_offset_extended, 1);
635 if (VerboseAsm) Streamer.AddComment(Twine("Reg ") + Twine(Reg));
636 Streamer.EmitULEB128IntValue(Reg);
637 if (VerboseAsm) Streamer.AddComment(Twine("Offset ") + Twine(Offset));
638 Streamer.EmitULEB128IntValue(Offset);
643 if (VerboseAsm) Streamer.AddComment("DW_CFA_remember_state");
644 Streamer.EmitIntValue(dwarf::DW_CFA_remember_state, 1);
647 if (VerboseAsm) Streamer.AddComment("DW_CFA_restore_state");
648 Streamer.EmitIntValue(dwarf::DW_CFA_restore_state, 1);
652 if (VerboseAsm) Streamer.AddComment("DW_CFA_same_value");
653 Streamer.EmitIntValue(dwarf::DW_CFA_same_value, 1);
654 if (VerboseAsm) Streamer.AddComment(Twine("Reg ") + Twine(Reg));
655 Streamer.EmitULEB128IntValue(Reg);
664 void FrameEmitterImpl::EmitCFIInstructions(MCStreamer &streamer,
677 if (streamer.isVerboseAsm()) streamer.AddComment("DW_CFA_advance_loc4");
678 streamer.EmitDwarfAdvanceFrameAddr(BaseLabel, ThisSym);
683 EmitCFIInstruction(streamer, Instr);
690 bool FrameEmitterImpl::EmitCompactUnwind(MCStreamer &Streamer,
692 MCContext &Context = Streamer.getContext();
695 bool VerboseAsm = Streamer.isVerboseAsm();
726 Streamer.SwitchSection(MOFI->getCompactUnwindSection());
730 unsigned Size = getSizeForEncoding(Streamer, FDEEncoding);
731 if (VerboseAsm) Streamer.AddComment("Range Start");
732 Streamer.EmitSymbolValue(Frame.Function, Size);
735 const MCExpr *Range = MakeStartMinusEndExpr(Streamer, *Frame.Begin,
737 if (VerboseAsm) Streamer.AddComment("Range Length");
738 Streamer.EmitAbsValue(Range, 4);
741 Size = getSizeForEncoding(Streamer, dwarf::DW_EH_PE_udata4);
742 if (VerboseAsm) Streamer.AddComment(Twine("Compact Unwind Encoding: 0x") +
744 Streamer.EmitIntValue(Encoding, Size);
748 Size = getSizeForEncoding(Streamer, dwarf::DW_EH_PE_absptr);
749 if (VerboseAsm) Streamer.AddComment("Personality Function");
751 Streamer.EmitSymbolValue(Frame.Personality, Size);
753 Streamer.EmitIntValue(0, Size); // No personality fn
756 Size = getSizeForEncoding(Streamer, Frame.LsdaEncoding);
757 if (VerboseAsm) Streamer.AddComment("LSDA");
759 Streamer.EmitSymbolValue(Frame.Lsda, Size);
761 Streamer.EmitIntValue(0, Size); // No LSDA
766 const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
771 MCContext &context = streamer.getContext();
775 bool verboseAsm = streamer.isVerboseAsm();
783 streamer.EmitLabel(sectionStart);
789 const MCExpr *Length = MakeStartMinusEndExpr(streamer, *sectionStart,
791 if (verboseAsm) streamer.AddComment("CIE Length");
792 streamer.EmitAbsValue(Length, 4);
796 if (verboseAsm) streamer.AddComment("CIE ID Tag");
797 streamer.EmitIntValue(CIE_ID, 4);
800 if (verboseAsm) streamer.AddComment("DW_CIE_VERSION");
801 streamer.EmitIntValue(dwarf::DW_CIE_VERSION, 1);
806 if (verboseAsm) streamer.AddComment("CIE Augmentation");
813 streamer.EmitBytes(Augmentation.str(), 0);
815 streamer.EmitIntValue(0, 1);
818 if (verboseAsm) streamer.AddComment("CIE Code Alignment Factor");
819 streamer.EmitULEB128IntValue(1);
822 if (verboseAsm) streamer.AddComment("CIE Data Alignment Factor");
823 streamer.EmitSLEB128IntValue(getDataAlignmentFactor(streamer));
826 if (verboseAsm) streamer.AddComment("CIE Return Address Column");
827 streamer.EmitULEB128IntValue(MRI.getDwarfRegNum(MRI.getRARegister(), true));
837 augmentationLength += getSizeForEncoding(streamer, personalityEncoding);
844 if (verboseAsm) streamer.AddComment("Augmentation Size");
845 streamer.EmitULEB128IntValue(augmentationLength);
850 EmitEncodingByte(streamer, personalityEncoding,
853 if (verboseAsm) streamer.AddComment("Personality");
854 EmitPersonality(streamer, *personality, personalityEncoding);
858 EmitEncodingByte(streamer, lsdaEncoding, "LSDA Encoding");
861 EmitEncodingByte(streamer, TAI.getFDEEncoding(UsingCFI),
881 EmitCFIInstructions(streamer, Instructions, NULL);
884 streamer.EmitValueToAlignment(IsEH
887 streamer.EmitLabel(sectionEnd);
891 MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
894 MCContext &context = streamer.getContext();
899 bool verboseAsm = streamer.isVerboseAsm();
904 streamer.EmitEHSymAttributes(frame.Function, EHSym);
905 streamer.EmitLabel(EHSym);
909 const MCExpr *Length = MakeStartMinusEndExpr(streamer, *fdeStart, *fdeEnd, 0);
910 if (verboseAsm) streamer.AddComment("FDE Length");
911 streamer.EmitAbsValue(Length, 4);
913 streamer.EmitLabel(fdeStart);
918 const MCExpr *offset = MakeStartMinusEndExpr(streamer, cieStart, *fdeStart,
920 if (verboseAsm) streamer.AddComment("FDE CIE Offset");
921 streamer.EmitAbsValue(offset, 4);
923 const MCExpr *offset = MakeStartMinusEndExpr(streamer, *SectionStart,
925 streamer.EmitAbsValue(offset, 4);
927 streamer.EmitSymbolValue(&cieStart, 4);
931 unsigned size = getSizeForEncoding(streamer, fdeEncoding);
936 unsigned PCBeginSize = getSizeForEncoding(streamer, PCBeginEncoding);
937 EmitSymbol(streamer, *frame.Begin, PCBeginEncoding, "FDE initial location");
940 const MCExpr *Range = MakeStartMinusEndExpr(streamer, *frame.Begin,
942 if (verboseAsm) streamer.AddComment("FDE address range");
943 streamer.EmitAbsValue(Range, size);
950 augmentationLength += getSizeForEncoding(streamer, frame.LsdaEncoding);
952 if (verboseAsm) streamer.AddComment("Augmentation size");
953 streamer.EmitULEB128IntValue(augmentationLength);
957 EmitSymbol(streamer, *frame.Lsda, frame.LsdaEncoding,
963 EmitCFIInstructions(streamer, frame.Instructions, frame.Begin);
966 streamer.EmitValueToAlignment(PCBeginSize);
1012 void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer,
1015 MCContext &Context = Streamer.getContext();
1020 Streamer.SwitchSection(&Section);
1022 Streamer.EmitLabel(SectionStart);
1029 for (unsigned i = 0, n = Streamer.getNumFrameInfos(); i < n; ++i) {
1030 const MCDwarfFrameInfo &Frame = Streamer.getFrameInfo(i);
1033 Emitter.EmitCompactUnwind(Streamer, Frame)) {
1042 CIEStart = &Emitter.EmitCIE(Streamer, Frame.Personality,
1046 FDEEnd = Emitter.EmitFDE(Streamer, *CIEStart, Frame);
1049 Streamer.EmitLabel(FDEEnd);
1052 Streamer.EmitValueToAlignment(Context.getAsmInfo().getPointerSize());
1054 Streamer.EmitLabel(FDEEnd);
1057 void MCDwarfFrameEmitter::EmitAdvanceLoc(MCStreamer &Streamer,
1062 Streamer.EmitBytes(OS.str(), /*AddrSpace=*/0);