Lines Matching +full:loc +full:- +full:code

1 //===- lib/MC/MCAsmStreamer.cpp - Text Assembly Output ----------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
81 (asmbackend) ? asmbackend->createObjectWriter(NullStream) in MCAsmStreamer()
85 if (Assembler->getBackendPtr()) in MCAsmStreamer()
86 setAllowAutoPadding(Assembler->getBackend().allowAutoPadding()); in MCAsmStreamer()
93 IsVerboseAsm = TO->AsmVerbose; in MCAsmStreamer()
95 InstPrinter->setCommentStream(CommentStream); in MCAsmStreamer()
96 ShowInst = TO->ShowMCInst; in MCAsmStreamer()
97 switch (TO->MCUseDwarfDirectory) { in MCAsmStreamer()
106 Context.getAsmInfo()->enableDwarfFileDirectoryDefault(); in MCAsmStreamer()
173 auto [Ptr, Bits] = InstPrinter->getMnemonic(&MI); in getMnemonic()
179 void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
231 /// @param Symbol - The common symbol to emit.
232 /// @param Size - The size of the common symbol.
233 /// @param ByteAlignment - The alignment of the common symbol in bytes.
239 SMLoc Loc = SMLoc()) override;
249 SMLoc Loc = SMLoc()) override;
268 SMLoc Loc = SMLoc()) override;
271 SMLoc Loc = SMLoc()) override;
286 SMLoc Loc) override;
312 unsigned IACol, SMLoc Loc) override;
315 StringRef FileName, SMLoc Loc) override;
352 void emitCFIDefCfa(int64_t Register, int64_t Offset, SMLoc Loc) override;
353 void emitCFIDefCfaOffset(int64_t Offset, SMLoc Loc) override;
354 void emitCFIDefCfaRegister(int64_t Register, SMLoc Loc) override;
356 int64_t AddressSpace, SMLoc Loc) override;
357 void emitCFIOffset(int64_t Register, int64_t Offset, SMLoc Loc) override;
360 void emitCFIRememberState(SMLoc Loc) override;
361 void emitCFIRestoreState(SMLoc Loc) override;
362 void emitCFIRestore(int64_t Register, SMLoc Loc) override;
363 void emitCFISameValue(int64_t Register, SMLoc Loc) override;
364 void emitCFIRelOffset(int64_t Register, int64_t Offset, SMLoc Loc) override;
365 void emitCFIAdjustCfaOffset(int64_t Adjustment, SMLoc Loc) override;
366 void emitCFIEscape(StringRef Values, SMLoc Loc) override;
367 void emitCFIGnuArgsSize(int64_t Size, SMLoc Loc) override;
369 void emitCFIUndefined(int64_t Register, SMLoc Loc) override;
371 SMLoc Loc) override;
372 void emitCFIWindowSave(SMLoc Loc) override;
373 void emitCFINegateRAState(SMLoc Loc) override;
375 void emitCFILabelDirective(SMLoc Loc, StringRef Name) override;
377 void emitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc) override;
378 void emitWinCFIEndProc(SMLoc Loc) override;
379 void emitWinCFIFuncletOrFuncEnd(SMLoc Loc) override;
380 void emitWinCFIStartChained(SMLoc Loc) override;
381 void emitWinCFIEndChained(SMLoc Loc) override;
382 void emitWinCFIPushReg(MCRegister Register, SMLoc Loc) override;
384 SMLoc Loc) override;
385 void emitWinCFIAllocStack(unsigned Size, SMLoc Loc) override;
387 SMLoc Loc) override;
389 SMLoc Loc) override;
390 void emitWinCFIPushFrame(bool Code, SMLoc Loc) override;
391 void emitWinCFIEndProlog(SMLoc Loc) override;
394 SMLoc Loc) override;
395 void emitWinEHHandlerData(SMLoc Loc) override;
413 SMLoc Loc, const MCSubtargetInfo &STI) override;
464 OS.PadToColumn(MAI->getCommentColumn()); in EmitCommentsAndEOL()
466 OS << MAI->getCommentString() << ' ' << Comments.substr(0, Position) <<'\n'; in EmitCommentsAndEOL()
476 return Value & ((uint64_t) (int64_t) -1 >> (64 - Bytes * 8)); in truncateToSize()
482 OS << MAI->getCommentString() << T; in emitRawComment()
488 if (c == MAI->getSeparatorString()) in addExplicitComment()
492 ExplicitCommentToEmit.append(MAI->getCommentString()); in addExplicitComment()
496 size_t p = 2, len = c.size() - 2; in addExplicitComment()
501 ExplicitCommentToEmit.append(MAI->getCommentString()); in addExplicitComment()
508 } else if (c.starts_with(StringRef(MAI->getCommentString()))) { in addExplicitComment()
514 ExplicitCommentToEmit.append(MAI->getCommentString()); in addExplicitComment()
532 TS->changeSection(getCurrentSection().first, Section, Subsection, OS); in changeSection()
534 Section->printSwitchToSection(*MAI, getContext().getTargetTriple(), OS, in changeSection()
544 OriginalSym->print(OS, MAI); in emitELFSymverDirective()
551 void MCAsmStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) { in emitLabel() argument
552 MCStreamer::emitLabel(Symbol, Loc); in emitLabel()
554 Symbol->print(OS, MAI); in emitLabel()
555 OS << MAI->getLabelSuffix(); in emitLabel()
565 assert(NbArgs != -1 && ((size_t)NbArgs) == Args.size() && "Malformed LOH!"); in emitLOHDirective()
575 Arg->print(OS, MAI); in emitLOHDirective()
588 case MCAF_Code16: OS << '\t'<< MAI->getCode16Directive();break; in emitAssemblerFlag()
589 case MCAF_Code32: OS << '\t'<< MAI->getCode32Directive();break; in emitAssemblerFlag()
590 case MCAF_Code64: OS << '\t'<< MAI->getCode64Directive();break; in emitAssemblerFlag()
604 if (!MAI->doesSupportDataRegionDirectives()) in emitDataRegion()
657 llvm_unreachable("Invalid Mach-O platform type"); in getPlatformName()
681 // Only Mach-O hasSubsectionsViaSymbols() in emitThumbFunc()
682 if (MAI->hasSubsectionsViaSymbols()) { in emitThumbFunc()
684 Func->print(OS, MAI); in emitThumbFunc()
693 if (E->inlineAssignedExpr()) in emitAssignment()
697 Symbol->print(OS, MAI); in emitAssignment()
699 Value->print(OS, MAI); in emitAssignment()
710 Symbol->print(OS, MAI); in emitConditionalAssignment()
712 Value->print(OS, MAI); in emitConditionalAssignment()
718 Alias->print(OS, MAI); in emitWeakReference()
720 Symbol->print(OS, MAI); in emitWeakReference()
735 if (!MAI->hasDotTypeDotSizeDirective()) in emitSymbolAttribute()
738 Symbol->print(OS, MAI); in emitSymbolAttribute()
739 OS << ',' << ((MAI->getCommentString()[0] != '@') ? '@' : '%'); in emitSymbolAttribute()
753 OS << MAI->getGlobalDirective(); in emitSymbolAttribute()
762 if (!MAI->hasNoDeadStrip()) in emitSymbolAttribute()
776 case MCSA_Weak: OS << MAI->getWeakDirective(); break; in emitSymbolAttribute()
781 case MCSA_WeakReference: OS << MAI->getWeakRefDirective(); break; in emitSymbolAttribute()
786 // Non-AIX assemblers currently do not support exported visibility. in emitSymbolAttribute()
796 Symbol->print(OS, MAI); in emitSymbolAttribute()
804 Symbol->print(OS, MAI); in emitSymbolDesc()
810 if (MAI->getAssemblerDialect() == 1) { in emitSyntaxDirective()
821 Symbol->print(OS, MAI); in beginCOFFSymbolDef()
843 Symbol->print(OS, MAI); in emitCOFFSafeSEH()
849 Symbol->print(OS, MAI); in emitCOFFSymbolIndex()
855 Symbol->print(OS, MAI); in emitCOFFSectionIndex()
861 Symbol->print(OS, MAI); in emitCOFFSecRel32()
869 Symbol->print(OS, MAI); in emitCOFFImgRel32()
873 OS << '-' << -Offset; in emitCOFFImgRel32()
877 // We need an XCOFF-specific version of this directive as the AIX syntax
884 assert(MAI->getLCOMMDirectiveAlignmentType() == LCOMM::Log2Alignment && in emitXCOFFLocalCommonSymbol()
885 "We only support writing log base-2 alignment format with XCOFF."); in emitXCOFFLocalCommonSymbol()
888 LabelSym->print(OS, MAI); in emitXCOFFLocalCommonSymbol()
890 CsectSym->print(OS, MAI); in emitXCOFFLocalCommonSymbol()
898 if (XSym->hasRename()) in emitXCOFFLocalCommonSymbol()
899 emitXCOFFRenameDirective(XSym, XSym->getSymbolTableName()); in emitXCOFFLocalCommonSymbol()
907 OS << MAI->getGlobalDirective(); in emitXCOFFSymbolLinkageWithVisibility()
910 OS << MAI->getWeakDirective(); in emitXCOFFSymbolLinkageWithVisibility()
922 Symbol->print(OS, MAI); in emitXCOFFSymbolLinkageWithVisibility()
944 if (cast<MCSymbolXCOFF>(Symbol)->hasRename()) in emitXCOFFSymbolLinkageWithVisibility()
946 cast<MCSymbolXCOFF>(Symbol)->getSymbolTableName()); in emitXCOFFSymbolLinkageWithVisibility()
952 Name->print(OS, MAI); in emitXCOFFRenameDirective()
967 Symbol->print(OS, MAI); in emitXCOFFRefDirective()
978 Symbol->print(OS, MAI); in emitXCOFFExceptDirective()
988 // Start by emitting the .info pseudo-op and C_INFO symbol name. in emitXCOFFCInfoSym()
995 // Emit the 4-byte length of the metadata. in emitXCOFFCInfoSym()
1005 // assembly because the .info pseudo-op can only generate words of data. We in emitXCOFFCInfoSym()
1010 uint32_t PaddingSize = PaddedSize - MetadataSize; in emitXCOFFCInfoSym()
1015 // so we need multiple .info pseudo-ops. We choose a small number of words in emitXCOFFCInfoSym()
1016 // per pseudo-op to keep the assembly readable. in emitXCOFFCInfoSym()
1022 if (WordsBeforeNextDirective-- == 0) { in emitXCOFFCInfoSym()
1039 assert(PaddedSize - Index == WordSize); in emitXCOFFCInfoSym()
1041 ::memcpy(LastWord.data(), Metadata.data() + Index, MetadataSize - Index); in emitXCOFFCInfoSym()
1048 assert(MAI->hasDotTypeDotSizeDirective()); in emitELFSize()
1050 Symbol->print(OS, MAI); in emitELFSize()
1052 Value->print(OS, MAI); in emitELFSize()
1059 Symbol->print(OS, MAI); in emitCommonSymbol()
1062 if (MAI->getCOMMDirectiveAlignmentIsInBytes()) in emitCommonSymbol()
1071 if (XSym && XSym->hasRename()) in emitCommonSymbol()
1072 emitXCOFFRenameDirective(XSym, XSym->getSymbolTableName()); in emitCommonSymbol()
1078 Symbol->print(OS, MAI); in emitLocalCommonSymbol()
1082 switch (MAI->getLCOMMDirectiveAlignmentType()) { in emitLocalCommonSymbol()
1098 SMLoc Loc) { in emitZerofill() argument
1100 Symbol->setFragment(&Section->getDummyFragment()); in emitZerofill()
1105 assert(Section->getVariant() == MCSection::SV_MachO && in emitZerofill()
1106 ".zerofill is a Mach-O specific directive"); in emitZerofill()
1107 // This is a mach-o specific directive. in emitZerofill()
1110 OS << MOSection->getSegmentName() << "," << MOSection->getName(); in emitZerofill()
1114 Symbol->print(OS, MAI); in emitZerofill()
1126 Symbol->setFragment(&Section->getDummyFragment()); in emitTBSSSymbol()
1130 assert(Section->getVariant() == MCSection::SV_MachO && in emitTBSSSymbol()
1131 ".zerofill is a Mach-O specific directive"); in emitTBSSSymbol()
1132 // This is a mach-o specific directive and section. in emitTBSSSymbol()
1135 Symbol->print(OS, MAI); in emitTBSSSymbol()
1148 for (const unsigned char C : make_range(BeginPtr, EndPtr - 1)) { in isPrintableString()
1178 for (const unsigned char C : make_range(BeginPtr, EndPtr - 1)) { in PrintByteList()
1182 printOneCharacter(*(EndPtr - 1)); in PrintByteList()
1201 if (MAI->hasPairedDoubleQuoteStringConstants()) { in PrintQuotedString()
1256 // use .ascii or a byte-list directive in emitBytes()
1257 if (MAI->getAscizDirective() && Data.back() == 0) { in emitBytes()
1258 OS << MAI->getAscizDirective(); in emitBytes()
1259 Data = Data.substr(0, Data.size() - 1); in emitBytes()
1260 } else if (LLVM_LIKELY(MAI->getAsciiDirective())) { in emitBytes()
1261 OS << MAI->getAsciiDirective(); in emitBytes()
1262 } else if (MAI->hasPairedDoubleQuoteStringConstants() && in emitBytes()
1266 assert(MAI->getPlainStringDirective() && in emitBytes()
1269 assert(MAI->getByteListDirective() && in emitBytes()
1273 OS << MAI->getPlainStringDirective(); in emitBytes()
1274 Data = Data.substr(0, Data.size() - 1); in emitBytes()
1276 OS << MAI->getByteListDirective(); in emitBytes()
1278 } else if (MAI->getByteListDirective()) { in emitBytes()
1279 OS << MAI->getByteListDirective(); in emitBytes()
1280 PrintByteList(Data, OS, MAI->characterLiteralSyntax()); in emitBytes()
1295 // Only single byte is provided or no ascii, asciz, or byte-list directives in emitBytes()
1298 TS->emitRawBytes(Data); in emitBytes()
1301 const char *Directive = MAI->getData8bitsDirective(); in emitBytes()
1314 OS << MAI->getData8bitsDirective(); in emitBinaryData()
1315 for (; J < EJ - 1; ++J) in emitBinaryData()
1336 SMLoc Loc) { in emitValueImpl() argument
1343 case 1: Directive = MAI->getData8bitsDirective(); break; in emitValueImpl()
1344 case 2: Directive = MAI->getData16bitsDirective(); break; in emitValueImpl()
1345 case 4: Directive = MAI->getData32bitsDirective(); break; in emitValueImpl()
1346 case 8: Directive = MAI->getData64bitsDirective(); break; in emitValueImpl()
1351 if (!Value->evaluateAsAbsolute(IntValue)) in emitValueImpl()
1358 bool IsLittleEndian = MAI->isLittleEndian(); in emitValueImpl()
1360 unsigned Remaining = Size - Emitted; in emitValueImpl()
1363 unsigned EmissionSize = llvm::bit_floor(std::min(Remaining, Size - 1)); in emitValueImpl()
1367 IsLittleEndian ? Emitted : (Remaining - EmissionSize); in emitValueImpl()
1372 uint64_t Shift = 64 - EmissionSize * 8; in emitValueImpl()
1383 assert(Directive && "Invalid size for machine code value!"); in emitValueImpl()
1386 TS->emitValue(Value); in emitValueImpl()
1388 Value->print(OS, MAI); in emitValueImpl()
1395 if (Value->evaluateAsAbsolute(IntValue)) { in emitULEB128Value()
1400 Value->print(OS, MAI); in emitULEB128Value()
1406 if (Value->evaluateAsAbsolute(IntValue)) { in emitSLEB128Value()
1411 Value->print(OS, MAI); in emitSLEB128Value()
1416 assert(MAI->getDTPRel64Directive() != nullptr); in emitDTPRel64Value()
1417 OS << MAI->getDTPRel64Directive(); in emitDTPRel64Value()
1418 Value->print(OS, MAI); in emitDTPRel64Value()
1423 assert(MAI->getDTPRel32Directive() != nullptr); in emitDTPRel32Value()
1424 OS << MAI->getDTPRel32Directive(); in emitDTPRel32Value()
1425 Value->print(OS, MAI); in emitDTPRel32Value()
1430 assert(MAI->getTPRel64Directive() != nullptr); in emitTPRel64Value()
1431 OS << MAI->getTPRel64Directive(); in emitTPRel64Value()
1432 Value->print(OS, MAI); in emitTPRel64Value()
1437 assert(MAI->getTPRel32Directive() != nullptr); in emitTPRel32Value()
1438 OS << MAI->getTPRel32Directive(); in emitTPRel32Value()
1439 Value->print(OS, MAI); in emitTPRel32Value()
1444 assert(MAI->getGPRel64Directive() != nullptr); in emitGPRel64Value()
1445 OS << MAI->getGPRel64Directive(); in emitGPRel64Value()
1446 Value->print(OS, MAI); in emitGPRel64Value()
1451 assert(MAI->getGPRel32Directive() != nullptr); in emitGPRel32Value()
1452 OS << MAI->getGPRel32Directive(); in emitGPRel32Value()
1453 Value->print(OS, MAI); in emitGPRel32Value()
1458 SMLoc Loc) { in emitFill() argument
1464 if (const char *ZeroDirective = MAI->getZeroDirective()) { in emitFill()
1465 if (MAI->doesZeroDirectiveSupportNonZeroValue() || FillValue == 0) { in emitFill()
1475 "Cannot emit non-absolute expression lengths of fill."); in emitFill()
1477 OS << MAI->getData8bitsDirective() << (int)FillValue; in emitFill()
1488 int64_t Expr, SMLoc Loc) { in emitFill() argument
1501 if (MAI->useDotAlignForAlignment()) { in emitAlignmentDirective()
1503 report_fatal_error("Only power-of-two alignments are supported " in emitAlignmentDirective()
1511 // Some assemblers don't support non-power of two alignments, so we always in emitAlignmentDirective()
1516 llvm_unreachable("Invalid size for machine code value!"); in emitAlignmentDirective()
1547 // Non-power of two alignment. This is not widely supported by assemblers. in emitAlignmentDirective()
1550 default: llvm_unreachable("Invalid size for machine code value!"); in emitAlignmentDirective()
1577 if (MAI->getTextAlignFillValue()) in emitCodeAlignment()
1578 emitAlignmentDirective(Alignment.value(), MAI->getTextAlignFillValue(), 1, in emitCodeAlignment()
1586 SMLoc Loc) { in emitValueToOffset() argument
1589 Offset->print(OS, MAI); in emitValueToOffset()
1595 assert(MAI->hasSingleParameterDotFile()); in emitFileDirective()
1605 assert(MAI->hasFourStringsDotFile()); in emitFileDirective()
1652 OS << " md5 0x" << Checksum->digest(); in printDwarfFileDirective()
1677 !MAI->usesDwarfFileAndLocDirectives()) in tryEmitDwarfFileDirective()
1686 TS->emitDwarfFileDirective(OS1.str()); in tryEmitDwarfFileDirective()
1705 // Target doesn't support .loc/.file directives, return early. in emitDwarfFile0Directive()
1706 if (!MAI->usesDwarfFileAndLocDirectives()) in emitDwarfFile0Directive()
1715 TS->emitDwarfFileDirective(OS1.str()); in emitDwarfFile0Directive()
1724 // If target doesn't support .loc/.file directive, we need to record the lines in emitDwarfLocDirective()
1726 if (!MAI->usesDwarfFileAndLocDirectives()) { in emitDwarfLocDirective()
1727 // In case we see two .loc directives in a row, make sure the in emitDwarfLocDirective()
1730 this->MCStreamer::emitDwarfLocDirective(FileNo, Line, Column, Flags, Isa, in emitDwarfLocDirective()
1735 OS << "\t.loc\t" << FileNo << " " << Line << " " << Column; in emitDwarfLocDirective()
1736 if (MAI->supportsExtendedDwarfLocDirective()) { in emitDwarfLocDirective()
1761 OS.PadToColumn(MAI->getCommentColumn()); in emitDwarfLocDirective()
1762 OS << MAI->getCommentString() << ' ' << FileName << ':' in emitDwarfLocDirective()
1766 this->MCStreamer::emitDwarfLocDirective(FileNo, Line, Column, Flags, Isa, in emitDwarfLocDirective()
1808 SMLoc Loc) { in emitCVInlineSiteIdDirective() argument
1812 IALine, IACol, Loc); in emitCVInlineSiteIdDirective()
1818 StringRef FileName, SMLoc Loc) { in emitCVLocDirective() argument
1820 if (!checkCVLocSection(FunctionId, FileNo, Loc)) in emitCVLocDirective()
1832 OS.PadToColumn(MAI->getCommentColumn()); in emitCVLocDirective()
1833 OS << MAI->getCommentString() << ' ' << FileName << ':' << Line << ':' in emitCVLocDirective()
1843 FnStart->print(OS, MAI); in emitCVLinetableDirective()
1845 FnEnd->print(OS, MAI); in emitCVLinetableDirective()
1847 this->MCStreamer::emitCVLinetableDirective(FunctionId, FnStart, FnEnd); in emitCVLinetableDirective()
1857 FnStartSym->print(OS, MAI); in emitCVInlineLinetableDirective()
1859 FnEndSym->print(OS, MAI); in emitCVInlineLinetableDirective()
1861 this->MCStreamer::emitCVInlineLinetableDirective( in emitCVInlineLinetableDirective()
1870 Range.first->print(OS, MAI); in PrintCVDefRangePrefix()
1872 Range.second->print(OS, MAI); in PrintCVDefRangePrefix()
1930 ProcSym->print(OS, MAI); in emitCVFPOData()
1935 assert(MAI->hasIdentDirective() && ".ident directive not supported"); in emitIdent()
1969 if (!MAI->useDwarfRegNumForCFI()) { in EmitRegisterName()
1975 MRI->getLLVMRegNum(Register, true)) { in EmitRegisterName()
1976 InstPrinter->printRegName(OS, *LLVMRegister); in EmitRegisterName()
1983 void MCAsmStreamer::emitCFIDefCfa(int64_t Register, int64_t Offset, SMLoc Loc) { in emitCFIDefCfa() argument
1984 MCStreamer::emitCFIDefCfa(Register, Offset, Loc); in emitCFIDefCfa()
1991 void MCAsmStreamer::emitCFIDefCfaOffset(int64_t Offset, SMLoc Loc) { in emitCFIDefCfaOffset() argument
1992 MCStreamer::emitCFIDefCfaOffset(Offset, Loc); in emitCFIDefCfaOffset()
1998 int64_t AddressSpace, SMLoc Loc) { in emitCFILLVMDefAspaceCfa() argument
1999 MCStreamer::emitCFILLVMDefAspaceCfa(Register, Offset, AddressSpace, Loc); in emitCFILLVMDefAspaceCfa()
2010 size_t e = Values.size() - 1; in PrintCFIEscape()
2017 void MCAsmStreamer::emitCFIEscape(StringRef Values, SMLoc Loc) { in emitCFIEscape() argument
2018 MCStreamer::emitCFIEscape(Values, Loc); in emitCFIEscape()
2023 void MCAsmStreamer::emitCFIGnuArgsSize(int64_t Size, SMLoc Loc) { in emitCFIGnuArgsSize() argument
2024 MCStreamer::emitCFIGnuArgsSize(Size, Loc); in emitCFIGnuArgsSize()
2033 void MCAsmStreamer::emitCFIDefCfaRegister(int64_t Register, SMLoc Loc) { in emitCFIDefCfaRegister() argument
2034 MCStreamer::emitCFIDefCfaRegister(Register, Loc); in emitCFIDefCfaRegister()
2040 void MCAsmStreamer::emitCFIOffset(int64_t Register, int64_t Offset, SMLoc Loc) { in emitCFIOffset() argument
2041 MCStreamer::emitCFIOffset(Register, Offset, Loc); in emitCFIOffset()
2052 Sym->print(OS, MAI); in emitCFIPersonality()
2059 Sym->print(OS, MAI); in emitCFILsda()
2063 void MCAsmStreamer::emitCFIRememberState(SMLoc Loc) { in emitCFIRememberState() argument
2064 MCStreamer::emitCFIRememberState(Loc); in emitCFIRememberState()
2069 void MCAsmStreamer::emitCFIRestoreState(SMLoc Loc) { in emitCFIRestoreState() argument
2070 MCStreamer::emitCFIRestoreState(Loc); in emitCFIRestoreState()
2075 void MCAsmStreamer::emitCFIRestore(int64_t Register, SMLoc Loc) { in emitCFIRestore() argument
2076 MCStreamer::emitCFIRestore(Register, Loc); in emitCFIRestore()
2082 void MCAsmStreamer::emitCFISameValue(int64_t Register, SMLoc Loc) { in emitCFISameValue() argument
2083 MCStreamer::emitCFISameValue(Register, Loc); in emitCFISameValue()
2090 SMLoc Loc) { in emitCFIRelOffset() argument
2091 MCStreamer::emitCFIRelOffset(Register, Offset, Loc); in emitCFIRelOffset()
2098 void MCAsmStreamer::emitCFIAdjustCfaOffset(int64_t Adjustment, SMLoc Loc) { in emitCFIAdjustCfaOffset() argument
2099 MCStreamer::emitCFIAdjustCfaOffset(Adjustment, Loc); in emitCFIAdjustCfaOffset()
2110 void MCAsmStreamer::emitCFIUndefined(int64_t Register, SMLoc Loc) { in emitCFIUndefined() argument
2111 MCStreamer::emitCFIUndefined(Register, Loc); in emitCFIUndefined()
2118 SMLoc Loc) { in emitCFIRegister() argument
2119 MCStreamer::emitCFIRegister(Register1, Register2, Loc); in emitCFIRegister()
2127 void MCAsmStreamer::emitCFIWindowSave(SMLoc Loc) { in emitCFIWindowSave() argument
2128 MCStreamer::emitCFIWindowSave(Loc); in emitCFIWindowSave()
2133 void MCAsmStreamer::emitCFINegateRAState(SMLoc Loc) { in emitCFINegateRAState() argument
2134 MCStreamer::emitCFINegateRAState(Loc); in emitCFINegateRAState()
2146 void MCAsmStreamer::emitCFILabelDirective(SMLoc Loc, StringRef Name) { in emitCFILabelDirective() argument
2147 MCStreamer::emitCFILabelDirective(Loc, Name); in emitCFILabelDirective()
2164 void MCAsmStreamer::emitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc) { in emitWinCFIStartProc() argument
2165 MCStreamer::emitWinCFIStartProc(Symbol, Loc); in emitWinCFIStartProc()
2168 Symbol->print(OS, MAI); in emitWinCFIStartProc()
2172 void MCAsmStreamer::emitWinCFIEndProc(SMLoc Loc) { in emitWinCFIEndProc() argument
2173 MCStreamer::emitWinCFIEndProc(Loc); in emitWinCFIEndProc()
2179 void MCAsmStreamer::emitWinCFIFuncletOrFuncEnd(SMLoc Loc) { in emitWinCFIFuncletOrFuncEnd() argument
2180 MCStreamer::emitWinCFIFuncletOrFuncEnd(Loc); in emitWinCFIFuncletOrFuncEnd()
2186 void MCAsmStreamer::emitWinCFIStartChained(SMLoc Loc) { in emitWinCFIStartChained() argument
2187 MCStreamer::emitWinCFIStartChained(Loc); in emitWinCFIStartChained()
2193 void MCAsmStreamer::emitWinCFIEndChained(SMLoc Loc) { in emitWinCFIEndChained() argument
2194 MCStreamer::emitWinCFIEndChained(Loc); in emitWinCFIEndChained()
2201 bool Except, SMLoc Loc) { in emitWinEHHandler() argument
2202 MCStreamer::emitWinEHHandler(Sym, Unwind, Except, Loc); in emitWinEHHandler()
2205 Sym->print(OS, MAI); in emitWinEHHandler()
2217 void MCAsmStreamer::emitWinEHHandlerData(SMLoc Loc) { in emitWinEHHandlerData() argument
2218 MCStreamer::emitWinEHHandlerData(Loc); in emitWinEHHandlerData()
2231 MCSection *TextSec = &CurFrame->Function->getSection(); in emitWinEHHandlerData()
2239 void MCAsmStreamer::emitWinCFIPushReg(MCRegister Register, SMLoc Loc) { in emitWinCFIPushReg() argument
2240 MCStreamer::emitWinCFIPushReg(Register, Loc); in emitWinCFIPushReg()
2243 InstPrinter->printRegName(OS, Register); in emitWinCFIPushReg()
2248 SMLoc Loc) { in emitWinCFISetFrame() argument
2249 MCStreamer::emitWinCFISetFrame(Register, Offset, Loc); in emitWinCFISetFrame()
2252 InstPrinter->printRegName(OS, Register); in emitWinCFISetFrame()
2257 void MCAsmStreamer::emitWinCFIAllocStack(unsigned Size, SMLoc Loc) { in emitWinCFIAllocStack() argument
2258 MCStreamer::emitWinCFIAllocStack(Size, Loc); in emitWinCFIAllocStack()
2265 SMLoc Loc) { in emitWinCFISaveReg() argument
2266 MCStreamer::emitWinCFISaveReg(Register, Offset, Loc); in emitWinCFISaveReg()
2269 InstPrinter->printRegName(OS, Register); in emitWinCFISaveReg()
2275 SMLoc Loc) { in emitWinCFISaveXMM() argument
2276 MCStreamer::emitWinCFISaveXMM(Register, Offset, Loc); in emitWinCFISaveXMM()
2279 InstPrinter->printRegName(OS, Register); in emitWinCFISaveXMM()
2284 void MCAsmStreamer::emitWinCFIPushFrame(bool Code, SMLoc Loc) { in emitWinCFIPushFrame() argument
2285 MCStreamer::emitWinCFIPushFrame(Code, Loc); in emitWinCFIPushFrame()
2288 if (Code) in emitWinCFIPushFrame()
2289 OS << " @code"; in emitWinCFIPushFrame()
2293 void MCAsmStreamer::emitWinCFIEndProlog(SMLoc Loc) { in emitWinCFIEndProlog() argument
2294 MCStreamer::emitWinCFIEndProlog(Loc); in emitWinCFIEndProlog()
2304 From->getSymbol().print(OS, MAI); in emitCGProfileEntry()
2306 To->getSymbol().print(OS, MAI); in emitCGProfileEntry()
2314 SmallString<256> Code; in AddEncodingComment() local
2317 // If we have no code emitter, don't emit code. in AddEncodingComment()
2321 getAssembler().getEmitter().encodeInstruction(Inst, Code, Fixups, STI); in AddEncodingComment()
2324 // representation. We do this by making a per-bit map to the fixup item index, in AddEncodingComment()
2327 FixupMap.resize(Code.size() * 8); in AddEncodingComment()
2328 for (unsigned i = 0, e = Code.size() * 8; i != e; ++i) in AddEncodingComment()
2337 assert(Index < Code.size() * 8 && "Invalid offset in fixup!"); in AddEncodingComment()
2343 // high order halfword of a 32-bit Thumb2 instruction is emitted first. in AddEncodingComment()
2345 for (unsigned i = 0, e = Code.size(); i != e; ++i) { in AddEncodingComment()
2361 OS << format("0x%02x", uint8_t(Code[i])); in AddEncodingComment()
2363 if (Code[i]) { in AddEncodingComment()
2365 OS << format("0x%02x", uint8_t(Code[i])) << '\'' in AddEncodingComment()
2366 << char('A' + MapEntry - 1) << '\''; in AddEncodingComment()
2368 OS << char('A' + MapEntry - 1); in AddEncodingComment()
2373 for (unsigned j = 8; j--;) { in AddEncodingComment()
2374 unsigned Bit = (Code[i] >> j) & 1; in AddEncodingComment()
2377 if (MAI->isLittleEndian()) in AddEncodingComment()
2380 FixupBit = i * 8 + (7-j); in AddEncodingComment()
2384 OS << char('A' + MapEntry - 1); in AddEncodingComment()
2396 OS << " fixup " << char('A' + i) << " - " in AddEncodingComment()
2398 F.getValue()->print(OS, MAI); in AddEncodingComment()
2408 if (!MAI->usesDwarfFileAndLocDirectives()) in emitInstruction()
2410 // a line entry for any .loc directive that has been seen. in emitInstruction()
2413 // Show the encoding in a comment if we have a code emitter. in emitInstruction()
2423 getTargetStreamer()->prettyPrintAsm(*InstPrinter, 0, Inst, STI, OS); in emitInstruction()
2425 InstPrinter->printInst(&Inst, 0, "", STI, OS); in emitInstruction()
2447 OS << " " << FnSym->getName(); in emitPseudoProbe()
2478 Expr->print(OS, MAI); in emitRelocDirective()
2491 Sym->print(OS, MAI); in emitAddrsigSym()
2495 /// EmitRawText - If this file is backed by an assembly streamer, this dumps
2509 // Now it is time to emit debug line sections if target doesn't support .loc in finishImpl()
2511 if (!MAI->usesDwarfFileAndLocDirectives()) { in finishImpl()
2516 // Emit the label for the line table, if requested - since the rest of the in finishImpl()
2517 // line table will be defined by .loc/.file directives, and not emitted in finishImpl()
2522 if (auto *Label = Tables.begin()->second.getLabel()) { in finishImpl()
2523 switchSection(getContext().getObjectFileInfo()->getDwarfLineSection()); in finishImpl()
2536 if (!MAI->needsDwarfSectionSizeInHeader()) in emitDwarfUnitLength()
2549 if (!MAI->needsDwarfSectionSizeInHeader()) in emitDwarfUnitLength()
2562 if (!MAI->needsDwarfSectionSizeInHeader()) { in emitDwarfLineStartLabel()
2588 assert(!MAI->usesDwarfFileAndLocDirectives() && in emitDwarfLineEndEntry()
2589 ".loc should not be generated together with raw data!"); in emitDwarfLineEndEntry()
2594 // the explicit sections and -ffunction-sections when we try to generate or in emitDwarfLineEndEntry()
2596 MCSection *TextSection = Ctx.getObjectFileInfo()->getTextSection(); in emitDwarfLineEndEntry()
2597 assert(TextSection->hasEnded() && ".text section is not end!"); in emitDwarfLineEndEntry()
2599 MCSymbol *SectionEnd = TextSection->getEndSymbol(Ctx); in emitDwarfLineEndEntry()
2602 AsmInfo->getCodePointerSize()); in emitDwarfLineEndEntry()
2605 // Generate DWARF line sections for assembly mode without .loc/.file
2610 assert(!MAI->usesDwarfFileAndLocDirectives() && in emitDwarfAdvanceLineAddr()
2611 ".loc/.file don't need raw data in debug line section!"); in emitDwarfAdvanceLineAddr()
2614 AddComment("Set address to " + Label->getName()); in emitDwarfAdvanceLineAddr()
2646 // is for a text section if we don't use .loc to represent the debug line. in doFinalizationAtSectionEnd()
2647 if (MAI->usesDwarfFileAndLocDirectives()) in doFinalizationAtSectionEnd()
2652 MCSymbol *Sym = getCurrentSectionOnly()->getEndSymbol(getContext()); in doFinalizationAtSectionEnd()
2654 if (!Sym->isInSection()) in doFinalizationAtSectionEnd()