Lines Matching full:streamer
53 static void EmitAbsDifference(MCStreamer &Streamer, const MCSymbol *LHS,
55 MCContext &Context = Streamer.getContext();
59 Streamer.emitValue(Diff, 1);
62 static void EmitUnwindCode(MCStreamer &streamer, const MCSymbol *begin,
71 EmitAbsDifference(streamer, inst.Label, begin);
73 streamer.emitInt8(b2);
76 EmitAbsDifference(streamer, inst.Label, begin);
79 streamer.emitInt8(b2);
81 streamer.emitInt16(w);
84 streamer.emitInt8(b2);
87 streamer.emitInt16(w);
91 EmitAbsDifference(streamer, inst.Label, begin);
92 streamer.emitInt8(b2);
95 EmitAbsDifference(streamer, inst.Label, begin);
96 streamer.emitInt8(b2);
101 EmitAbsDifference(streamer, inst.Label, begin);
102 streamer.emitInt8(b2);
106 streamer.emitInt16(w);
111 EmitAbsDifference(streamer, inst.Label, begin);
112 streamer.emitInt8(b2);
117 streamer.emitInt16(w);
119 streamer.emitInt16(w);
124 EmitAbsDifference(streamer, inst.Label, begin);
125 streamer.emitInt8(b2);
130 static void EmitSymbolRefWithOfs(MCStreamer &streamer,
133 MCContext &Context = streamer.getContext();
138 streamer.emitValue(MCBinaryExpr::createAdd(BaseRefRel, OffExpr, Context), 4);
141 static void EmitSymbolRefWithOfs(MCStreamer &streamer,
144 MCContext &Context = streamer.getContext();
151 streamer.emitValue(MCBinaryExpr::createAdd(BaseRefRel, Ofs, Context), 4);
154 static void EmitRuntimeFunction(MCStreamer &streamer,
156 MCContext &context = streamer.getContext();
158 streamer.emitValueToAlignment(Align(4));
159 EmitSymbolRefWithOfs(streamer, info->Begin, info->Begin);
160 EmitSymbolRefWithOfs(streamer, info->Begin, info->End);
161 streamer.emitValue(MCSymbolRefExpr::create(info->Symbol,
166 static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
171 MCContext &context = streamer.getContext();
174 streamer.emitValueToAlignment(Align(4));
175 streamer.emitLabel(Label);
188 streamer.emitInt8(flags);
191 EmitAbsDifference(streamer, info->PrologEnd, info->Begin);
193 streamer.emitInt8(0);
196 streamer.emitInt8(numCodes);
204 streamer.emitInt8(frame);
211 EmitUnwindCode(streamer, info->Begin, inst);
219 streamer.emitInt16(0);
223 EmitRuntimeFunction(streamer, info->ChainedParent);
226 streamer.emitValue(MCSymbolRefExpr::create(info->ExceptionHandler,
233 streamer.emitInt32(0);
237 void llvm::Win64EH::UnwindEmitter::Emit(MCStreamer &Streamer) const {
239 for (const auto &CFI : Streamer.getWinFrameInfos()) {
240 MCSection *XData = Streamer.getAssociatedXDataSection(CFI->TextSection);
241 Streamer.switchSection(XData);
242 ::EmitUnwindInfo(Streamer, CFI.get());
246 for (const auto &CFI : Streamer.getWinFrameInfos()) {
247 MCSection *PData = Streamer.getAssociatedPDataSection(CFI->TextSection);
248 Streamer.switchSection(PData);
249 EmitRuntimeFunction(Streamer, CFI.get());
253 void llvm::Win64EH::UnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
258 MCSection *XData = Streamer.getAssociatedXDataSection(info->TextSection);
259 Streamer.switchSection(XData);
261 ::EmitUnwindInfo(Streamer, info);
264 static const MCExpr *GetSubDivExpr(MCStreamer &Streamer, const MCSymbol *LHS,
266 MCContext &Context = Streamer.getContext();
276 static std::optional<int64_t> GetOptionalAbsDifference(MCStreamer &Streamer,
279 MCContext &Context = Streamer.getContext();
283 MCObjectStreamer *OS = (MCObjectStreamer *)(&Streamer);
293 static int64_t GetAbsDifference(MCStreamer &Streamer, const MCSymbol *LHS,
296 GetOptionalAbsDifference(Streamer, LHS, RHS);
302 static void checkARM64Instructions(MCStreamer &Streamer,
309 GetOptionalAbsDifference(Streamer, End, Begin);
331 Streamer.getContext().reportError(
445 static void ARM64EmitUnwindCode(MCStreamer &streamer,
453 streamer.emitInt8(b);
459 streamer.emitInt8(b);
461 streamer.emitInt8(b);
467 streamer.emitInt8(b);
470 streamer.emitInt8(b);
472 streamer.emitInt8(b);
474 streamer.emitInt8(b);
479 streamer.emitInt8(b);
483 streamer.emitInt8(b);
485 streamer.emitInt8(b);
489 streamer.emitInt8(b);
494 streamer.emitInt8(b);
499 streamer.emitInt8(b);
504 streamer.emitInt8(b);
510 streamer.emitInt8(b);
512 streamer.emitInt8(b);
518 streamer.emitInt8(b);
520 streamer.emitInt8(b);
526 streamer.emitInt8(b);
528 streamer.emitInt8(b);
534 streamer.emitInt8(b);
536 streamer.emitInt8(b);
544 streamer.emitInt8(b);
546 streamer.emitInt8(b);
552 streamer.emitInt8(b);
554 streamer.emitInt8(b);
560 streamer.emitInt8(b);
562 streamer.emitInt8(b);
568 streamer.emitInt8(b);
570 streamer.emitInt8(b);
576 streamer.emitInt8(b);
578 streamer.emitInt8(b);
582 streamer.emitInt8(b);
586 streamer.emitInt8(b);
590 streamer.emitInt8(b);
594 streamer.emitInt8(b);
598 streamer.emitInt8(b);
602 streamer.emitInt8(b);
606 streamer.emitInt8(b);
610 streamer.emitInt8(b);
635 streamer.emitInt8(b);
638 streamer.emitInt8(b);
640 streamer.emitInt8(b);
761 static int checkARM64PackedEpilog(MCStreamer &streamer, WinEH::FrameInfo *info,
1125 static void ARM64FindSegmentsInFunction(MCStreamer &streamer,
1129 checkARM64Instructions(streamer, info->Instructions, info->Begin,
1142 int64_t Offset = GetAbsDifference(streamer, Start, info->Begin);
1143 checkARM64Instructions(streamer, Instrs, Start, I.second.End,
1206 static void ARM64EmitUnwindInfoForSegment(MCStreamer &streamer,
1210 MCContext &context = streamer.getContext();
1213 streamer.emitValueToAlignment(Align(4));
1214 streamer.emitLabel(Label);
1227 checkARM64PackedEpilog(streamer, info, &Seg, PrologCodeBytes) : -1;
1287 streamer.emitInt32(row1);
1300 streamer.emitInt32(row2);
1314 streamer.emitInt32(row3);
1326 streamer.emitInt8((uint8_t)0xE5);
1330 ARM64EmitUnwindCode(streamer, Inst);
1336 ARM64EmitUnwindCode(streamer, inst);
1342 streamer.emitInt8(0xE3);
1345 streamer.emitValue(
1353 static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info,
1372 streamer.getContext().reportError(
1417 RawFuncLength = GetAbsDifference(streamer, info->FuncletOrFuncEnd,
1421 ARM64FindSegmentsInFunction(streamer, info, RawFuncLength);
1425 ARM64EmitUnwindInfoForSegment(streamer, info, S, TryPacked);
1561 static void checkARMInstructions(MCStreamer &Streamer,
1568 GetOptionalAbsDifference(Streamer, End, Begin);
1577 Streamer.getContext().reportError(
1599 static void ARMEmitUnwindCode(MCStreamer &streamer,
1609 streamer.emitInt8(inst.Offset / 4);
1615 streamer.emitInt8((w >> 8) & 0xff);
1616 streamer.emitInt8((w >> 0) & 0xff);
1620 streamer.emitInt8(0xc0 | inst.Register);
1625 streamer.emitInt8(0xd0 | (inst.Register - 4) | (inst.Offset << 2));
1630 streamer.emitInt8(0xd8 | (inst.Register - 8) | (inst.Offset << 2));
1634 streamer.emitInt8(0xe0 | (inst.Register - 8));
1640 streamer.emitInt8((w >> 8) & 0xff);
1641 streamer.emitInt8((w >> 0) & 0xff);
1647 streamer.emitInt8((w >> 8) & 0xff);
1648 streamer.emitInt8((w >> 0) & 0xff);
1653 streamer.emitInt8(0xef);
1654 streamer.emitInt8(inst.Offset / 4);
1660 streamer.emitInt8(0xf5);
1661 streamer.emitInt8((inst.Register << 4) | inst.Offset);
1667 streamer.emitInt8(0xf6);
1668 streamer.emitInt8(((inst.Register - 16) << 4) | (inst.Offset - 16));
1674 streamer.emitInt8(0xf7);
1675 streamer.emitInt8((w >> 8) & 0xff);
1676 streamer.emitInt8((w >> 0) & 0xff);
1682 streamer.emitInt8(0xf8);
1683 streamer.emitInt8((w >> 16) & 0xff);
1684 streamer.emitInt8((w >> 8) & 0xff);
1685 streamer.emitInt8((w >> 0) & 0xff);
1691 streamer.emitInt8(0xf9);
1692 streamer.emitInt8((w >> 8) & 0xff);
1693 streamer.emitInt8((w >> 0) & 0xff);
1699 streamer.emitInt8(0xfa);
1700 streamer.emitInt8((w >> 16) & 0xff);
1701 streamer.emitInt8((w >> 8) & 0xff);
1702 streamer.emitInt8((w >> 0) & 0xff);
1705 streamer.emitInt8(0xfb);
1708 streamer.emitInt8(0xfc);
1711 streamer.emitInt8(0xfd);
1714 streamer.emitInt8(0xfe);
1717 streamer.emitInt8(0xff);
1724 streamer.emitInt8((inst.Offset >> (8 * i)) & 0xff);
1771 static int checkARMPackedEpilog(MCStreamer &streamer, WinEH::FrameInfo *info,
1790 streamer, info->FuncletOrFuncEnd, info->EpilogMap.begin()->first);
1868 static bool tryARMPackedUnwind(MCStreamer &streamer, WinEH::FrameInfo *info,
2016 streamer, info->FuncletOrFuncEnd, info->EpilogMap.begin()->first);
2270 static void ARMEmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info,
2289 streamer.getContext().reportError(
2297 MCContext &context = streamer.getContext();
2300 streamer.emitValueToAlignment(Align(4));
2301 streamer.emitLabel(Label);
2305 streamer.getContext().reportError(SMLoc(), "Prologue in " +
2310 checkARMInstructions(streamer, info->Instructions, info->Begin,
2316 checkARMInstructions(streamer, Epilog.Instructions, EpilogStart, Epilog.End,
2320 streamer.getContext().reportError(
2339 GetOptionalAbsDifference(streamer, info->FuncletOrFuncEnd, info->Begin);
2342 GetSubDivExpr(streamer, info->FuncletOrFuncEnd, info->Begin, 2);
2362 if (tryARMPackedUnwind(streamer, info, FuncLength))
2367 checkARMPackedEpilog(streamer, info, PrologCodeBytes);
2431 streamer.emitInt32(row1);
2433 streamer.emitValue(
2446 streamer.emitInt32(row2);
2456 GetOptionalAbsDifference(streamer, EpilogStart, info->Begin);
2462 OffsetExpr = GetSubDivExpr(streamer, EpilogStart, info->Begin, 2);
2472 streamer.emitInt32(row3);
2474 streamer.emitValue(
2486 ARMEmitUnwindCode(streamer, inst);
2493 ARMEmitUnwindCode(streamer, inst);
2499 streamer.emitInt8(0xFB);
2502 streamer.emitValue(
2508 static void ARM64EmitRuntimeFunction(MCStreamer &streamer,
2510 MCContext &context = streamer.getContext();
2512 streamer.emitValueToAlignment(Align(4));
2514 EmitSymbolRefWithOfs(streamer, info->Begin, S.Offset);
2516 streamer.emitInt32(info->PackedInfo);
2518 streamer.emitValue(
2526 static void ARMEmitRuntimeFunction(MCStreamer &streamer,
2528 MCContext &context = streamer.getContext();
2530 streamer.emitValueToAlignment(Align(4));
2531 EmitSymbolRefWithOfs(streamer, info->Begin, info->Begin);
2533 streamer.emitInt32(info->PackedInfo);
2535 streamer.emitValue(
2541 void llvm::Win64EH::ARM64UnwindEmitter::Emit(MCStreamer &Streamer) const {
2543 for (const auto &CFI : Streamer.getWinFrameInfos()) {
2547 MCSection *XData = Streamer.getAssociatedXDataSection(CFI->TextSection);
2548 Streamer.switchSection(XData);
2549 ARM64EmitUnwindInfo(Streamer, Info);
2553 for (const auto &CFI : Streamer.getWinFrameInfos()) {
2560 MCSection *PData = Streamer.getAssociatedPDataSection(CFI->TextSection);
2561 Streamer.switchSection(PData);
2562 ARM64EmitRuntimeFunction(Streamer, Info);
2566 void llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
2576 Streamer.switchSection(info->TextSection);
2577 info->FuncletOrFuncEnd = Streamer.emitCFILabel();
2581 MCSection *XData = Streamer.getAssociatedXDataSection(info->TextSection);
2582 Streamer.switchSection(XData);
2583 ARM64EmitUnwindInfo(Streamer, info, /* TryPacked = */ !HandlerData);
2586 void llvm::Win64EH::ARMUnwindEmitter::Emit(MCStreamer &Streamer) const {
2588 for (const auto &CFI : Streamer.getWinFrameInfos()) {
2592 MCSection *XData = Streamer.getAssociatedXDataSection(CFI->TextSection);
2593 Streamer.switchSection(XData);
2594 ARMEmitUnwindInfo(Streamer, Info);
2598 for (const auto &CFI : Streamer.getWinFrameInfos()) {
2605 MCSection *PData = Streamer.getAssociatedPDataSection(CFI->TextSection);
2606 Streamer.switchSection(PData);
2607 ARMEmitRuntimeFunction(Streamer, Info);
2611 void llvm::Win64EH::ARMUnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
2621 Streamer.switchSection(info->TextSection);
2622 info->FuncletOrFuncEnd = Streamer.emitCFILabel();
2626 MCSection *XData = Streamer.getAssociatedXDataSection(info->TextSection);
2627 Streamer.switchSection(XData);
2628 ARMEmitUnwindInfo(Streamer, info, /* TryPacked = */ !HandlerData);