42 class MCAsmStreamer final :
public MCStreamer {
43 std::unique_ptr<formatted_raw_ostream> OSOwner;
46 std::unique_ptr<MCInstPrinter> InstPrinter;
47 std::unique_ptr<MCCodeEmitter> Emitter;
48 std::unique_ptr<MCAsmBackend> AsmBackend;
54 unsigned IsVerboseAsm : 1;
55 unsigned ShowInst : 1;
56 unsigned UseDwarfDirectory : 1;
58 void EmitRegisterName(int64_t
Register);
64 bool isVerboseAsm,
bool useDwarfDirectory,
67 :
MCStreamer(Context), OSOwner(std::move(os)), OS(*OSOwner),
68 MAI(Context.getAsmInfo()), InstPrinter(printer), Emitter(emitter),
69 AsmBackend(asmbackend), CommentStream(CommentToEmit),
70 IsVerboseAsm(isVerboseAsm), ShowInst(showInst),
71 UseDwarfDirectory(useDwarfDirectory) {
74 InstPrinter->setCommentStream(CommentStream);
77 inline void EmitEOL() {
79 emitExplicitComments();
88 void EmitSyntaxDirective()
override;
90 void EmitCommentsAndEOL();
94 bool isVerboseAsm()
const override {
return IsVerboseAsm; }
97 bool hasRawTextSupport()
const override {
return true; }
103 void AddComment(
const Twine &
T,
bool EOL =
true)
override;
109 bool PrintSchedInfo);
117 return CommentStream;
120 void emitRawComment(
const Twine &
T,
bool TabPrefix =
true)
override;
122 void addExplicitComment(
const Twine &
T)
override;
123 void emitExplicitComments()
override;
126 void AddBlankLine()
override {
142 unsigned Update)
override;
143 void EmitThumbFunc(
MCSymbol *Func)
override;
149 void EmitSymbolDesc(
MCSymbol *Symbol,
unsigned DescValue)
override;
150 void BeginCOFFSymbolDef(
const MCSymbol *Symbol)
override;
151 void EmitCOFFSymbolStorageClass(
int StorageClass)
override;
152 void EmitCOFFSymbolType(
int Type)
override;
153 void EndCOFFSymbolDef()
override;
154 void EmitCOFFSafeSEH(
MCSymbol const *Symbol)
override;
155 void EmitCOFFSectionIndex(
MCSymbol const *Symbol)
override;
156 void EmitCOFFSecRel32(
MCSymbol const *Symbol, uint64_t
Offset)
override;
166 void EmitLocalCommonSymbol(
MCSymbol *Symbol, uint64_t
Size,
175 void EmitBinaryData(
StringRef Data)
override;
181 void EmitIntValue(uint64_t Value,
unsigned Size)
override;
183 void EmitULEB128Value(
const MCExpr *Value)
override;
185 void EmitSLEB128Value(
const MCExpr *Value)
override;
187 void EmitDTPRel32Value(
const MCExpr *Value)
override;
188 void EmitDTPRel64Value(
const MCExpr *Value)
override;
189 void EmitTPRel32Value(
const MCExpr *Value)
override;
190 void EmitTPRel64Value(
const MCExpr *Value)
override;
192 void EmitGPRel64Value(
const MCExpr *Value)
override;
194 void EmitGPRel32Value(
const MCExpr *Value)
override;
197 void emitFill(uint64_t NumBytes, uint8_t FillValue)
override;
199 void emitFill(
const MCExpr &NumBytes, uint64_t FillValue,
202 void emitFill(uint64_t NumValues, int64_t Size, int64_t Expr)
override;
204 void emitFill(
const MCExpr &NumValues, int64_t Size, int64_t Expr,
207 void EmitValueToAlignment(
unsigned ByteAlignment, int64_t Value = 0,
208 unsigned ValueSize = 1,
209 unsigned MaxBytesToEmit = 0)
override;
212 unsigned MaxBytesToEmit = 0)
override;
218 void EmitFileDirective(
StringRef Filename)
override;
219 unsigned EmitDwarfFileDirective(
unsigned FileNo,
StringRef Directory,
221 unsigned CUID = 0)
override;
222 void EmitDwarfLocDirective(
unsigned FileNo,
unsigned Line,
223 unsigned Column,
unsigned Flags,
224 unsigned Isa,
unsigned Discriminator,
226 MCSymbol *getDwarfLineTableSymbol(
unsigned CUID)
override;
228 bool EmitCVFileDirective(
unsigned FileNo,
StringRef Filename)
override;
229 bool EmitCVFuncIdDirective(
unsigned FuncId)
override;
230 bool EmitCVInlineSiteIdDirective(
unsigned FunctionId,
unsigned IAFunc,
231 unsigned IAFile,
unsigned IALine,
232 unsigned IACol,
SMLoc Loc)
override;
233 void EmitCVLocDirective(
unsigned FunctionId,
unsigned FileNo,
unsigned Line,
234 unsigned Column,
bool PrologueEnd,
bool IsStmt,
236 void EmitCVLinetableDirective(
unsigned FunctionId,
const MCSymbol *FnStart,
238 void EmitCVInlineLinetableDirective(
unsigned PrimaryFunctionId,
239 unsigned SourceFileId,
240 unsigned SourceLineNum,
243 void EmitCVDefRangeDirective(
244 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
246 void EmitCVStringTableDirective()
override;
247 void EmitCVFileChecksumsDirective()
override;
249 void EmitIdent(
StringRef IdentString)
override;
250 void EmitCFISections(
bool EH,
bool Debug)
override;
252 void EmitCFIDefCfaOffset(int64_t
Offset)
override;
253 void EmitCFIDefCfaRegister(int64_t
Register)
override;
255 void EmitCFIPersonality(
const MCSymbol *Sym,
unsigned Encoding)
override;
256 void EmitCFILsda(
const MCSymbol *Sym,
unsigned Encoding)
override;
257 void EmitCFIRememberState()
override;
258 void EmitCFIRestoreState()
override;
259 void EmitCFISameValue(int64_t
Register)
override;
261 void EmitCFIAdjustCfaOffset(int64_t Adjustment)
override;
262 void EmitCFIEscape(
StringRef Values)
override;
263 void EmitCFIGnuArgsSize(int64_t Size)
override;
264 void EmitCFISignalFrame()
override;
265 void EmitCFIUndefined(int64_t
Register)
override;
266 void EmitCFIRegister(int64_t Register1, int64_t Register2)
override;
267 void EmitCFIWindowSave()
override;
269 void EmitWinCFIStartProc(
const MCSymbol *Symbol)
override;
270 void EmitWinCFIEndProc()
override;
271 void EmitWinCFIStartChained()
override;
272 void EmitWinCFIEndChained()
override;
273 void EmitWinCFIPushReg(
unsigned Register)
override;
274 void EmitWinCFISetFrame(
unsigned Register,
unsigned Offset)
override;
275 void EmitWinCFIAllocStack(
unsigned Size)
override;
276 void EmitWinCFISaveReg(
unsigned Register,
unsigned Offset)
override;
277 void EmitWinCFISaveXMM(
unsigned Register,
unsigned Offset)
override;
278 void EmitWinCFIPushFrame(
bool Code)
override;
279 void EmitWinCFIEndProlog()
override;
281 void EmitWinEHHandler(
const MCSymbol *Sym,
bool Unwind,
bool Except)
override;
282 void EmitWinEHHandlerData()
override;
285 bool PrintSchedInfo)
override;
287 void EmitBundleAlignMode(
unsigned AlignPow2)
override;
288 void EmitBundleLock(
bool AlignToEnd)
override;
289 void EmitBundleUnlock()
override;
299 void FinishImpl()
override;
309 void MCAsmStreamer::AddComment(
const Twine &
T,
bool EOL) {
310 if (!IsVerboseAsm)
return;
315 CommentToEmit.push_back(
'\n');
318 void MCAsmStreamer::EmitCommentsAndEOL() {
319 if (CommentToEmit.empty() && CommentStream.GetNumBytesInBuffer() == 0) {
327 "Comment array not newline terminated");
330 OS.PadToColumn(MAI->getCommentColumn());
331 size_t Position = Comments.
find(
'\n');
332 OS << MAI->getCommentString() <<
' ' << Comments.
substr(0, Position) <<
'\n';
334 Comments = Comments.
substr(Position+1);
335 }
while (!Comments.
empty());
337 CommentToEmit.clear();
341 assert(Bytes > 0 && Bytes <= 8 &&
"Invalid size!");
342 return Value & ((uint64_t) (int64_t) -1 >> (64 - Bytes * 8));
345 void MCAsmStreamer::emitRawComment(
const Twine &T,
bool TabPrefix) {
348 OS << MAI->getCommentString() <<
T;
352 void MCAsmStreamer::addExplicitComment(
const Twine &T) {
357 ExplicitCommentToEmit.append(
"\t");
358 ExplicitCommentToEmit.append(MAI->getCommentString());
360 ExplicitCommentToEmit.append(c.
slice(2, c.
size()).str());
362 size_t p = 2, len = c.
size() - 2;
366 ExplicitCommentToEmit.append(
"\t");
367 ExplicitCommentToEmit.append(MAI->getCommentString());
368 ExplicitCommentToEmit.append(c.
slice(p, newp).
str());
371 ExplicitCommentToEmit.append(
"\n");
375 ExplicitCommentToEmit.append(
"\t");
376 ExplicitCommentToEmit.append(c.
str());
377 }
else if (c.
front() ==
'#') {
379 ExplicitCommentToEmit.append(
"\t");
380 ExplicitCommentToEmit.append(MAI->getCommentString());
381 ExplicitCommentToEmit.append(c.
slice(1, c.
size()).str());
383 assert(
false &&
"Unexpected Assembly Comment");
385 if (c.
back() ==
'\n')
386 emitExplicitComments();
389 void MCAsmStreamer::emitExplicitComments() {
390 StringRef Comments = ExplicitCommentToEmit;
391 if (!Comments.
empty())
393 ExplicitCommentToEmit.clear();
397 const MCExpr *Subsection) {
398 assert(Section &&
"Cannot switch to a null section!");
400 *MAI, getContext().getObjectFileInfo()->getTargetTriple(), OS,
407 Symbol->
print(OS, MAI);
408 OS << MAI->getLabelSuffix();
418 assert(NbArgs != -1 && ((
size_t)NbArgs) == Args.
size() &&
"Malformed LOH!");
419 assert(str !=
"" &&
"Invalid LOH name");
437 case MCAF_Code16: OS <<
'\t'<< MAI->getCode16Directive();
break;
438 case MCAF_Code32: OS <<
'\t'<< MAI->getCode32Directive();
break;
439 case MCAF_Code64: OS <<
'\t'<< MAI->getCode64Directive();
break;
445 assert(!Options.
empty() &&
"At least one option is required!");
446 OS <<
"\t.linker_option \"" << Options[0] <<
'"';
448 ie = Options.end(); it != ie; ++it) {
449 OS <<
", " <<
'"' << *it <<
'"';
455 if (!MAI->doesSupportDataRegionDirectives())
468 unsigned Minor,
unsigned Update) {
475 OS <<
" " << Major <<
", " << Minor;
477 OS <<
", " << Update;
481 void MCAsmStreamer::EmitThumbFunc(
MCSymbol *Func) {
484 OS <<
"\t.thumb_func";
486 if (MAI->hasSubsectionsViaSymbols()) {
488 Func->
print(OS, MAI);
493 void MCAsmStreamer::EmitAssignment(
MCSymbol *Symbol,
const MCExpr *Value) {
494 Symbol->
print(OS, MAI);
496 Value->
print(OS, MAI);
503 void MCAsmStreamer::EmitWeakReference(
MCSymbol *Alias,
const MCSymbol *Symbol) {
505 Alias->
print(OS, MAI);
507 Symbol->
print(OS, MAI);
511 bool MCAsmStreamer::EmitSymbolAttribute(
MCSymbol *Symbol,
522 if (!MAI->hasDotTypeDotSizeDirective())
525 Symbol->
print(OS, MAI);
526 OS <<
',' << ((MAI->getCommentString()[0] !=
'@') ?
'@' :
'%');
528 default:
return false;
540 OS << MAI->getGlobalDirective();
548 if (!MAI->hasNoDeadStrip())
550 OS <<
"\t.no_dead_strip\t";
555 OS <<
"\t.private_extern\t";
559 case MCSA_Weak: OS << MAI->getWeakDirective();
break;
561 OS <<
"\t.weak_definition\t";
568 Symbol->
print(OS, MAI);
574 void MCAsmStreamer::EmitSymbolDesc(
MCSymbol *Symbol,
unsigned DescValue) {
575 OS <<
".desc" <<
' ';
576 Symbol->
print(OS, MAI);
577 OS <<
',' << DescValue;
581 void MCAsmStreamer::EmitSyntaxDirective() {
582 if (MAI->getAssemblerDialect() == 1) {
583 OS <<
"\t.intel_syntax noprefix";
591 void MCAsmStreamer::BeginCOFFSymbolDef(
const MCSymbol *Symbol) {
593 Symbol->
print(OS, MAI);
598 void MCAsmStreamer::EmitCOFFSymbolStorageClass (
int StorageClass) {
599 OS <<
"\t.scl\t" << StorageClass <<
';';
603 void MCAsmStreamer::EmitCOFFSymbolType (
int Type) {
604 OS <<
"\t.type\t" << Type <<
';';
608 void MCAsmStreamer::EndCOFFSymbolDef() {
613 void MCAsmStreamer::EmitCOFFSafeSEH(
MCSymbol const *Symbol) {
614 OS <<
"\t.safeseh\t";
615 Symbol->
print(OS, MAI);
619 void MCAsmStreamer::EmitCOFFSectionIndex(
MCSymbol const *Symbol) {
621 Symbol->
print(OS, MAI);
625 void MCAsmStreamer::EmitCOFFSecRel32(
MCSymbol const *Symbol, uint64_t
Offset) {
626 OS <<
"\t.secrel32\t";
627 Symbol->
print(OS, MAI);
633 void MCAsmStreamer::emitELFSize(
MCSymbol *Symbol,
const MCExpr *Value) {
634 assert(MAI->hasDotTypeDotSizeDirective());
636 Symbol->
print(OS, MAI);
638 Value->
print(OS, MAI);
642 void MCAsmStreamer::EmitCommonSymbol(
MCSymbol *Symbol, uint64_t Size,
645 Symbol->
print(OS, MAI);
648 if (ByteAlignment != 0) {
649 if (MAI->getCOMMDirectiveAlignmentIsInBytes())
650 OS <<
',' << ByteAlignment;
652 OS <<
',' <<
Log2_32(ByteAlignment);
661 void MCAsmStreamer::EmitLocalCommonSymbol(
MCSymbol *Symbol, uint64_t Size,
662 unsigned ByteAlign) {
664 Symbol->
print(OS, MAI);
668 switch (MAI->getLCOMMDirectiveAlignmentType()) {
672 OS <<
',' << ByteAlign;
676 OS <<
',' <<
Log2_32(ByteAlign);
684 uint64_t Size,
unsigned ByteAlignment) {
697 Symbol->
print(OS, MAI);
699 if (ByteAlignment != 0)
700 OS <<
',' <<
Log2_32(ByteAlignment);
709 uint64_t Size,
unsigned ByteAlignment) {
712 assert(Symbol &&
"Symbol shouldn't be NULL!");
716 Symbol->
print(OS, MAI);
721 if (ByteAlignment > 1) OS <<
", " <<
Log2_32(ByteAlignment);
726 static inline char toOctal(
int X) {
return (X&7)+
'0'; }
731 for (
unsigned i = 0, e = Data.
size(); i != e; ++i) {
732 unsigned char C = Data[i];
733 if (C ==
'"' || C ==
'\\') {
734 OS <<
'\\' << (
char)C;
738 if (isprint((
unsigned char)
C)) {
744 case '\b': OS <<
"\\b";
break;
745 case '\f': OS <<
"\\f";
break;
746 case '\n': OS <<
"\\n";
break;
747 case '\r': OS <<
"\\r";
break;
748 case '\t': OS <<
"\\t";
break;
751 OS << toOctal(C >> 6);
752 OS << toOctal(C >> 3);
753 OS << toOctal(C >> 0);
762 assert(getCurrentSectionOnly() &&
763 "Cannot emit contents before setting section!");
764 if (Data.
empty())
return;
766 if (Data.
size() == 1) {
767 OS << MAI->getData8bitsDirective();
768 OS << (
unsigned)(
unsigned char)Data[0];
775 if (MAI->getAscizDirective() && Data.
back() == 0) {
776 OS << MAI->getAscizDirective();
779 OS << MAI->getAsciiDirective();
786 void MCAsmStreamer::EmitBinaryData(
StringRef Data) {
788 const size_t Cols = 4;
789 for (
size_t I = 0, EI =
alignTo(Data.
size(), Cols);
I < EI;
I += Cols) {
792 OS << MAI->getData8bitsDirective();
793 for (; J < EJ - 1; ++J)
794 OS <<
format(
"0x%02x", uint8_t(Data[J])) <<
", ";
795 OS <<
format(
"0x%02x", uint8_t(Data[J]));
800 void MCAsmStreamer::EmitIntValue(uint64_t Value,
unsigned Size) {
804 void MCAsmStreamer::EmitValueImpl(
const MCExpr *Value,
unsigned Size,
806 assert(Size <= 8 &&
"Invalid size");
807 assert(getCurrentSectionOnly() &&
808 "Cannot emit contents before setting section!");
809 const char *Directive =
nullptr;
812 case 1: Directive = MAI->getData8bitsDirective();
break;
813 case 2: Directive = MAI->getData16bitsDirective();
break;
814 case 4: Directive = MAI->getData32bitsDirective();
break;
815 case 8: Directive = MAI->getData64bitsDirective();
break;
820 if (!Value->evaluateAsAbsolute(IntValue))
827 bool IsLittleEndian = MAI->isLittleEndian();
828 for (
unsigned Emitted = 0; Emitted !=
Size;) {
829 unsigned Remaining = Size - Emitted;
835 unsigned ByteOffset =
836 IsLittleEndian ? Emitted : (Remaining - EmissionSize);
837 uint64_t ValueToEmit = IntValue >> (ByteOffset * 8);
841 uint64_t Shift = 64 - EmissionSize * 8;
842 assert(Shift < static_cast<uint64_t>(
843 std::numeric_limits<unsigned long long>::digits) &&
844 "undefined behavior");
845 ValueToEmit &= ~0ULL >> Shift;
846 EmitIntValue(ValueToEmit, EmissionSize);
847 Emitted += EmissionSize;
852 assert(Directive &&
"Invalid size for machine code value!");
854 Value->
print(OS, MAI);
858 void MCAsmStreamer::EmitULEB128Value(
const MCExpr *Value) {
860 if (Value->evaluateAsAbsolute(IntValue)) {
861 EmitULEB128IntValue(IntValue);
865 Value->
print(OS, MAI);
869 void MCAsmStreamer::EmitSLEB128Value(
const MCExpr *Value) {
871 if (Value->evaluateAsAbsolute(IntValue)) {
872 EmitSLEB128IntValue(IntValue);
876 Value->
print(OS, MAI);
880 void MCAsmStreamer::EmitDTPRel64Value(
const MCExpr *Value) {
881 assert(MAI->getDTPRel64Directive() !=
nullptr);
882 OS << MAI->getDTPRel64Directive();
883 Value->
print(OS, MAI);
887 void MCAsmStreamer::EmitDTPRel32Value(
const MCExpr *Value) {
888 assert(MAI->getDTPRel32Directive() !=
nullptr);
889 OS << MAI->getDTPRel32Directive();
890 Value->
print(OS, MAI);
894 void MCAsmStreamer::EmitTPRel64Value(
const MCExpr *Value) {
895 assert(MAI->getTPRel64Directive() !=
nullptr);
896 OS << MAI->getTPRel64Directive();
897 Value->
print(OS, MAI);
901 void MCAsmStreamer::EmitTPRel32Value(
const MCExpr *Value) {
902 assert(MAI->getTPRel32Directive() !=
nullptr);
903 OS << MAI->getTPRel32Directive();
904 Value->
print(OS, MAI);
908 void MCAsmStreamer::EmitGPRel64Value(
const MCExpr *Value) {
909 assert(MAI->getGPRel64Directive() !=
nullptr);
910 OS << MAI->getGPRel64Directive();
911 Value->
print(OS, MAI);
915 void MCAsmStreamer::EmitGPRel32Value(
const MCExpr *Value) {
916 assert(MAI->getGPRel32Directive() !=
nullptr);
917 OS << MAI->getGPRel32Directive();
918 Value->
print(OS, MAI);
924 void MCAsmStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) {
925 if (NumBytes == 0)
return;
928 emitFill(*E, FillValue);
931 void MCAsmStreamer::emitFill(
const MCExpr &NumBytes, uint64_t FillValue,
933 if (
const char *ZeroDirective = MAI->getZeroDirective()) {
936 NumBytes.
print(OS, MAI);
938 OS <<
',' << (int)FillValue;
946 void MCAsmStreamer::emitFill(uint64_t NumValues, int64_t Size, int64_t Expr) {
951 emitFill(*E, Size, Expr);
954 void MCAsmStreamer::emitFill(
const MCExpr &NumValues, int64_t Size,
955 int64_t Expr,
SMLoc Loc) {
958 NumValues.
print(OS, MAI);
959 OS <<
", " << Size <<
", 0x";
964 void MCAsmStreamer::EmitValueToAlignment(
unsigned ByteAlignment, int64_t Value,
966 unsigned MaxBytesToEmit) {
974 OS <<
"\t.p2align\t";
988 if (Value || MaxBytesToEmit) {
993 OS <<
", " << MaxBytesToEmit;
1001 switch (ValueSize) {
1003 case 1: OS <<
".balign";
break;
1004 case 2: OS <<
".balignw";
break;
1005 case 4: OS <<
".balignl";
break;
1012 OS <<
", " << MaxBytesToEmit;
1016 void MCAsmStreamer::EmitCodeAlignment(
unsigned ByteAlignment,
1017 unsigned MaxBytesToEmit) {
1019 EmitValueToAlignment(ByteAlignment, MAI->getTextAlignFillValue(),
1023 void MCAsmStreamer::emitValueToOffset(
const MCExpr *Offset,
1024 unsigned char Value,
1028 Offset->
print(OS, MAI);
1033 void MCAsmStreamer::EmitFileDirective(
StringRef Filename) {
1034 assert(MAI->hasSingleParameterDotFile());
1040 unsigned MCAsmStreamer::EmitDwarfFileDirective(
unsigned FileNo,
1048 FileNo = Table.
getFile(Directory, Filename, FileNo);
1056 if (!UseDwarfDirectory && !Directory.
empty()) {
1060 FullPathName = Directory;
1063 Filename = FullPathName;
1067 OS <<
"\t.file\t" << FileNo <<
' ';
1068 if (!Directory.
empty()) {
1078 void MCAsmStreamer::EmitDwarfLocDirective(
unsigned FileNo,
unsigned Line,
1079 unsigned Column,
unsigned Flags,
1081 unsigned Discriminator,
1083 OS <<
"\t.loc\t" << FileNo <<
" " << Line <<
" " << Column;
1085 OS <<
" basic_block";
1087 OS <<
" prologue_end";
1089 OS <<
" epilogue_begin";
1091 unsigned OldFlags = getContext().getCurrentDwarfLoc().getFlags();
1095 if (Flags & DWARF2_FLAG_IS_STMT)
1102 OS <<
" isa " << Isa;
1104 OS <<
" discriminator " << Discriminator;
1107 OS.PadToColumn(MAI->getCommentColumn());
1108 OS << MAI->getCommentString() <<
' ' << FileName <<
':'
1109 << Line <<
':' << Column;
1113 Isa, Discriminator, FileName);
1116 MCSymbol *MCAsmStreamer::getDwarfLineTableSymbol(
unsigned CUID) {
1122 bool MCAsmStreamer::EmitCVFileDirective(
unsigned FileNo,
StringRef Filename) {
1123 if (!getContext().getCVContext().addFile(FileNo, Filename))
1126 OS <<
"\t.cv_file\t" << FileNo <<
' ';
1133 bool MCAsmStreamer::EmitCVFuncIdDirective(
unsigned FuncId) {
1134 OS <<
"\t.cv_func_id " << FuncId <<
'\n';
1138 bool MCAsmStreamer::EmitCVInlineSiteIdDirective(
unsigned FunctionId,
1141 unsigned IALine,
unsigned IACol,
1143 OS <<
"\t.cv_inline_site_id " << FunctionId <<
" within " << IAFunc
1144 <<
" inlined_at " << IAFile <<
' ' << IALine <<
' ' << IACol <<
'\n';
1146 IALine, IACol, Loc);
1149 void MCAsmStreamer::EmitCVLocDirective(
unsigned FunctionId,
unsigned FileNo,
1150 unsigned Line,
unsigned Column,
1151 bool PrologueEnd,
bool IsStmt,
1153 OS <<
"\t.cv_loc\t" << FunctionId <<
" " << FileNo <<
" " << Line <<
" "
1156 OS <<
" prologue_end";
1158 unsigned OldIsStmt = getContext().getCVContext().getCurrentCVLoc().isStmt();
1159 if (IsStmt != OldIsStmt) {
1169 OS.PadToColumn(MAI->getCommentColumn());
1170 OS << MAI->getCommentString() <<
' ' << FileName <<
':' << Line <<
':'
1175 PrologueEnd, IsStmt, FileName, Loc);
1178 void MCAsmStreamer::EmitCVLinetableDirective(
unsigned FunctionId,
1181 OS <<
"\t.cv_linetable\t" << FunctionId <<
", ";
1182 FnStart->
print(OS, MAI);
1184 FnEnd->
print(OS, MAI);
1189 void MCAsmStreamer::EmitCVInlineLinetableDirective(
unsigned PrimaryFunctionId,
1190 unsigned SourceFileId,
1191 unsigned SourceLineNum,
1194 OS <<
"\t.cv_inline_linetable\t" << PrimaryFunctionId <<
' ' << SourceFileId
1195 <<
' ' << SourceLineNum <<
' ';
1196 FnStartSym->
print(OS, MAI);
1198 FnEndSym->
print(OS, MAI);
1201 PrimaryFunctionId, SourceFileId, SourceLineNum, FnStartSym, FnEndSym);
1204 void MCAsmStreamer::EmitCVDefRangeDirective(
1205 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
1207 OS <<
"\t.cv_def_range\t";
1208 for (std::pair<const MCSymbol *, const MCSymbol *> Range : Ranges) {
1210 Range.first->print(OS, MAI);
1212 Range.second->print(OS, MAI);
1220 void MCAsmStreamer::EmitCVStringTableDirective() {
1221 OS <<
"\t.cv_stringtable";
1225 void MCAsmStreamer::EmitCVFileChecksumsDirective() {
1226 OS <<
"\t.cv_filechecksums";
1230 void MCAsmStreamer::EmitIdent(
StringRef IdentString) {
1231 assert(MAI->hasIdentDirective() &&
".ident directive not supported");
1237 void MCAsmStreamer::EmitCFISections(
bool EH,
bool Debug) {
1239 OS <<
"\t.cfi_sections ";
1243 OS <<
", .debug_frame";
1245 OS <<
".debug_frame";
1252 OS <<
"\t.cfi_startproc";
1260 OS <<
"\t.cfi_endproc";
1264 void MCAsmStreamer::EmitRegisterName(int64_t
Register) {
1265 if (!MAI->useDwarfRegNumForCFI()) {
1268 InstPrinter->printRegName(OS, LLVMRegister);
1274 void MCAsmStreamer::EmitCFIDefCfa(int64_t Register, int64_t Offset) {
1276 OS <<
"\t.cfi_def_cfa ";
1277 EmitRegisterName(Register);
1282 void MCAsmStreamer::EmitCFIDefCfaOffset(int64_t Offset) {
1284 OS <<
"\t.cfi_def_cfa_offset " <<
Offset;
1289 OS <<
"\t.cfi_escape ";
1290 if (!Values.
empty()) {
1291 size_t e = Values.
size() - 1;
1292 for (
size_t i = 0; i < e; ++i)
1293 OS <<
format(
"0x%02x", uint8_t(Values[i])) <<
", ";
1294 OS <<
format(
"0x%02x", uint8_t(Values[e]));
1298 void MCAsmStreamer::EmitCFIEscape(
StringRef Values) {
1304 void MCAsmStreamer::EmitCFIGnuArgsSize(int64_t Size) {
1307 uint8_t Buffer[16] = { dwarf::DW_CFA_GNU_args_size };
1314 void MCAsmStreamer::EmitCFIDefCfaRegister(int64_t Register) {
1316 OS <<
"\t.cfi_def_cfa_register ";
1317 EmitRegisterName(Register);
1321 void MCAsmStreamer::EmitCFIOffset(int64_t Register, int64_t Offset) {
1323 OS <<
"\t.cfi_offset ";
1324 EmitRegisterName(Register);
1329 void MCAsmStreamer::EmitCFIPersonality(
const MCSymbol *Sym,
1330 unsigned Encoding) {
1332 OS <<
"\t.cfi_personality " << Encoding <<
", ";
1333 Sym->
print(OS, MAI);
1337 void MCAsmStreamer::EmitCFILsda(
const MCSymbol *Sym,
unsigned Encoding) {
1339 OS <<
"\t.cfi_lsda " << Encoding <<
", ";
1340 Sym->
print(OS, MAI);
1344 void MCAsmStreamer::EmitCFIRememberState() {
1346 OS <<
"\t.cfi_remember_state";
1350 void MCAsmStreamer::EmitCFIRestoreState() {
1352 OS <<
"\t.cfi_restore_state";
1356 void MCAsmStreamer::EmitCFISameValue(int64_t Register) {
1358 OS <<
"\t.cfi_same_value ";
1359 EmitRegisterName(Register);
1363 void MCAsmStreamer::EmitCFIRelOffset(int64_t Register, int64_t Offset) {
1365 OS <<
"\t.cfi_rel_offset ";
1366 EmitRegisterName(Register);
1371 void MCAsmStreamer::EmitCFIAdjustCfaOffset(int64_t Adjustment) {
1373 OS <<
"\t.cfi_adjust_cfa_offset " << Adjustment;
1377 void MCAsmStreamer::EmitCFISignalFrame() {
1379 OS <<
"\t.cfi_signal_frame";
1383 void MCAsmStreamer::EmitCFIUndefined(int64_t Register) {
1385 OS <<
"\t.cfi_undefined " <<
Register;
1389 void MCAsmStreamer::EmitCFIRegister(int64_t Register1, int64_t Register2) {
1391 OS <<
"\t.cfi_register " << Register1 <<
", " << Register2;
1395 void MCAsmStreamer::EmitCFIWindowSave() {
1397 OS <<
"\t.cfi_window_save";
1401 void MCAsmStreamer::EmitWinCFIStartProc(
const MCSymbol *Symbol) {
1405 Symbol->
print(OS, MAI);
1409 void MCAsmStreamer::EmitWinCFIEndProc() {
1412 OS <<
"\t.seh_endproc";
1416 void MCAsmStreamer::EmitWinCFIStartChained() {
1419 OS <<
"\t.seh_startchained";
1423 void MCAsmStreamer::EmitWinCFIEndChained() {
1426 OS <<
"\t.seh_endchained";
1430 void MCAsmStreamer::EmitWinEHHandler(
const MCSymbol *Sym,
bool Unwind,
1434 OS <<
"\t.seh_handler ";
1435 Sym->
print(OS, MAI);
1443 void MCAsmStreamer::EmitWinEHHandlerData() {
1452 MCSection *XData = getAssociatedXDataSection(TextSec);
1453 SwitchSectionNoChange(XData);
1455 OS <<
"\t.seh_handlerdata";
1459 void MCAsmStreamer::EmitWinCFIPushReg(
unsigned Register) {
1462 OS <<
"\t.seh_pushreg " <<
Register;
1466 void MCAsmStreamer::EmitWinCFISetFrame(
unsigned Register,
unsigned Offset) {
1469 OS <<
"\t.seh_setframe " << Register <<
", " <<
Offset;
1473 void MCAsmStreamer::EmitWinCFIAllocStack(
unsigned Size) {
1476 OS <<
"\t.seh_stackalloc " <<
Size;
1480 void MCAsmStreamer::EmitWinCFISaveReg(
unsigned Register,
unsigned Offset) {
1483 OS <<
"\t.seh_savereg " << Register <<
", " <<
Offset;
1487 void MCAsmStreamer::EmitWinCFISaveXMM(
unsigned Register,
unsigned Offset) {
1490 OS <<
"\t.seh_savexmm " << Register <<
", " <<
Offset;
1494 void MCAsmStreamer::EmitWinCFIPushFrame(
bool Code) {
1497 OS <<
"\t.seh_pushframe";
1503 void MCAsmStreamer::EmitWinCFIEndProlog() {
1506 OS <<
"\t.seh_endprologue";
1510 void MCAsmStreamer::AddEncodingComment(
const MCInst &Inst,
1512 bool PrintSchedInfo) {
1517 Emitter->encodeInstruction(Inst, VecOS, Fixups, STI);
1524 for (
unsigned i = 0, e = Code.
size() * 8; i != e; ++i)
1527 for (
unsigned i = 0, e = Fixups.
size(); i != e; ++i) {
1530 for (
unsigned j = 0; j != Info.
TargetSize; ++j) {
1532 assert(Index < Code.
size() * 8 &&
"Invalid offset in fixup!");
1533 FixupMap[Index] = 1 + i;
1539 OS <<
"encoding: [";
1540 for (
unsigned i = 0, e = Code.
size(); i != e; ++i) {
1545 uint8_t MapEntry = FixupMap[i * 8 + 0];
1546 for (
unsigned j = 1; j != 8; ++j) {
1547 if (FixupMap[i * 8 + j] == MapEntry)
1550 MapEntry = uint8_t(~0U);
1554 if (MapEntry != uint8_t(~0U)) {
1555 if (MapEntry == 0) {
1556 OS <<
format(
"0x%02x", uint8_t(Code[i]));
1560 OS <<
format(
"0x%02x", uint8_t(Code[i])) <<
'\''
1561 <<
char(
'A' + MapEntry - 1) <<
'\'';
1563 OS <<
char(
'A' + MapEntry - 1);
1568 for (
unsigned j = 8; j--;) {
1569 unsigned Bit = (Code[i] >> j) & 1;
1572 if (MAI->isLittleEndian())
1573 FixupBit = i * 8 + j;
1575 FixupBit = i * 8 + (7-j);
1577 if (uint8_t MapEntry = FixupMap[FixupBit]) {
1578 assert(Bit == 0 &&
"Encoder wrote into fixed up bit!");
1579 OS <<
char(
'A' + MapEntry - 1);
1588 if (Fixups.
size() || !PrintSchedInfo)
1591 for (
unsigned i = 0, e = Fixups.
size(); i != e; ++i) {
1594 OS <<
" fixup " <<
char(
'A' + i) <<
" - " <<
"offset: " << F.
getOffset()
1595 <<
", value: " << *F.
getValue() <<
", kind: " << Info.
Name <<
"\n";
1599 void MCAsmStreamer::EmitInstruction(
const MCInst &Inst,
1601 bool PrintSchedInfo) {
1602 assert(getCurrentSectionOnly() &&
1603 "Cannot emit contents before setting section!");
1607 AddEncodingComment(Inst, STI, PrintSchedInfo);
1612 GetCommentOS() <<
"\n";
1613 Inst.
dump_pretty(GetCommentOS(), InstPrinter.get(),
"\n ");
1614 GetCommentOS() <<
"\n";
1617 if(getTargetStreamer())
1618 getTargetStreamer()->prettyPrintAsm(*InstPrinter, OS, Inst, STI);
1620 InstPrinter->printInst(&Inst, OS,
"", STI);
1622 if (PrintSchedInfo) {
1625 GetCommentOS() << SI;
1629 if (Comments.
size() && Comments.
back() !=
'\n')
1630 GetCommentOS() <<
"\n";
1635 void MCAsmStreamer::EmitBundleAlignMode(
unsigned AlignPow2) {
1636 OS <<
"\t.bundle_align_mode " << AlignPow2;
1640 void MCAsmStreamer::EmitBundleLock(
bool AlignToEnd) {
1641 OS <<
"\t.bundle_lock";
1643 OS <<
" align_to_end";
1647 void MCAsmStreamer::EmitBundleUnlock() {
1648 OS <<
"\t.bundle_unlock";
1655 Offset.
print(OS, MAI);
1659 Expr->
print(OS, MAI);
1669 if (!String.
empty() && String.
back() ==
'\n')
1675 void MCAsmStreamer::FinishImpl() {
1677 if (getContext().getGenDwarfForAssembly())
1683 auto &Tables = getContext().getMCDwarfLineTables();
1684 if (!Tables.empty()) {
1685 assert(Tables.size() == 1 &&
"asm output only supports one line table");
1686 if (
auto *Label = Tables.begin()->second.getLabel()) {
1687 SwitchSection(getContext().getObjectFileInfo()->getDwarfLineSection());
1694 std::unique_ptr<formatted_raw_ostream> OS,
1695 bool isVerboseAsm,
bool useDwarfDirectory,
1698 return new MCAsmStreamer(Context, std::move(OS), isVerboseAsm,
1699 useDwarfDirectory, IP, CE, MAB, ShowInst);
void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName)
This implements the DWARF2 '.loc fileno lineno ...' assembler directive.
Instances of this class represent a uniqued identifier for a section in the current translation unit...
virtual void EmitCFISameValue(int64_t Register)
virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding)
This represents a section on a Mach-O system (used by Mac OS X).
virtual void EmitCFIGnuArgsSize(int64_t Size)
#define DWARF2_FLAG_PROLOGUE_END
virtual void EmitWinCFIEndProlog()
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
.type _foo, STT_OBJECT # aka
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
const MCDummyFragment & getDummyFragment() const
A raw_ostream that writes to an SmallVector or SmallString.
virtual void EmitCFIRegister(int64_t Register1, int64_t Register2)
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
virtual void EmitCFIDefCfaOffset(int64_t Offset)
LLVM_NODISCARD char back() const
back - Get the last character in the string.
.type _foo, STT_NOTYPE # aka
virtual MCSymbol * getDwarfLineTableSymbol(unsigned CUID)
COFF::SymbolStorageClass StorageClass
void dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer=nullptr, StringRef Separator=" ") const
Dump the MCInst as prettily as possible using the additional MC structures, if given.
unsigned TargetOffset
The bit offset to write the relocation into.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
virtual void EmitCFISections(bool EH, bool Debug)
static int64_t truncateToSize(int64_t Value, unsigned Bytes)
virtual void EmitWinEHHandlerData()
virtual void EmitCFIRememberState()
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding)
#define DWARF2_FLAG_IS_STMT
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
virtual void EmitCFIEscape(StringRef Values)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Base class for the full range of assembler expressions which are needed for parsing.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
const char * Name
A target specific name for the fixup kind.
virtual void EmitCVLocDirective(unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc)
This implements the CodeView '.cv_loc' assembler directive.
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
Context object for machine code objects.
const SmallVectorImpl< MCDwarfFile > & getMCDwarfFiles() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
.code16 (X86) / .code 16 (ARM)
virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame)
StringRef getSectionName() const
.type _foo, STT_GNU_IFUNC
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
StringRef getSingleStringRef() const
This returns the twine as a single StringRef.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef slice(size_t Start, size_t End) const
Return a reference to the substring from [Start, End).
virtual void EmitCFIRestoreState()
LLVM_NODISCARD char front() const
front - Get the first character in the string.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
uint32_t getOffset() const
Instances of this class represent a single low-level machine instruction.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
This class is intended to be used as a base class for asm properties and features specific to the tar...
Streaming machine code generation interface.
const MCExpr * getValue() const
unsigned const MachineRegisterInfo * MRI
.weak_def_can_be_hidden (MachO)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
The instances of the Type class are immutable: once they are created, they are never changed...
virtual void EmitCVLinetableDirective(unsigned FunctionId, const MCSymbol *FnStart, const MCSymbol *FnEnd)
This implements the CodeView '.cv_linetable' assembler directive.
static char toOctal(int X)
#define DWARF2_FLAG_EPILOGUE_BEGIN
MCStreamer * createAsmStreamer(MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool isVerboseAsm, bool useDwarfDirectory, MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst)
Create a machine code streamer which will print out assembly for the native target, suitable for compiling with a native assembler.
virtual void EmitWinCFIPushReg(unsigned Register)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
MCCodeEmitter - Generic instruction encoding interface.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
virtual void EmitCFIDefCfaRegister(int64_t Register)
MCLOHType
Linker Optimization Hint Type.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
.subsections_via_symbols (MachO)
#define DWARF2_FLAG_BASIC_BLOCK
virtual void EmitWinCFIEndChained()
virtual void EmitWinCFIEndProc()
virtual void EmitCFIUndefined(int64_t Register)
bool empty() const
empty - Check if the array is empty.
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
int getLLVMRegNum(unsigned RegNum, bool isEH) const
Map a dwarf register back to a target register.
MCFixupKind getKind() const
virtual void EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except)
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, const MCExpr *Subsection) const =0
static void PrintCFIEscape(llvm::formatted_raw_ostream &OS, StringRef Values)
virtual void EmitWinCFIStartChained()
virtual void EmitWinCFISaveXMM(unsigned Register, unsigned Offset)
virtual void EmitCFIOffset(int64_t Register, int64_t Offset)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
.type _foo, STT_TLS # aka
Promote Memory to Register
virtual void EmitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
This implements the CodeView '.cv_inline_linetable' assembler directive.
unsigned TargetSize
The number of bits written by this fixup.
virtual void EmitWinCFIAllocStack(unsigned Size)
static StringRef MCLOHDirectiveName()
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
const MCSymbol * Function
static void Emit(MCStreamer *MCOS)
StringRef getSegmentName() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
MCSection & getSection(bool SetUsed=true) const
Get the section associated with a defined, non-absolute symbol.
.code32 (X86) / .code 32 (ARM)
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
llvm_unreachable("Unknown RegBank!")
.type _foo, STT_COMMON # aka
virtual void EmitCVDefRangeDirective(ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, StringRef FixedSizePortion)
This implements the CodeView '.cv_def_range' assembler directive.
static std::vector< std::string > Flags
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
virtual void EmitCFISignalFrame()
virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset)
.type _foo, STT_FUNC # aka
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
MCSubtargetInfo - Generic base class for all target subtargets.
virtual void emitFill(uint64_t NumBytes, uint8_t FillValue)
Emit NumBytes bytes worth of the value specified by FillValue.
virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset)
Target independent information on a fixup kind.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
LLVM_NODISCARD size_t find_first_of(char C, size_t From=0) const
Find the first character in the string that is C, or npos if not found.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
virtual std::string getSchedInfoStr(const MachineInstr &MI) const
Returns string representation of scheduler comment.
static int MCLOHIdToNbArgs(MCLOHType Kind)
virtual bool EmitCVInlineSiteIdDirective(unsigned FunctionId, unsigned IAFunc, unsigned IAFile, unsigned IALine, unsigned IACol, SMLoc Loc)
Introduces an inline call site id for use with .cv_loc.
uint64_t PowerOf2Floor(uint64_t A)
Returns the power of two which is less than or equal to the given value.
LLVM Value Representation.
Generic interface to target specific assembler backends.
static cl::opt< bool, true > Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag))
virtual bool EmitCVFuncIdDirective(unsigned FunctionId)
Introduces a function id for use with .cv_loc.
virtual void EmitWinCFIStartProc(const MCSymbol *Symbol)
raw_ostream & nulls()
This returns a reference to a raw_ostream which simply discards output.
static StringRef MCLOHIdToName(MCLOHType Kind)
virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
This class implements an extremely fast bulk output stream that can only output to a stream...
void encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned Padding=0)
Utility function to encode a ULEB128 value to an output stream.
virtual void EmitWinCFISaveReg(unsigned Register, unsigned Offset)
virtual void EmitWinCFIPushFrame(bool Code)
StringRef - Represent a constant reference to a string, i.e.
static void PrintQuotedString(StringRef Data, raw_ostream &OS)
Represents a location in source code.
unsigned getFile(StringRef &Directory, StringRef &FileName, unsigned FileNumber=0)
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment)
virtual void EmitWinCFISetFrame(unsigned Register, unsigned Offset)
virtual void EmitCFIWindowSave()