mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[MC] De-capitalize another set of MCStreamer::Emit* functions
Emit{ValueTo,Code}Alignment Emit{DTP,TP,GP}* EmitSymbolValue etc
This commit is contained in:
parent
343c2a2b44
commit
e6d3f76ab0
@ -40,7 +40,7 @@ public:
|
|||||||
|
|
||||||
void InitSections(bool NoExecStack) override;
|
void InitSections(bool NoExecStack) override;
|
||||||
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override;
|
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override;
|
||||||
void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
||||||
void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F,
|
void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F,
|
||||||
uint64_t Offset) override;
|
uint64_t Offset) override;
|
||||||
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
|
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
|
||||||
@ -63,12 +63,12 @@ public:
|
|||||||
SMLoc L = SMLoc()) override;
|
SMLoc L = SMLoc()) override;
|
||||||
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
||||||
unsigned ByteAlignment = 0) override;
|
unsigned ByteAlignment = 0) override;
|
||||||
void EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc = SMLoc()) override;
|
SMLoc Loc = SMLoc()) override;
|
||||||
|
|
||||||
void EmitIdent(StringRef IdentString) override;
|
void EmitIdent(StringRef IdentString) override;
|
||||||
|
|
||||||
void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
|
void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
|
||||||
|
|
||||||
void emitCGProfileEntry(const MCSymbolRefExpr *From,
|
void emitCGProfileEntry(const MCSymbolRefExpr *From,
|
||||||
const MCSymbolRefExpr *To, uint64_t Count) override;
|
const MCSymbolRefExpr *To, uint64_t Count) override;
|
||||||
|
@ -113,11 +113,11 @@ public:
|
|||||||
/// \name MCStreamer Interface
|
/// \name MCStreamer Interface
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
||||||
virtual void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F,
|
virtual void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F,
|
||||||
uint64_t Offset);
|
uint64_t Offset);
|
||||||
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
|
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
|
||||||
void EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc = SMLoc()) override;
|
SMLoc Loc = SMLoc()) override;
|
||||||
void emitULEB128Value(const MCExpr *Value) override;
|
void emitULEB128Value(const MCExpr *Value) override;
|
||||||
void emitSLEB128Value(const MCExpr *Value) override;
|
void emitSLEB128Value(const MCExpr *Value) override;
|
||||||
@ -133,10 +133,10 @@ public:
|
|||||||
void EmitBundleLock(bool AlignToEnd) override;
|
void EmitBundleLock(bool AlignToEnd) override;
|
||||||
void EmitBundleUnlock() override;
|
void EmitBundleUnlock() override;
|
||||||
void emitBytes(StringRef Data) override;
|
void emitBytes(StringRef Data) override;
|
||||||
void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
void emitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
||||||
unsigned ValueSize = 1,
|
unsigned ValueSize = 1,
|
||||||
unsigned MaxBytesToEmit = 0) override;
|
unsigned MaxBytesToEmit = 0) override;
|
||||||
void EmitCodeAlignment(unsigned ByteAlignment,
|
void emitCodeAlignment(unsigned ByteAlignment,
|
||||||
unsigned MaxBytesToEmit = 0) override;
|
unsigned MaxBytesToEmit = 0) override;
|
||||||
void emitValueToOffset(const MCExpr *Offset, unsigned char Value,
|
void emitValueToOffset(const MCExpr *Offset, unsigned char Value,
|
||||||
SMLoc Loc) override;
|
SMLoc Loc) override;
|
||||||
@ -164,12 +164,12 @@ public:
|
|||||||
void EmitCVStringTableDirective() override;
|
void EmitCVStringTableDirective() override;
|
||||||
void EmitCVFileChecksumsDirective() override;
|
void EmitCVFileChecksumsDirective() override;
|
||||||
void EmitCVFileChecksumOffsetDirective(unsigned FileNo) override;
|
void EmitCVFileChecksumOffsetDirective(unsigned FileNo) override;
|
||||||
void EmitDTPRel32Value(const MCExpr *Value) override;
|
void emitDTPRel32Value(const MCExpr *Value) override;
|
||||||
void EmitDTPRel64Value(const MCExpr *Value) override;
|
void emitDTPRel64Value(const MCExpr *Value) override;
|
||||||
void EmitTPRel32Value(const MCExpr *Value) override;
|
void emitTPRel32Value(const MCExpr *Value) override;
|
||||||
void EmitTPRel64Value(const MCExpr *Value) override;
|
void emitTPRel64Value(const MCExpr *Value) override;
|
||||||
void EmitGPRel32Value(const MCExpr *Value) override;
|
void emitGPRel32Value(const MCExpr *Value) override;
|
||||||
void EmitGPRel64Value(const MCExpr *Value) override;
|
void emitGPRel64Value(const MCExpr *Value) override;
|
||||||
bool EmitRelocDirective(const MCExpr &Offset, StringRef Name,
|
bool EmitRelocDirective(const MCExpr &Offset, StringRef Name,
|
||||||
const MCExpr *Expr, SMLoc Loc,
|
const MCExpr *Expr, SMLoc Loc,
|
||||||
const MCSubtargetInfo &STI) override;
|
const MCSubtargetInfo &STI) override;
|
||||||
|
@ -453,7 +453,7 @@ public:
|
|||||||
/// used in an assignment.
|
/// used in an assignment.
|
||||||
// FIXME: These emission are non-const because we mutate the symbol to
|
// FIXME: These emission are non-const because we mutate the symbol to
|
||||||
// add the section we're emitting it to later.
|
// add the section we're emitting it to later.
|
||||||
virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc());
|
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc());
|
||||||
|
|
||||||
virtual void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol);
|
virtual void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol);
|
||||||
|
|
||||||
@ -647,7 +647,7 @@ public:
|
|||||||
/// \param Size - The size of the integer (in bytes) to emit. This must
|
/// \param Size - The size of the integer (in bytes) to emit. This must
|
||||||
/// match a native machine width.
|
/// match a native machine width.
|
||||||
/// \param Loc - The location of the expression for error reporting.
|
/// \param Loc - The location of the expression for error reporting.
|
||||||
virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
|
virtual void emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc = SMLoc());
|
SMLoc Loc = SMLoc());
|
||||||
|
|
||||||
void EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc = SMLoc());
|
void EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc = SMLoc());
|
||||||
@ -684,7 +684,7 @@ public:
|
|||||||
|
|
||||||
/// Special case of EmitValue that avoids the client having to pass in
|
/// Special case of EmitValue that avoids the client having to pass in
|
||||||
/// a MCExpr for MCSymbols.
|
/// a MCExpr for MCSymbols.
|
||||||
void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
|
void emitSymbolValue(const MCSymbol *Sym, unsigned Size,
|
||||||
bool IsSectionRelative = false);
|
bool IsSectionRelative = false);
|
||||||
|
|
||||||
/// Emit the expression \p Value into the output as a dtprel
|
/// Emit the expression \p Value into the output as a dtprel
|
||||||
@ -692,42 +692,42 @@ public:
|
|||||||
///
|
///
|
||||||
/// This is used to implement assembler directives such as .dtpreldword on
|
/// This is used to implement assembler directives such as .dtpreldword on
|
||||||
/// targets that support them.
|
/// targets that support them.
|
||||||
virtual void EmitDTPRel64Value(const MCExpr *Value);
|
virtual void emitDTPRel64Value(const MCExpr *Value);
|
||||||
|
|
||||||
/// Emit the expression \p Value into the output as a dtprel
|
/// Emit the expression \p Value into the output as a dtprel
|
||||||
/// (32-bit DTP relative) value.
|
/// (32-bit DTP relative) value.
|
||||||
///
|
///
|
||||||
/// This is used to implement assembler directives such as .dtprelword on
|
/// This is used to implement assembler directives such as .dtprelword on
|
||||||
/// targets that support them.
|
/// targets that support them.
|
||||||
virtual void EmitDTPRel32Value(const MCExpr *Value);
|
virtual void emitDTPRel32Value(const MCExpr *Value);
|
||||||
|
|
||||||
/// Emit the expression \p Value into the output as a tprel
|
/// Emit the expression \p Value into the output as a tprel
|
||||||
/// (64-bit TP relative) value.
|
/// (64-bit TP relative) value.
|
||||||
///
|
///
|
||||||
/// This is used to implement assembler directives such as .tpreldword on
|
/// This is used to implement assembler directives such as .tpreldword on
|
||||||
/// targets that support them.
|
/// targets that support them.
|
||||||
virtual void EmitTPRel64Value(const MCExpr *Value);
|
virtual void emitTPRel64Value(const MCExpr *Value);
|
||||||
|
|
||||||
/// Emit the expression \p Value into the output as a tprel
|
/// Emit the expression \p Value into the output as a tprel
|
||||||
/// (32-bit TP relative) value.
|
/// (32-bit TP relative) value.
|
||||||
///
|
///
|
||||||
/// This is used to implement assembler directives such as .tprelword on
|
/// This is used to implement assembler directives such as .tprelword on
|
||||||
/// targets that support them.
|
/// targets that support them.
|
||||||
virtual void EmitTPRel32Value(const MCExpr *Value);
|
virtual void emitTPRel32Value(const MCExpr *Value);
|
||||||
|
|
||||||
/// Emit the expression \p Value into the output as a gprel64 (64-bit
|
/// Emit the expression \p Value into the output as a gprel64 (64-bit
|
||||||
/// GP relative) value.
|
/// GP relative) value.
|
||||||
///
|
///
|
||||||
/// This is used to implement assembler directives such as .gpdword on
|
/// This is used to implement assembler directives such as .gpdword on
|
||||||
/// targets that support them.
|
/// targets that support them.
|
||||||
virtual void EmitGPRel64Value(const MCExpr *Value);
|
virtual void emitGPRel64Value(const MCExpr *Value);
|
||||||
|
|
||||||
/// Emit the expression \p Value into the output as a gprel32 (32-bit
|
/// Emit the expression \p Value into the output as a gprel32 (32-bit
|
||||||
/// GP relative) value.
|
/// GP relative) value.
|
||||||
///
|
///
|
||||||
/// This is used to implement assembler directives such as .gprel32 on
|
/// This is used to implement assembler directives such as .gprel32 on
|
||||||
/// targets that support them.
|
/// targets that support them.
|
||||||
virtual void EmitGPRel32Value(const MCExpr *Value);
|
virtual void emitGPRel32Value(const MCExpr *Value);
|
||||||
|
|
||||||
/// Emit NumBytes bytes worth of the value specified by FillValue.
|
/// Emit NumBytes bytes worth of the value specified by FillValue.
|
||||||
/// This implements directives such as '.space'.
|
/// This implements directives such as '.space'.
|
||||||
@ -775,7 +775,7 @@ public:
|
|||||||
/// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
|
/// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
|
||||||
/// the alignment cannot be reached in this many bytes, no bytes are
|
/// the alignment cannot be reached in this many bytes, no bytes are
|
||||||
/// emitted.
|
/// emitted.
|
||||||
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
virtual void emitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
||||||
unsigned ValueSize = 1,
|
unsigned ValueSize = 1,
|
||||||
unsigned MaxBytesToEmit = 0);
|
unsigned MaxBytesToEmit = 0);
|
||||||
|
|
||||||
@ -789,7 +789,7 @@ public:
|
|||||||
/// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
|
/// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
|
||||||
/// the alignment cannot be reached in this many bytes, no bytes are
|
/// the alignment cannot be reached in this many bytes, no bytes are
|
||||||
/// emitted.
|
/// emitted.
|
||||||
virtual void EmitCodeAlignment(unsigned ByteAlignment,
|
virtual void emitCodeAlignment(unsigned ByteAlignment,
|
||||||
unsigned MaxBytesToEmit = 0);
|
unsigned MaxBytesToEmit = 0);
|
||||||
|
|
||||||
/// Emit some number of copies of \p Value until the byte offset \p
|
/// Emit some number of copies of \p Value until the byte offset \p
|
||||||
|
@ -63,12 +63,12 @@ public:
|
|||||||
SMLoc Loc = SMLoc()) override;
|
SMLoc Loc = SMLoc()) override;
|
||||||
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
||||||
unsigned ByteAlignment = 0) override;
|
unsigned ByteAlignment = 0) override;
|
||||||
void EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc = SMLoc()) override;
|
SMLoc Loc = SMLoc()) override;
|
||||||
|
|
||||||
void EmitIdent(StringRef IdentString) override;
|
void EmitIdent(StringRef IdentString) override;
|
||||||
|
|
||||||
void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
|
void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
|
||||||
|
|
||||||
void FinishImpl() override;
|
void FinishImpl() override;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
/// \{
|
/// \{
|
||||||
|
|
||||||
void InitSections(bool NoExecStack) override;
|
void InitSections(bool NoExecStack) override;
|
||||||
void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
||||||
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
|
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
|
||||||
void emitThumbFunc(MCSymbol *Func) override;
|
void emitThumbFunc(MCSymbol *Func) override;
|
||||||
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
|
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
|
||||||
|
@ -112,7 +112,7 @@ void ARMException::emitTypeInfos(unsigned TTypeEncoding,
|
|||||||
Asm->emitTTypeReference(GV, TTypeEncoding);
|
Asm->emitTTypeReference(GV, TTypeEncoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
Asm->OutStreamer->EmitLabel(TTBaseLabel);
|
Asm->OutStreamer->emitLabel(TTBaseLabel);
|
||||||
|
|
||||||
// Emit the Exception Specifications.
|
// Emit the Exception Specifications.
|
||||||
if (VerboseAsm && !FilterIds.empty()) {
|
if (VerboseAsm && !FilterIds.empty()) {
|
||||||
|
@ -337,7 +337,7 @@ void AppleAccelTableWriter::emitData() const {
|
|||||||
PrevHash != Hash->HashValue)
|
PrevHash != Hash->HashValue)
|
||||||
Asm->emitInt32(0);
|
Asm->emitInt32(0);
|
||||||
// Remember to emit the label for our offset.
|
// Remember to emit the label for our offset.
|
||||||
Asm->OutStreamer->EmitLabel(Hash->Sym);
|
Asm->OutStreamer->emitLabel(Hash->Sym);
|
||||||
Asm->OutStreamer->AddComment(Hash->Name.getString());
|
Asm->OutStreamer->AddComment(Hash->Name.getString());
|
||||||
Asm->emitDwarfStringOffset(Hash->Name);
|
Asm->emitDwarfStringOffset(Hash->Name);
|
||||||
Asm->OutStreamer->AddComment("Num DIEs");
|
Asm->OutStreamer->AddComment("Num DIEs");
|
||||||
@ -370,7 +370,7 @@ void Dwarf5AccelTableWriter<DataT>::Header::emit(
|
|||||||
Asm->OutStreamer->AddComment("Header: unit length");
|
Asm->OutStreamer->AddComment("Header: unit length");
|
||||||
Asm->emitLabelDifference(Ctx.ContributionEnd, Ctx.ContributionStart,
|
Asm->emitLabelDifference(Ctx.ContributionEnd, Ctx.ContributionStart,
|
||||||
sizeof(uint32_t));
|
sizeof(uint32_t));
|
||||||
Asm->OutStreamer->EmitLabel(Ctx.ContributionStart);
|
Asm->OutStreamer->emitLabel(Ctx.ContributionStart);
|
||||||
Asm->OutStreamer->AddComment("Header: version");
|
Asm->OutStreamer->AddComment("Header: version");
|
||||||
Asm->emitInt16(Version);
|
Asm->emitInt16(Version);
|
||||||
Asm->OutStreamer->AddComment("Header: padding");
|
Asm->OutStreamer->AddComment("Header: padding");
|
||||||
@ -453,7 +453,7 @@ void Dwarf5AccelTableWriter<DataT>::emitStringOffsets() const {
|
|||||||
|
|
||||||
template <typename DataT>
|
template <typename DataT>
|
||||||
void Dwarf5AccelTableWriter<DataT>::emitAbbrevs() const {
|
void Dwarf5AccelTableWriter<DataT>::emitAbbrevs() const {
|
||||||
Asm->OutStreamer->EmitLabel(AbbrevStart);
|
Asm->OutStreamer->emitLabel(AbbrevStart);
|
||||||
for (const auto &Abbrev : Abbreviations) {
|
for (const auto &Abbrev : Abbreviations) {
|
||||||
Asm->OutStreamer->AddComment("Abbrev code");
|
Asm->OutStreamer->AddComment("Abbrev code");
|
||||||
assert(Abbrev.first != 0);
|
assert(Abbrev.first != 0);
|
||||||
@ -469,7 +469,7 @@ void Dwarf5AccelTableWriter<DataT>::emitAbbrevs() const {
|
|||||||
Asm->emitULEB128(0, "End of abbrev");
|
Asm->emitULEB128(0, "End of abbrev");
|
||||||
}
|
}
|
||||||
Asm->emitULEB128(0, "End of abbrev list");
|
Asm->emitULEB128(0, "End of abbrev list");
|
||||||
Asm->OutStreamer->EmitLabel(AbbrevEnd);
|
Asm->OutStreamer->emitLabel(AbbrevEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename DataT>
|
template <typename DataT>
|
||||||
@ -498,11 +498,11 @@ void Dwarf5AccelTableWriter<DataT>::emitEntry(const DataT &Entry) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename DataT> void Dwarf5AccelTableWriter<DataT>::emitData() const {
|
template <typename DataT> void Dwarf5AccelTableWriter<DataT>::emitData() const {
|
||||||
Asm->OutStreamer->EmitLabel(EntryPool);
|
Asm->OutStreamer->emitLabel(EntryPool);
|
||||||
for (auto &Bucket : Contents.getBuckets()) {
|
for (auto &Bucket : Contents.getBuckets()) {
|
||||||
for (auto *Hash : Bucket) {
|
for (auto *Hash : Bucket) {
|
||||||
// Remember to emit the label for our offset.
|
// Remember to emit the label for our offset.
|
||||||
Asm->OutStreamer->EmitLabel(Hash->Sym);
|
Asm->OutStreamer->emitLabel(Hash->Sym);
|
||||||
for (const auto *Value : Hash->Values)
|
for (const auto *Value : Hash->Values)
|
||||||
emitEntry(*static_cast<const DataT *>(Value));
|
emitEntry(*static_cast<const DataT *>(Value));
|
||||||
Asm->OutStreamer->AddComment("End of list: " + Hash->Name.getString());
|
Asm->OutStreamer->AddComment("End of list: " + Hash->Name.getString());
|
||||||
@ -537,8 +537,8 @@ template <typename DataT> void Dwarf5AccelTableWriter<DataT>::emit() const {
|
|||||||
emitOffsets(EntryPool);
|
emitOffsets(EntryPool);
|
||||||
emitAbbrevs();
|
emitAbbrevs();
|
||||||
emitData();
|
emitData();
|
||||||
Asm->OutStreamer->EmitValueToAlignment(4, 0);
|
Asm->OutStreamer->emitValueToAlignment(4, 0);
|
||||||
Asm->OutStreamer->EmitLabel(ContributionEnd);
|
Asm->OutStreamer->emitLabel(ContributionEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void llvm::emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
|
void llvm::emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
|
||||||
|
@ -32,7 +32,7 @@ MCSymbol *AddressPool::emitHeader(AsmPrinter &Asm, MCSection *Section) {
|
|||||||
Asm.OutStreamer->AddComment("Length of contribution");
|
Asm.OutStreamer->AddComment("Length of contribution");
|
||||||
Asm.emitLabelDifference(EndLabel, BeginLabel,
|
Asm.emitLabelDifference(EndLabel, BeginLabel,
|
||||||
4); // TODO: Support DWARF64 format.
|
4); // TODO: Support DWARF64 format.
|
||||||
Asm.OutStreamer->EmitLabel(BeginLabel);
|
Asm.OutStreamer->emitLabel(BeginLabel);
|
||||||
Asm.OutStreamer->AddComment("DWARF version number");
|
Asm.OutStreamer->AddComment("DWARF version number");
|
||||||
Asm.emitInt16(Asm.getDwarfVersion());
|
Asm.emitInt16(Asm.getDwarfVersion());
|
||||||
Asm.OutStreamer->AddComment("Address size");
|
Asm.OutStreamer->AddComment("Address size");
|
||||||
@ -58,7 +58,7 @@ void AddressPool::emit(AsmPrinter &Asm, MCSection *AddrSection) {
|
|||||||
|
|
||||||
// Define the symbol that marks the start of the contribution.
|
// Define the symbol that marks the start of the contribution.
|
||||||
// It is referenced via DW_AT_addr_base.
|
// It is referenced via DW_AT_addr_base.
|
||||||
Asm.OutStreamer->EmitLabel(AddressTableBaseSym);
|
Asm.OutStreamer->emitLabel(AddressTableBaseSym);
|
||||||
|
|
||||||
// Order the address pool entries by ID
|
// Order the address pool entries by ID
|
||||||
SmallVector<const MCExpr *, 64> Entries(Pool.size());
|
SmallVector<const MCExpr *, 64> Entries(Pool.size());
|
||||||
@ -73,5 +73,5 @@ void AddressPool::emit(AsmPrinter &Asm, MCSection *AddrSection) {
|
|||||||
Asm.OutStreamer->EmitValue(Entry, Asm.getDataLayout().getPointerSize());
|
Asm.OutStreamer->EmitValue(Entry, Asm.getDataLayout().getPointerSize());
|
||||||
|
|
||||||
if (EndLabel)
|
if (EndLabel)
|
||||||
Asm.OutStreamer->EmitLabel(EndLabel);
|
Asm.OutStreamer->emitLabel(EndLabel);
|
||||||
}
|
}
|
||||||
|
@ -608,7 +608,7 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
OutStreamer->SwitchSection(TheSection);
|
OutStreamer->SwitchSection(TheSection);
|
||||||
|
|
||||||
emitAlignment(Alignment, GV);
|
emitAlignment(Alignment, GV);
|
||||||
OutStreamer->EmitLabel(MangSym);
|
OutStreamer->emitLabel(MangSym);
|
||||||
|
|
||||||
emitGlobalConstant(GV->getParent()->getDataLayout(),
|
emitGlobalConstant(GV->getParent()->getDataLayout(),
|
||||||
GV->getInitializer());
|
GV->getInitializer());
|
||||||
@ -622,17 +622,17 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
OutStreamer->SwitchSection(TLVSect);
|
OutStreamer->SwitchSection(TLVSect);
|
||||||
// Emit the linkage here.
|
// Emit the linkage here.
|
||||||
emitLinkage(GV, GVSym);
|
emitLinkage(GV, GVSym);
|
||||||
OutStreamer->EmitLabel(GVSym);
|
OutStreamer->emitLabel(GVSym);
|
||||||
|
|
||||||
// Three pointers in size:
|
// Three pointers in size:
|
||||||
// - __tlv_bootstrap - used to make sure support exists
|
// - __tlv_bootstrap - used to make sure support exists
|
||||||
// - spare pointer, used when mapped by the runtime
|
// - spare pointer, used when mapped by the runtime
|
||||||
// - pointer to mangled symbol above with initializer
|
// - pointer to mangled symbol above with initializer
|
||||||
unsigned PtrSize = DL.getPointerTypeSize(GV->getType());
|
unsigned PtrSize = DL.getPointerTypeSize(GV->getType());
|
||||||
OutStreamer->EmitSymbolValue(GetExternalSymbolSymbol("_tlv_bootstrap"),
|
OutStreamer->emitSymbolValue(GetExternalSymbolSymbol("_tlv_bootstrap"),
|
||||||
PtrSize);
|
PtrSize);
|
||||||
OutStreamer->EmitIntValue(0, PtrSize);
|
OutStreamer->EmitIntValue(0, PtrSize);
|
||||||
OutStreamer->EmitSymbolValue(MangSym, PtrSize);
|
OutStreamer->emitSymbolValue(MangSym, PtrSize);
|
||||||
|
|
||||||
OutStreamer->AddBlankLine();
|
OutStreamer->AddBlankLine();
|
||||||
return;
|
return;
|
||||||
@ -645,10 +645,10 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
emitLinkage(GV, EmittedInitSym);
|
emitLinkage(GV, EmittedInitSym);
|
||||||
emitAlignment(Alignment, GV);
|
emitAlignment(Alignment, GV);
|
||||||
|
|
||||||
OutStreamer->EmitLabel(EmittedInitSym);
|
OutStreamer->emitLabel(EmittedInitSym);
|
||||||
MCSymbol *LocalAlias = getSymbolPreferLocal(*GV);
|
MCSymbol *LocalAlias = getSymbolPreferLocal(*GV);
|
||||||
if (LocalAlias != EmittedInitSym)
|
if (LocalAlias != EmittedInitSym)
|
||||||
OutStreamer->EmitLabel(LocalAlias);
|
OutStreamer->emitLabel(LocalAlias);
|
||||||
|
|
||||||
emitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());
|
emitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());
|
||||||
|
|
||||||
@ -713,7 +713,7 @@ void AsmPrinter::emitFunctionHeader() {
|
|||||||
// and use the .alt_entry attribute to mark the function's real entry point
|
// and use the .alt_entry attribute to mark the function's real entry point
|
||||||
// as an alternative entry point to the prefix-data symbol.
|
// as an alternative entry point to the prefix-data symbol.
|
||||||
MCSymbol *PrefixSym = OutContext.createLinkerPrivateTempSymbol();
|
MCSymbol *PrefixSym = OutContext.createLinkerPrivateTempSymbol();
|
||||||
OutStreamer->EmitLabel(PrefixSym);
|
OutStreamer->emitLabel(PrefixSym);
|
||||||
|
|
||||||
emitGlobalConstant(F.getParent()->getDataLayout(), F.getPrefixData());
|
emitGlobalConstant(F.getParent()->getDataLayout(), F.getPrefixData());
|
||||||
|
|
||||||
@ -737,7 +737,7 @@ void AsmPrinter::emitFunctionHeader() {
|
|||||||
if (PatchableFunctionPrefix) {
|
if (PatchableFunctionPrefix) {
|
||||||
CurrentPatchableFunctionEntrySym =
|
CurrentPatchableFunctionEntrySym =
|
||||||
OutContext.createLinkerPrivateTempSymbol();
|
OutContext.createLinkerPrivateTempSymbol();
|
||||||
OutStreamer->EmitLabel(CurrentPatchableFunctionEntrySym);
|
OutStreamer->emitLabel(CurrentPatchableFunctionEntrySym);
|
||||||
emitNops(PatchableFunctionPrefix);
|
emitNops(PatchableFunctionPrefix);
|
||||||
} else if (PatchableFunctionEntry) {
|
} else if (PatchableFunctionEntry) {
|
||||||
// May be reassigned when emitting the body, to reference the label after
|
// May be reassigned when emitting the body, to reference the label after
|
||||||
@ -759,11 +759,11 @@ void AsmPrinter::emitFunctionHeader() {
|
|||||||
if (CurrentFnBegin) {
|
if (CurrentFnBegin) {
|
||||||
if (MAI->useAssignmentForEHBegin()) {
|
if (MAI->useAssignmentForEHBegin()) {
|
||||||
MCSymbol *CurPos = OutContext.createTempSymbol();
|
MCSymbol *CurPos = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(CurPos);
|
OutStreamer->emitLabel(CurPos);
|
||||||
OutStreamer->emitAssignment(CurrentFnBegin,
|
OutStreamer->emitAssignment(CurrentFnBegin,
|
||||||
MCSymbolRefExpr::create(CurPos, OutContext));
|
MCSymbolRefExpr::create(CurPos, OutContext));
|
||||||
} else {
|
} else {
|
||||||
OutStreamer->EmitLabel(CurrentFnBegin);
|
OutStreamer->emitLabel(CurrentFnBegin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -793,12 +793,12 @@ void AsmPrinter::emitFunctionEntryLabel() {
|
|||||||
report_fatal_error("'" + Twine(CurrentFnSym->getName()) +
|
report_fatal_error("'" + Twine(CurrentFnSym->getName()) +
|
||||||
"' label emitted multiple times to assembly file");
|
"' label emitted multiple times to assembly file");
|
||||||
|
|
||||||
OutStreamer->EmitLabel(CurrentFnSym);
|
OutStreamer->emitLabel(CurrentFnSym);
|
||||||
|
|
||||||
if (TM.getTargetTriple().isOSBinFormatELF()) {
|
if (TM.getTargetTriple().isOSBinFormatELF()) {
|
||||||
MCSymbol *Sym = getSymbolPreferLocal(MF->getFunction());
|
MCSymbol *Sym = getSymbolPreferLocal(MF->getFunction());
|
||||||
if (Sym != CurrentFnSym)
|
if (Sym != CurrentFnSym)
|
||||||
OutStreamer->EmitLabel(Sym);
|
OutStreamer->emitLabel(Sym);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1045,7 +1045,7 @@ void AsmPrinter::emitStackSizeSection(const MachineFunction &MF) {
|
|||||||
|
|
||||||
const MCSymbol *FunctionSymbol = getFunctionBegin();
|
const MCSymbol *FunctionSymbol = getFunctionBegin();
|
||||||
uint64_t StackSize = FrameInfo.getStackSize();
|
uint64_t StackSize = FrameInfo.getStackSize();
|
||||||
OutStreamer->EmitSymbolValue(FunctionSymbol, TM.getProgramPointerSize());
|
OutStreamer->emitSymbolValue(FunctionSymbol, TM.getProgramPointerSize());
|
||||||
OutStreamer->emitULEB128IntValue(StackSize);
|
OutStreamer->emitULEB128IntValue(StackSize);
|
||||||
|
|
||||||
OutStreamer->PopSection();
|
OutStreamer->PopSection();
|
||||||
@ -1108,7 +1108,7 @@ void AsmPrinter::emitFunctionBody() {
|
|||||||
|
|
||||||
// If there is a pre-instruction symbol, emit a label for it here.
|
// If there is a pre-instruction symbol, emit a label for it here.
|
||||||
if (MCSymbol *S = MI.getPreInstrSymbol())
|
if (MCSymbol *S = MI.getPreInstrSymbol())
|
||||||
OutStreamer->EmitLabel(S);
|
OutStreamer->emitLabel(S);
|
||||||
|
|
||||||
if (ShouldPrintDebugScopes) {
|
if (ShouldPrintDebugScopes) {
|
||||||
for (const HandlerInfo &HI : Handlers) {
|
for (const HandlerInfo &HI : Handlers) {
|
||||||
@ -1132,7 +1132,7 @@ void AsmPrinter::emitFunctionBody() {
|
|||||||
case TargetOpcode::ANNOTATION_LABEL:
|
case TargetOpcode::ANNOTATION_LABEL:
|
||||||
case TargetOpcode::EH_LABEL:
|
case TargetOpcode::EH_LABEL:
|
||||||
case TargetOpcode::GC_LABEL:
|
case TargetOpcode::GC_LABEL:
|
||||||
OutStreamer->EmitLabel(MI.getOperand(0).getMCSymbol());
|
OutStreamer->emitLabel(MI.getOperand(0).getMCSymbol());
|
||||||
break;
|
break;
|
||||||
case TargetOpcode::INLINEASM:
|
case TargetOpcode::INLINEASM:
|
||||||
case TargetOpcode::INLINEASM_BR:
|
case TargetOpcode::INLINEASM_BR:
|
||||||
@ -1163,7 +1163,7 @@ void AsmPrinter::emitFunctionBody() {
|
|||||||
|
|
||||||
// If there is a post-instruction symbol, emit a label for it here.
|
// If there is a post-instruction symbol, emit a label for it here.
|
||||||
if (MCSymbol *S = MI.getPostInstrSymbol())
|
if (MCSymbol *S = MI.getPostInstrSymbol())
|
||||||
OutStreamer->EmitLabel(S);
|
OutStreamer->emitLabel(S);
|
||||||
|
|
||||||
if (ShouldPrintDebugScopes) {
|
if (ShouldPrintDebugScopes) {
|
||||||
for (const HandlerInfo &HI : Handlers) {
|
for (const HandlerInfo &HI : Handlers) {
|
||||||
@ -1216,7 +1216,7 @@ void AsmPrinter::emitFunctionBody() {
|
|||||||
if (Sym->isDefined())
|
if (Sym->isDefined())
|
||||||
continue;
|
continue;
|
||||||
OutStreamer->AddComment("Address of block that was removed by CodeGen");
|
OutStreamer->AddComment("Address of block that was removed by CodeGen");
|
||||||
OutStreamer->EmitLabel(Sym);
|
OutStreamer->emitLabel(Sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit target-specific gunk after the function body.
|
// Emit target-specific gunk after the function body.
|
||||||
@ -1226,7 +1226,7 @@ void AsmPrinter::emitFunctionBody() {
|
|||||||
MAI->hasDotTypeDotSizeDirective()) {
|
MAI->hasDotTypeDotSizeDirective()) {
|
||||||
// Create a symbol for the end of function.
|
// Create a symbol for the end of function.
|
||||||
CurrentFnEnd = createTempSymbol("func_end");
|
CurrentFnEnd = createTempSymbol("func_end");
|
||||||
OutStreamer->EmitLabel(CurrentFnEnd);
|
OutStreamer->emitLabel(CurrentFnEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the target wants a .size directive for the size of the function, emit
|
// If the target wants a .size directive for the size of the function, emit
|
||||||
@ -1483,8 +1483,8 @@ bool AsmPrinter::doFinalization(Module &M) {
|
|||||||
|
|
||||||
emitAlignment(Align(DL.getPointerSize()));
|
emitAlignment(Align(DL.getPointerSize()));
|
||||||
for (const auto &Stub : Stubs) {
|
for (const auto &Stub : Stubs) {
|
||||||
OutStreamer->EmitLabel(Stub.first);
|
OutStreamer->emitLabel(Stub.first);
|
||||||
OutStreamer->EmitSymbolValue(Stub.second.getPointer(),
|
OutStreamer->emitSymbolValue(Stub.second.getPointer(),
|
||||||
DL.getPointerSize());
|
DL.getPointerSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1510,8 +1510,8 @@ bool AsmPrinter::doFinalization(Module &M) {
|
|||||||
COFF::IMAGE_COMDAT_SELECT_ANY));
|
COFF::IMAGE_COMDAT_SELECT_ANY));
|
||||||
emitAlignment(Align(DL.getPointerSize()));
|
emitAlignment(Align(DL.getPointerSize()));
|
||||||
OutStreamer->emitSymbolAttribute(Stub.first, MCSA_Global);
|
OutStreamer->emitSymbolAttribute(Stub.first, MCSA_Global);
|
||||||
OutStreamer->EmitLabel(Stub.first);
|
OutStreamer->emitLabel(Stub.first);
|
||||||
OutStreamer->EmitSymbolValue(Stub.second.getPointer(),
|
OutStreamer->emitSymbolValue(Stub.second.getPointer(),
|
||||||
DL.getPointerSize());
|
DL.getPointerSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1583,10 +1583,10 @@ bool AsmPrinter::doFinalization(Module &M) {
|
|||||||
|
|
||||||
MCSymbol *AddrSymbol =
|
MCSymbol *AddrSymbol =
|
||||||
OutContext.getOrCreateSymbol(StringRef("__morestack_addr"));
|
OutContext.getOrCreateSymbol(StringRef("__morestack_addr"));
|
||||||
OutStreamer->EmitLabel(AddrSymbol);
|
OutStreamer->emitLabel(AddrSymbol);
|
||||||
|
|
||||||
unsigned PtrSize = MAI->getCodePointerSize();
|
unsigned PtrSize = MAI->getCodePointerSize();
|
||||||
OutStreamer->EmitSymbolValue(GetExternalSymbolSymbol("__morestack"),
|
OutStreamer->emitSymbolValue(GetExternalSymbolSymbol("__morestack"),
|
||||||
PtrSize);
|
PtrSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1838,7 +1838,7 @@ void AsmPrinter::emitConstantPool() {
|
|||||||
Type *Ty = CPE.getType();
|
Type *Ty = CPE.getType();
|
||||||
Offset = NewOffset + getDataLayout().getTypeAllocSize(Ty);
|
Offset = NewOffset + getDataLayout().getTypeAllocSize(Ty);
|
||||||
|
|
||||||
OutStreamer->EmitLabel(Sym);
|
OutStreamer->emitLabel(Sym);
|
||||||
if (CPE.isMachineConstantPoolEntry())
|
if (CPE.isMachineConstantPoolEntry())
|
||||||
emitMachineConstantPoolValue(CPE.Val.MachineCPVal);
|
emitMachineConstantPoolValue(CPE.Val.MachineCPVal);
|
||||||
else
|
else
|
||||||
@ -1912,14 +1912,14 @@ void AsmPrinter::emitJumpTableInfo() {
|
|||||||
// FIXME: This doesn't have to have any specific name, just any randomly
|
// FIXME: This doesn't have to have any specific name, just any randomly
|
||||||
// named and numbered local label started with 'l' would work. Simplify
|
// named and numbered local label started with 'l' would work. Simplify
|
||||||
// GetJTISymbol.
|
// GetJTISymbol.
|
||||||
OutStreamer->EmitLabel(GetJTISymbol(JTI, true));
|
OutStreamer->emitLabel(GetJTISymbol(JTI, true));
|
||||||
|
|
||||||
MCSymbol* JTISymbol = GetJTISymbol(JTI);
|
MCSymbol* JTISymbol = GetJTISymbol(JTI);
|
||||||
if (TM.getTargetTriple().isOSBinFormatXCOFF()) {
|
if (TM.getTargetTriple().isOSBinFormatXCOFF()) {
|
||||||
cast<MCSymbolXCOFF>(JTISymbol)->setContainingCsect(
|
cast<MCSymbolXCOFF>(JTISymbol)->setContainingCsect(
|
||||||
cast<MCSectionXCOFF>(TLOF.getSectionForJumpTable(F, TM)));
|
cast<MCSectionXCOFF>(TLOF.getSectionForJumpTable(F, TM)));
|
||||||
}
|
}
|
||||||
OutStreamer->EmitLabel(JTISymbol);
|
OutStreamer->emitLabel(JTISymbol);
|
||||||
|
|
||||||
for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii)
|
for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii)
|
||||||
emitJumpTableEntry(MJTI, JTBBs[ii], JTI);
|
emitJumpTableEntry(MJTI, JTBBs[ii], JTI);
|
||||||
@ -1952,7 +1952,7 @@ void AsmPrinter::emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|||||||
// with a relocation as gp-relative, e.g.:
|
// with a relocation as gp-relative, e.g.:
|
||||||
// .gprel32 LBB123
|
// .gprel32 LBB123
|
||||||
MCSymbol *MBBSym = MBB->getSymbol();
|
MCSymbol *MBBSym = MBB->getSymbol();
|
||||||
OutStreamer->EmitGPRel32Value(MCSymbolRefExpr::create(MBBSym, OutContext));
|
OutStreamer->emitGPRel32Value(MCSymbolRefExpr::create(MBBSym, OutContext));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1961,7 +1961,7 @@ void AsmPrinter::emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|||||||
// with a relocation as gp-relative, e.g.:
|
// with a relocation as gp-relative, e.g.:
|
||||||
// .gpdword LBB123
|
// .gpdword LBB123
|
||||||
MCSymbol *MBBSym = MBB->getSymbol();
|
MCSymbol *MBBSym = MBB->getSymbol();
|
||||||
OutStreamer->EmitGPRel64Value(MCSymbolRefExpr::create(MBBSym, OutContext));
|
OutStreamer->emitGPRel64Value(MCSymbolRefExpr::create(MBBSym, OutContext));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2224,9 +2224,9 @@ void AsmPrinter::emitAlignment(Align Alignment, const GlobalObject *GV) const {
|
|||||||
return; // 1-byte aligned: no need to emit alignment.
|
return; // 1-byte aligned: no need to emit alignment.
|
||||||
|
|
||||||
if (getCurrentSection()->getKind().isText())
|
if (getCurrentSection()->getKind().isText())
|
||||||
OutStreamer->EmitCodeAlignment(Alignment.value());
|
OutStreamer->emitCodeAlignment(Alignment.value());
|
||||||
else
|
else
|
||||||
OutStreamer->EmitValueToAlignment(Alignment.value());
|
OutStreamer->emitValueToAlignment(Alignment.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
@ -3009,7 +3009,7 @@ void AsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {
|
|||||||
// their corresponding BB's address taken in IR
|
// their corresponding BB's address taken in IR
|
||||||
if (BB->hasAddressTaken())
|
if (BB->hasAddressTaken())
|
||||||
for (MCSymbol *Sym : MMI->getAddrLabelSymbolToEmit(BB))
|
for (MCSymbol *Sym : MMI->getAddrLabelSymbolToEmit(BB))
|
||||||
OutStreamer->EmitLabel(Sym);
|
OutStreamer->emitLabel(Sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print some verbose block comments.
|
// Print some verbose block comments.
|
||||||
@ -3038,7 +3038,7 @@ void AsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {
|
|||||||
} else {
|
} else {
|
||||||
if (isVerbose() && MBB.hasLabelMustBeEmitted())
|
if (isVerbose() && MBB.hasLabelMustBeEmitted())
|
||||||
OutStreamer->AddComment("Label of block must be emitted");
|
OutStreamer->AddComment("Label of block must be emitted");
|
||||||
OutStreamer->EmitLabel(MBB.getSymbol());
|
OutStreamer->emitLabel(MBB.getSymbol());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3163,8 +3163,8 @@ void AsmPrinterHandler::markFunctionEnd() {}
|
|||||||
// into this table will be given to your handler as a patch point identifier.
|
// into this table will be given to your handler as a patch point identifier.
|
||||||
void AsmPrinter::XRayFunctionEntry::emit(int Bytes, MCStreamer *Out,
|
void AsmPrinter::XRayFunctionEntry::emit(int Bytes, MCStreamer *Out,
|
||||||
const MCSymbol *CurrentFnSym) const {
|
const MCSymbol *CurrentFnSym) const {
|
||||||
Out->EmitSymbolValue(Sled, Bytes);
|
Out->emitSymbolValue(Sled, Bytes);
|
||||||
Out->EmitSymbolValue(CurrentFnSym, Bytes);
|
Out->emitSymbolValue(CurrentFnSym, Bytes);
|
||||||
auto Kind8 = static_cast<uint8_t>(Kind);
|
auto Kind8 = static_cast<uint8_t>(Kind);
|
||||||
Out->emitBinaryData(StringRef(reinterpret_cast<const char *>(&Kind8), 1));
|
Out->emitBinaryData(StringRef(reinterpret_cast<const char *>(&Kind8), 1));
|
||||||
Out->emitBinaryData(
|
Out->emitBinaryData(
|
||||||
@ -3216,20 +3216,20 @@ void AsmPrinter::emitXRayTable() {
|
|||||||
// range of sleds associated with a function.
|
// range of sleds associated with a function.
|
||||||
MCSymbol *SledsStart = OutContext.createTempSymbol("xray_sleds_start", true);
|
MCSymbol *SledsStart = OutContext.createTempSymbol("xray_sleds_start", true);
|
||||||
OutStreamer->SwitchSection(InstMap);
|
OutStreamer->SwitchSection(InstMap);
|
||||||
OutStreamer->EmitLabel(SledsStart);
|
OutStreamer->emitLabel(SledsStart);
|
||||||
for (const auto &Sled : Sleds)
|
for (const auto &Sled : Sleds)
|
||||||
Sled.emit(WordSizeBytes, OutStreamer.get(), CurrentFnSym);
|
Sled.emit(WordSizeBytes, OutStreamer.get(), CurrentFnSym);
|
||||||
MCSymbol *SledsEnd = OutContext.createTempSymbol("xray_sleds_end", true);
|
MCSymbol *SledsEnd = OutContext.createTempSymbol("xray_sleds_end", true);
|
||||||
OutStreamer->EmitLabel(SledsEnd);
|
OutStreamer->emitLabel(SledsEnd);
|
||||||
|
|
||||||
// We then emit a single entry in the index per function. We use the symbols
|
// We then emit a single entry in the index per function. We use the symbols
|
||||||
// that bound the instrumentation map as the range for a specific function.
|
// that bound the instrumentation map as the range for a specific function.
|
||||||
// Each entry here will be 2 * word size aligned, as we're writing down two
|
// Each entry here will be 2 * word size aligned, as we're writing down two
|
||||||
// pointers. This should work for both 32-bit and 64-bit platforms.
|
// pointers. This should work for both 32-bit and 64-bit platforms.
|
||||||
OutStreamer->SwitchSection(FnSledIndex);
|
OutStreamer->SwitchSection(FnSledIndex);
|
||||||
OutStreamer->EmitCodeAlignment(2 * WordSizeBytes);
|
OutStreamer->emitCodeAlignment(2 * WordSizeBytes);
|
||||||
OutStreamer->EmitSymbolValue(SledsStart, WordSizeBytes, false);
|
OutStreamer->emitSymbolValue(SledsStart, WordSizeBytes, false);
|
||||||
OutStreamer->EmitSymbolValue(SledsEnd, WordSizeBytes, false);
|
OutStreamer->emitSymbolValue(SledsEnd, WordSizeBytes, false);
|
||||||
OutStreamer->SwitchSection(PrevSection);
|
OutStreamer->SwitchSection(PrevSection);
|
||||||
Sleds.clear();
|
Sleds.clear();
|
||||||
}
|
}
|
||||||
@ -3285,7 +3285,7 @@ void AsmPrinter::emitPatchableFunctionEntries() {
|
|||||||
"__patchable_function_entries", ELF::SHT_PROGBITS, Flags));
|
"__patchable_function_entries", ELF::SHT_PROGBITS, Flags));
|
||||||
}
|
}
|
||||||
emitAlignment(Align(PointerSize));
|
emitAlignment(Align(PointerSize));
|
||||||
OutStreamer->EmitSymbolValue(CurrentPatchableFunctionEntrySym, PointerSize);
|
OutStreamer->emitSymbolValue(CurrentPatchableFunctionEntrySym, PointerSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ void AsmPrinter::emitDwarfSymbolReference(const MCSymbol *Label,
|
|||||||
|
|
||||||
// If the format uses relocations with dwarf, refer to the symbol directly.
|
// If the format uses relocations with dwarf, refer to the symbol directly.
|
||||||
if (MAI->doesDwarfUseRelocationsAcrossSections()) {
|
if (MAI->doesDwarfUseRelocationsAcrossSections()) {
|
||||||
OutStreamer->EmitSymbolValue(Label, 4);
|
OutStreamer->emitSymbolValue(Label, 4);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -549,7 +549,7 @@ void CodeViewDebug::maybeRecordLocation(const DebugLoc &DL,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CodeViewDebug::emitCodeViewMagicVersion() {
|
void CodeViewDebug::emitCodeViewMagicVersion() {
|
||||||
OS.EmitValueToAlignment(4);
|
OS.emitValueToAlignment(4);
|
||||||
OS.AddComment("Debug section magic");
|
OS.AddComment("Debug section magic");
|
||||||
OS.EmitIntValue(COFF::DEBUG_SECTION_MAGIC, 4);
|
OS.EmitIntValue(COFF::DEBUG_SECTION_MAGIC, 4);
|
||||||
}
|
}
|
||||||
@ -674,7 +674,7 @@ void CodeViewDebug::emitTypeGlobalHashes() {
|
|||||||
// hardcoded to version 0, SHA1.
|
// hardcoded to version 0, SHA1.
|
||||||
OS.SwitchSection(Asm->getObjFileLowering().getCOFFGlobalTypeHashesSection());
|
OS.SwitchSection(Asm->getObjFileLowering().getCOFFGlobalTypeHashesSection());
|
||||||
|
|
||||||
OS.EmitValueToAlignment(4);
|
OS.emitValueToAlignment(4);
|
||||||
OS.AddComment("Magic");
|
OS.AddComment("Magic");
|
||||||
OS.EmitIntValue(COFF::DEBUG_HASHES_SECTION_MAGIC, 4);
|
OS.EmitIntValue(COFF::DEBUG_HASHES_SECTION_MAGIC, 4);
|
||||||
OS.AddComment("Section Version");
|
OS.AddComment("Section Version");
|
||||||
@ -2918,14 +2918,14 @@ MCSymbol *CodeViewDebug::beginCVSubsection(DebugSubsectionKind Kind) {
|
|||||||
OS.EmitIntValue(unsigned(Kind), 4);
|
OS.EmitIntValue(unsigned(Kind), 4);
|
||||||
OS.AddComment("Subsection size");
|
OS.AddComment("Subsection size");
|
||||||
OS.emitAbsoluteSymbolDiff(EndLabel, BeginLabel, 4);
|
OS.emitAbsoluteSymbolDiff(EndLabel, BeginLabel, 4);
|
||||||
OS.EmitLabel(BeginLabel);
|
OS.emitLabel(BeginLabel);
|
||||||
return EndLabel;
|
return EndLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeViewDebug::endCVSubsection(MCSymbol *EndLabel) {
|
void CodeViewDebug::endCVSubsection(MCSymbol *EndLabel) {
|
||||||
OS.EmitLabel(EndLabel);
|
OS.emitLabel(EndLabel);
|
||||||
// Every subsection must be aligned to a 4-byte boundary.
|
// Every subsection must be aligned to a 4-byte boundary.
|
||||||
OS.EmitValueToAlignment(4);
|
OS.emitValueToAlignment(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static StringRef getSymbolName(SymbolKind SymKind) {
|
static StringRef getSymbolName(SymbolKind SymKind) {
|
||||||
@ -2940,7 +2940,7 @@ MCSymbol *CodeViewDebug::beginSymbolRecord(SymbolKind SymKind) {
|
|||||||
*EndLabel = MMI->getContext().createTempSymbol();
|
*EndLabel = MMI->getContext().createTempSymbol();
|
||||||
OS.AddComment("Record length");
|
OS.AddComment("Record length");
|
||||||
OS.emitAbsoluteSymbolDiff(EndLabel, BeginLabel, 2);
|
OS.emitAbsoluteSymbolDiff(EndLabel, BeginLabel, 2);
|
||||||
OS.EmitLabel(BeginLabel);
|
OS.emitLabel(BeginLabel);
|
||||||
if (OS.isVerboseAsm())
|
if (OS.isVerboseAsm())
|
||||||
OS.AddComment("Record kind: " + getSymbolName(SymKind));
|
OS.AddComment("Record kind: " + getSymbolName(SymKind));
|
||||||
OS.EmitIntValue(unsigned(SymKind), 2);
|
OS.EmitIntValue(unsigned(SymKind), 2);
|
||||||
@ -2952,8 +2952,8 @@ void CodeViewDebug::endSymbolRecord(MCSymbol *SymEnd) {
|
|||||||
// an extra copy of every symbol record in LLD. This increases object file
|
// an extra copy of every symbol record in LLD. This increases object file
|
||||||
// size by less than 1% in the clang build, and is compatible with the Visual
|
// size by less than 1% in the clang build, and is compatible with the Visual
|
||||||
// C++ linker.
|
// C++ linker.
|
||||||
OS.EmitValueToAlignment(4);
|
OS.emitValueToAlignment(4);
|
||||||
OS.EmitLabel(SymEnd);
|
OS.emitLabel(SymEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeViewDebug::emitEndSymbolRecord(SymbolKind EndKind) {
|
void CodeViewDebug::emitEndSymbolRecord(SymbolKind EndKind) {
|
||||||
|
@ -282,7 +282,7 @@ void DebugHandlerBase::beginInstruction(const MachineInstr *MI) {
|
|||||||
|
|
||||||
if (!PrevLabel) {
|
if (!PrevLabel) {
|
||||||
PrevLabel = MMI->getContext().createTempSymbol();
|
PrevLabel = MMI->getContext().createTempSymbol();
|
||||||
Asm->OutStreamer->EmitLabel(PrevLabel);
|
Asm->OutStreamer->emitLabel(PrevLabel);
|
||||||
}
|
}
|
||||||
I->second = PrevLabel;
|
I->second = PrevLabel;
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ void DebugHandlerBase::endInstruction() {
|
|||||||
// We need a label after this instruction.
|
// We need a label after this instruction.
|
||||||
if (!PrevLabel) {
|
if (!PrevLabel) {
|
||||||
PrevLabel = MMI->getContext().createTempSymbol();
|
PrevLabel = MMI->getContext().createTempSymbol();
|
||||||
Asm->OutStreamer->EmitLabel(PrevLabel);
|
Asm->OutStreamer->emitLabel(PrevLabel);
|
||||||
}
|
}
|
||||||
I->second = PrevLabel;
|
I->second = PrevLabel;
|
||||||
}
|
}
|
||||||
|
@ -1131,7 +1131,7 @@ void DwarfCompileUnit::emitHeader(bool UseOffsets) {
|
|||||||
// Don't bother labeling the .dwo unit, as its offset isn't used.
|
// Don't bother labeling the .dwo unit, as its offset isn't used.
|
||||||
if (!Skeleton && !DD->useSectionsAsReferences()) {
|
if (!Skeleton && !DD->useSectionsAsReferences()) {
|
||||||
LabelBegin = Asm->createTempSymbol("cu_begin");
|
LabelBegin = Asm->createTempSymbol("cu_begin");
|
||||||
Asm->OutStreamer->EmitLabel(LabelBegin);
|
Asm->OutStreamer->emitLabel(LabelBegin);
|
||||||
}
|
}
|
||||||
|
|
||||||
dwarf::UnitType UT = Skeleton ? dwarf::DW_UT_split_compile
|
dwarf::UnitType UT = Skeleton ? dwarf::DW_UT_split_compile
|
||||||
|
@ -2172,7 +2172,7 @@ void DwarfDebug::emitDebugPubSection(bool GnuStyle, StringRef Name,
|
|||||||
MCSymbol *EndLabel = Asm->createTempSymbol("pub" + Name + "_end");
|
MCSymbol *EndLabel = Asm->createTempSymbol("pub" + Name + "_end");
|
||||||
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
|
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
|
||||||
|
|
||||||
Asm->OutStreamer->EmitLabel(BeginLabel);
|
Asm->OutStreamer->emitLabel(BeginLabel);
|
||||||
|
|
||||||
Asm->OutStreamer->AddComment("DWARF Version");
|
Asm->OutStreamer->AddComment("DWARF Version");
|
||||||
Asm->emitInt16(dwarf::DW_PUBNAMES_VERSION);
|
Asm->emitInt16(dwarf::DW_PUBNAMES_VERSION);
|
||||||
@ -2205,7 +2205,7 @@ void DwarfDebug::emitDebugPubSection(bool GnuStyle, StringRef Name,
|
|||||||
|
|
||||||
Asm->OutStreamer->AddComment("End Mark");
|
Asm->OutStreamer->AddComment("End Mark");
|
||||||
Asm->emitInt32(0);
|
Asm->emitInt32(0);
|
||||||
Asm->OutStreamer->EmitLabel(EndLabel);
|
Asm->OutStreamer->emitLabel(EndLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Emit null-terminated strings into a debug str section.
|
/// Emit null-terminated strings into a debug str section.
|
||||||
@ -2364,7 +2364,7 @@ static void emitListsTableHeaderStart(AsmPrinter *Asm,
|
|||||||
// Build the table header, which starts with the length field.
|
// Build the table header, which starts with the length field.
|
||||||
Asm->OutStreamer->AddComment("Length");
|
Asm->OutStreamer->AddComment("Length");
|
||||||
Asm->emitLabelDifference(TableEnd, TableStart, 4);
|
Asm->emitLabelDifference(TableEnd, TableStart, 4);
|
||||||
Asm->OutStreamer->EmitLabel(TableStart);
|
Asm->OutStreamer->emitLabel(TableStart);
|
||||||
// Version number (DWARF v5 and later).
|
// Version number (DWARF v5 and later).
|
||||||
Asm->OutStreamer->AddComment("Version");
|
Asm->OutStreamer->AddComment("Version");
|
||||||
Asm->emitInt16(Asm->OutStreamer->getContext().getDwarfVersion());
|
Asm->emitInt16(Asm->OutStreamer->getContext().getDwarfVersion());
|
||||||
@ -2387,7 +2387,7 @@ static MCSymbol *emitRnglistsTableHeader(AsmPrinter *Asm,
|
|||||||
|
|
||||||
Asm->OutStreamer->AddComment("Offset entry count");
|
Asm->OutStreamer->AddComment("Offset entry count");
|
||||||
Asm->emitInt32(Holder.getRangeLists().size());
|
Asm->emitInt32(Holder.getRangeLists().size());
|
||||||
Asm->OutStreamer->EmitLabel(Holder.getRnglistsTableBaseSym());
|
Asm->OutStreamer->emitLabel(Holder.getRnglistsTableBaseSym());
|
||||||
|
|
||||||
for (const RangeSpanList &List : Holder.getRangeLists())
|
for (const RangeSpanList &List : Holder.getRangeLists())
|
||||||
Asm->emitLabelDifference(List.Label, Holder.getRnglistsTableBaseSym(), 4);
|
Asm->emitLabelDifference(List.Label, Holder.getRnglistsTableBaseSym(), 4);
|
||||||
@ -2408,7 +2408,7 @@ static MCSymbol *emitLoclistsTableHeader(AsmPrinter *Asm,
|
|||||||
|
|
||||||
Asm->OutStreamer->AddComment("Offset entry count");
|
Asm->OutStreamer->AddComment("Offset entry count");
|
||||||
Asm->emitInt32(DebugLocs.getLists().size());
|
Asm->emitInt32(DebugLocs.getLists().size());
|
||||||
Asm->OutStreamer->EmitLabel(DebugLocs.getSym());
|
Asm->OutStreamer->emitLabel(DebugLocs.getSym());
|
||||||
|
|
||||||
for (const auto &List : DebugLocs.getLists())
|
for (const auto &List : DebugLocs.getLists())
|
||||||
Asm->emitLabelDifference(List.Label, DebugLocs.getSym(), 4);
|
Asm->emitLabelDifference(List.Label, DebugLocs.getSym(), 4);
|
||||||
@ -2429,7 +2429,7 @@ static void emitRangeList(
|
|||||||
bool UseDwarf5 = DD.getDwarfVersion() >= 5;
|
bool UseDwarf5 = DD.getDwarfVersion() >= 5;
|
||||||
|
|
||||||
// Emit our symbol so we can find the beginning of the range.
|
// Emit our symbol so we can find the beginning of the range.
|
||||||
Asm->OutStreamer->EmitLabel(Sym);
|
Asm->OutStreamer->emitLabel(Sym);
|
||||||
|
|
||||||
// Gather all the ranges that apply to the same section so they can share
|
// Gather all the ranges that apply to the same section so they can share
|
||||||
// a base address entry.
|
// a base address entry.
|
||||||
@ -2450,7 +2450,7 @@ static void emitRangeList(
|
|||||||
BaseIsSet = true;
|
BaseIsSet = true;
|
||||||
Asm->OutStreamer->EmitIntValue(-1, Size);
|
Asm->OutStreamer->EmitIntValue(-1, Size);
|
||||||
Asm->OutStreamer->AddComment(" base address");
|
Asm->OutStreamer->AddComment(" base address");
|
||||||
Asm->OutStreamer->EmitSymbolValue(Base, Size);
|
Asm->OutStreamer->emitSymbolValue(Base, Size);
|
||||||
} else if (NewBase != Begin || P.second.size() > 1) {
|
} else if (NewBase != Begin || P.second.size() > 1) {
|
||||||
// Only use a base address if
|
// Only use a base address if
|
||||||
// * the existing pool address doesn't match (NewBase != Begin)
|
// * the existing pool address doesn't match (NewBase != Begin)
|
||||||
@ -2495,8 +2495,8 @@ static void emitRangeList(
|
|||||||
Asm->OutStreamer->AddComment(" length");
|
Asm->OutStreamer->AddComment(" length");
|
||||||
Asm->emitLabelDifferenceAsULEB128(End, Begin);
|
Asm->emitLabelDifferenceAsULEB128(End, Begin);
|
||||||
} else {
|
} else {
|
||||||
Asm->OutStreamer->EmitSymbolValue(Begin, Size);
|
Asm->OutStreamer->emitSymbolValue(Begin, Size);
|
||||||
Asm->OutStreamer->EmitSymbolValue(End, Size);
|
Asm->OutStreamer->emitSymbolValue(End, Size);
|
||||||
}
|
}
|
||||||
EmitPayload(*RS);
|
EmitPayload(*RS);
|
||||||
}
|
}
|
||||||
@ -2538,7 +2538,7 @@ void DwarfDebug::emitDebugLocImpl(MCSection *Sec) {
|
|||||||
emitLocList(*this, Asm, List);
|
emitLocList(*this, Asm, List);
|
||||||
|
|
||||||
if (TableEnd)
|
if (TableEnd)
|
||||||
Asm->OutStreamer->EmitLabel(TableEnd);
|
Asm->OutStreamer->emitLabel(TableEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit locations into the .debug_loc/.debug_loclists section.
|
// Emit locations into the .debug_loc/.debug_loclists section.
|
||||||
@ -2561,7 +2561,7 @@ void DwarfDebug::emitDebugLocDWO() {
|
|||||||
for (const auto &List : DebugLocs.getLists()) {
|
for (const auto &List : DebugLocs.getLists()) {
|
||||||
Asm->OutStreamer->SwitchSection(
|
Asm->OutStreamer->SwitchSection(
|
||||||
Asm->getObjFileLowering().getDwarfLocDWOSection());
|
Asm->getObjFileLowering().getDwarfLocDWOSection());
|
||||||
Asm->OutStreamer->EmitLabel(List.Label);
|
Asm->OutStreamer->emitLabel(List.Label);
|
||||||
|
|
||||||
for (const auto &Entry : DebugLocs.getEntries(List)) {
|
for (const auto &Entry : DebugLocs.getEntries(List)) {
|
||||||
// GDB only supports startx_length in pre-standard split-DWARF.
|
// GDB only supports startx_length in pre-standard split-DWARF.
|
||||||
@ -2776,7 +2776,7 @@ void DwarfDebug::emitDebugRangesImpl(const DwarfFile &Holder, MCSection *Section
|
|||||||
emitRangeList(*this, Asm, List);
|
emitRangeList(*this, Asm, List);
|
||||||
|
|
||||||
if (TableEnd)
|
if (TableEnd)
|
||||||
Asm->OutStreamer->EmitLabel(TableEnd);
|
Asm->OutStreamer->emitLabel(TableEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Emit address ranges into the .debug_ranges section or into the DWARF v5
|
/// Emit address ranges into the .debug_ranges section or into the DWARF v5
|
||||||
@ -2839,7 +2839,7 @@ void DwarfDebug::emitDebugMacinfoImpl(MCSection *Section) {
|
|||||||
if (Macros.empty())
|
if (Macros.empty())
|
||||||
continue;
|
continue;
|
||||||
Asm->OutStreamer->SwitchSection(Section);
|
Asm->OutStreamer->SwitchSection(Section);
|
||||||
Asm->OutStreamer->EmitLabel(U.getMacroLabelBegin());
|
Asm->OutStreamer->emitLabel(U.getMacroLabelBegin());
|
||||||
handleMacroNodes(Macros, U);
|
handleMacroNodes(Macros, U);
|
||||||
Asm->OutStreamer->AddComment("End Of Macro List Mark");
|
Asm->OutStreamer->AddComment("End Of Macro List Mark");
|
||||||
Asm->emitInt8(0);
|
Asm->emitInt8(0);
|
||||||
|
@ -53,7 +53,7 @@ void DwarfFile::emitUnit(DwarfUnit *TheU, bool UseOffsets) {
|
|||||||
Asm->emitDwarfDIE(TheU->getUnitDie());
|
Asm->emitDwarfDIE(TheU->getUnitDie());
|
||||||
|
|
||||||
if (MCSymbol *EndLabel = TheU->getEndLabel())
|
if (MCSymbol *EndLabel = TheU->getEndLabel())
|
||||||
Asm->OutStreamer->EmitLabel(EndLabel);
|
Asm->OutStreamer->emitLabel(EndLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute the size and offset for each DIE.
|
// Compute the size and offset for each DIE.
|
||||||
|
@ -71,7 +71,7 @@ void DwarfStringPool::emitStringOffsetsTableHeader(AsmPrinter &Asm,
|
|||||||
// referenced by most unit headers via DW_AT_str_offsets_base.
|
// referenced by most unit headers via DW_AT_str_offsets_base.
|
||||||
// Split units do not use the attribute.
|
// Split units do not use the attribute.
|
||||||
if (StartSym)
|
if (StartSym)
|
||||||
Asm.OutStreamer->EmitLabel(StartSym);
|
Asm.OutStreamer->emitLabel(StartSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DwarfStringPool::emit(AsmPrinter &Asm, MCSection *StrSection,
|
void DwarfStringPool::emit(AsmPrinter &Asm, MCSection *StrSection,
|
||||||
@ -100,7 +100,7 @@ void DwarfStringPool::emit(AsmPrinter &Asm, MCSection *StrSection,
|
|||||||
|
|
||||||
// Emit a label for reference from debug information entries.
|
// Emit a label for reference from debug information entries.
|
||||||
if (ShouldCreateSymbols)
|
if (ShouldCreateSymbols)
|
||||||
Asm.OutStreamer->EmitLabel(Entry->getValue().Symbol);
|
Asm.OutStreamer->emitLabel(Entry->getValue().Symbol);
|
||||||
|
|
||||||
// Emit the string itself with a terminating null byte.
|
// Emit the string itself with a terminating null byte.
|
||||||
Asm.OutStreamer->AddComment("string offset=" +
|
Asm.OutStreamer->AddComment("string offset=" +
|
||||||
|
@ -1629,7 +1629,7 @@ void DwarfUnit::emitCommonHeader(bool UseOffsets, dwarf::UnitType UT) {
|
|||||||
MCSymbol *BeginLabel = Asm->createTempSymbol(Prefix + "start");
|
MCSymbol *BeginLabel = Asm->createTempSymbol(Prefix + "start");
|
||||||
EndLabel = Asm->createTempSymbol(Prefix + "end");
|
EndLabel = Asm->createTempSymbol(Prefix + "end");
|
||||||
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
|
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
|
||||||
Asm->OutStreamer->EmitLabel(BeginLabel);
|
Asm->OutStreamer->emitLabel(BeginLabel);
|
||||||
} else
|
} else
|
||||||
Asm->emitInt32(getHeaderSize() + getUnitDie().getSize());
|
Asm->emitInt32(getHeaderSize() + getUnitDie().getSize());
|
||||||
|
|
||||||
|
@ -432,8 +432,8 @@ MCSymbol *EHStreamer::emitExceptionTable() {
|
|||||||
MCSymbol *GCCETSym =
|
MCSymbol *GCCETSym =
|
||||||
Asm->OutContext.getOrCreateSymbol(Twine("GCC_except_table")+
|
Asm->OutContext.getOrCreateSymbol(Twine("GCC_except_table")+
|
||||||
Twine(Asm->getFunctionNumber()));
|
Twine(Asm->getFunctionNumber()));
|
||||||
Asm->OutStreamer->EmitLabel(GCCETSym);
|
Asm->OutStreamer->emitLabel(GCCETSym);
|
||||||
Asm->OutStreamer->EmitLabel(Asm->getCurExceptionSym());
|
Asm->OutStreamer->emitLabel(Asm->getCurExceptionSym());
|
||||||
|
|
||||||
// Emit the LSDA header.
|
// Emit the LSDA header.
|
||||||
Asm->emitEncodingByte(dwarf::DW_EH_PE_omit, "@LPStart");
|
Asm->emitEncodingByte(dwarf::DW_EH_PE_omit, "@LPStart");
|
||||||
@ -448,7 +448,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
|
|||||||
MCSymbol *TTBaseRefLabel = Asm->createTempSymbol("ttbaseref");
|
MCSymbol *TTBaseRefLabel = Asm->createTempSymbol("ttbaseref");
|
||||||
TTBaseLabel = Asm->createTempSymbol("ttbase");
|
TTBaseLabel = Asm->createTempSymbol("ttbase");
|
||||||
Asm->emitLabelDifferenceAsULEB128(TTBaseLabel, TTBaseRefLabel);
|
Asm->emitLabelDifferenceAsULEB128(TTBaseLabel, TTBaseRefLabel);
|
||||||
Asm->OutStreamer->EmitLabel(TTBaseRefLabel);
|
Asm->OutStreamer->emitLabel(TTBaseRefLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VerboseAsm = Asm->OutStreamer->isVerboseAsm();
|
bool VerboseAsm = Asm->OutStreamer->isVerboseAsm();
|
||||||
@ -458,7 +458,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
|
|||||||
MCSymbol *CstEndLabel = Asm->createTempSymbol("cst_end");
|
MCSymbol *CstEndLabel = Asm->createTempSymbol("cst_end");
|
||||||
Asm->emitEncodingByte(CallSiteEncoding, "Call site");
|
Asm->emitEncodingByte(CallSiteEncoding, "Call site");
|
||||||
Asm->emitLabelDifferenceAsULEB128(CstEndLabel, CstBeginLabel);
|
Asm->emitLabelDifferenceAsULEB128(CstEndLabel, CstBeginLabel);
|
||||||
Asm->OutStreamer->EmitLabel(CstBeginLabel);
|
Asm->OutStreamer->emitLabel(CstBeginLabel);
|
||||||
|
|
||||||
// SjLj / Wasm Exception handling
|
// SjLj / Wasm Exception handling
|
||||||
if (IsSJLJ || IsWasm) {
|
if (IsSJLJ || IsWasm) {
|
||||||
@ -557,7 +557,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
|
|||||||
Asm->emitULEB128(S.Action);
|
Asm->emitULEB128(S.Action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Asm->OutStreamer->EmitLabel(CstEndLabel);
|
Asm->OutStreamer->emitLabel(CstEndLabel);
|
||||||
|
|
||||||
// Emit the Action Table.
|
// Emit the Action Table.
|
||||||
int Entry = 0;
|
int Entry = 0;
|
||||||
@ -632,7 +632,7 @@ void EHStreamer::emitTypeInfos(unsigned TTypeEncoding, MCSymbol *TTBaseLabel) {
|
|||||||
Asm->emitTTypeReference(GV, TTypeEncoding);
|
Asm->emitTTypeReference(GV, TTypeEncoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
Asm->OutStreamer->EmitLabel(TTBaseLabel);
|
Asm->OutStreamer->emitLabel(TTBaseLabel);
|
||||||
|
|
||||||
// Emit the Exception Specifications.
|
// Emit the Exception Specifications.
|
||||||
if (VerboseAsm && !FilterIds.empty()) {
|
if (VerboseAsm && !FilterIds.empty()) {
|
||||||
|
@ -67,7 +67,7 @@ static void EmitCamlGlobal(const Module &M, AsmPrinter &AP, const char *Id) {
|
|||||||
MCSymbol *Sym = AP.OutContext.getOrCreateSymbol(TmpStr);
|
MCSymbol *Sym = AP.OutContext.getOrCreateSymbol(TmpStr);
|
||||||
|
|
||||||
AP.OutStreamer->emitSymbolAttribute(Sym, MCSA_Global);
|
AP.OutStreamer->emitSymbolAttribute(Sym, MCSA_Global);
|
||||||
AP.OutStreamer->EmitLabel(Sym);
|
AP.OutStreamer->emitLabel(Sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OcamlGCMetadataPrinter::beginAssembly(Module &M, GCModuleInfo &Info,
|
void OcamlGCMetadataPrinter::beginAssembly(Module &M, GCModuleInfo &Info,
|
||||||
@ -164,7 +164,7 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
|
|||||||
Twine(LiveCount) + " >= 65536.");
|
Twine(LiveCount) + " >= 65536.");
|
||||||
}
|
}
|
||||||
|
|
||||||
AP.OutStreamer->EmitSymbolValue(J->Label, IntPtrSize);
|
AP.OutStreamer->emitSymbolValue(J->Label, IntPtrSize);
|
||||||
AP.emitInt16(FrameSize);
|
AP.emitInt16(FrameSize);
|
||||||
AP.emitInt16(LiveCount);
|
AP.emitInt16(LiveCount);
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ void WasmException::endModule() {
|
|||||||
Mangler::getNameWithPrefix(NameStr, "__cpp_exception", Asm->getDataLayout());
|
Mangler::getNameWithPrefix(NameStr, "__cpp_exception", Asm->getDataLayout());
|
||||||
if (Asm->OutContext.lookupSymbol(NameStr)) {
|
if (Asm->OutContext.lookupSymbol(NameStr)) {
|
||||||
MCSymbol *ExceptionSym = Asm->GetExternalSymbolSymbol("__cpp_exception");
|
MCSymbol *ExceptionSym = Asm->GetExternalSymbolSymbol("__cpp_exception");
|
||||||
Asm->OutStreamer->EmitLabel(ExceptionSym);
|
Asm->OutStreamer->emitLabel(ExceptionSym);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ void WasmException::endFunction(const MachineFunction *MF) {
|
|||||||
// end marker and set the size as the difference between the start end the end
|
// end marker and set the size as the difference between the start end the end
|
||||||
// marker.
|
// marker.
|
||||||
MCSymbol *LSDAEndLabel = Asm->createTempSymbol("GCC_except_table_end");
|
MCSymbol *LSDAEndLabel = Asm->createTempSymbol("GCC_except_table_end");
|
||||||
Asm->OutStreamer->EmitLabel(LSDAEndLabel);
|
Asm->OutStreamer->emitLabel(LSDAEndLabel);
|
||||||
MCContext &OutContext = Asm->OutStreamer->getContext();
|
MCContext &OutContext = Asm->OutStreamer->getContext();
|
||||||
const MCExpr *SizeExp = MCBinaryExpr::createSub(
|
const MCExpr *SizeExp = MCBinaryExpr::createSub(
|
||||||
MCSymbolRefExpr::create(LSDAEndLabel, OutContext),
|
MCSymbolRefExpr::create(LSDAEndLabel, OutContext),
|
||||||
|
@ -207,7 +207,7 @@ void WinException::beginFunclet(const MachineBasicBlock &MBB,
|
|||||||
&F);
|
&F);
|
||||||
|
|
||||||
// Now that we've emitted the alignment directive, point at our funclet.
|
// Now that we've emitted the alignment directive, point at our funclet.
|
||||||
Asm->OutStreamer->EmitLabel(Sym);
|
Asm->OutStreamer->emitLabel(Sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark 'Sym' as starting our funclet.
|
// Mark 'Sym' as starting our funclet.
|
||||||
@ -581,7 +581,7 @@ void WinException::emitCSpecificHandlerTable(const MachineFunction *MF) {
|
|||||||
AddComment("Number of call sites");
|
AddComment("Number of call sites");
|
||||||
OS.EmitValue(EntryCount, 4);
|
OS.EmitValue(EntryCount, 4);
|
||||||
|
|
||||||
OS.EmitLabel(TableBegin);
|
OS.emitLabel(TableBegin);
|
||||||
|
|
||||||
// Iterate over all the invoke try ranges. Unlike MSVC, LLVM currently only
|
// Iterate over all the invoke try ranges. Unlike MSVC, LLVM currently only
|
||||||
// models exceptions from invokes. LLVM also allows arbitrary reordering of
|
// models exceptions from invokes. LLVM also allows arbitrary reordering of
|
||||||
@ -609,7 +609,7 @@ void WinException::emitCSpecificHandlerTable(const MachineFunction *MF) {
|
|||||||
LastEHState = StateChange.NewState;
|
LastEHState = StateChange.NewState;
|
||||||
}
|
}
|
||||||
|
|
||||||
OS.EmitLabel(TableEnd);
|
OS.emitLabel(TableEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinException::emitSEHActionsForRange(const WinEHFuncInfo &FuncInfo,
|
void WinException::emitSEHActionsForRange(const WinEHFuncInfo &FuncInfo,
|
||||||
@ -713,8 +713,8 @@ void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) {
|
|||||||
// EHFlags & 1 -> Synchronous exceptions only, no async exceptions.
|
// EHFlags & 1 -> Synchronous exceptions only, no async exceptions.
|
||||||
// EHFlags & 2 -> ???
|
// EHFlags & 2 -> ???
|
||||||
// EHFlags & 4 -> The function is noexcept(true), unwinding can't continue.
|
// EHFlags & 4 -> The function is noexcept(true), unwinding can't continue.
|
||||||
OS.EmitValueToAlignment(4);
|
OS.emitValueToAlignment(4);
|
||||||
OS.EmitLabel(FuncInfoXData);
|
OS.emitLabel(FuncInfoXData);
|
||||||
|
|
||||||
AddComment("MagicNumber");
|
AddComment("MagicNumber");
|
||||||
OS.EmitIntValue(0x19930522, 4);
|
OS.EmitIntValue(0x19930522, 4);
|
||||||
@ -753,7 +753,7 @@ void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) {
|
|||||||
// void (*Action)();
|
// void (*Action)();
|
||||||
// };
|
// };
|
||||||
if (UnwindMapXData) {
|
if (UnwindMapXData) {
|
||||||
OS.EmitLabel(UnwindMapXData);
|
OS.emitLabel(UnwindMapXData);
|
||||||
for (const CxxUnwindMapEntry &UME : FuncInfo.CxxUnwindMap) {
|
for (const CxxUnwindMapEntry &UME : FuncInfo.CxxUnwindMap) {
|
||||||
MCSymbol *CleanupSym =
|
MCSymbol *CleanupSym =
|
||||||
getMCSymbolForMBB(Asm, UME.Cleanup.dyn_cast<MachineBasicBlock *>());
|
getMCSymbolForMBB(Asm, UME.Cleanup.dyn_cast<MachineBasicBlock *>());
|
||||||
@ -773,7 +773,7 @@ void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) {
|
|||||||
// HandlerType *HandlerArray;
|
// HandlerType *HandlerArray;
|
||||||
// };
|
// };
|
||||||
if (TryBlockMapXData) {
|
if (TryBlockMapXData) {
|
||||||
OS.EmitLabel(TryBlockMapXData);
|
OS.emitLabel(TryBlockMapXData);
|
||||||
SmallVector<MCSymbol *, 1> HandlerMaps;
|
SmallVector<MCSymbol *, 1> HandlerMaps;
|
||||||
for (size_t I = 0, E = FuncInfo.TryBlockMap.size(); I != E; ++I) {
|
for (size_t I = 0, E = FuncInfo.TryBlockMap.size(); I != E; ++I) {
|
||||||
const WinEHTryBlockMapEntry &TBME = FuncInfo.TryBlockMap[I];
|
const WinEHTryBlockMapEntry &TBME = FuncInfo.TryBlockMap[I];
|
||||||
@ -829,7 +829,7 @@ void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) {
|
|||||||
// void (*Handler)();
|
// void (*Handler)();
|
||||||
// int32_t ParentFrameOffset; // x64 and AArch64 only
|
// int32_t ParentFrameOffset; // x64 and AArch64 only
|
||||||
// };
|
// };
|
||||||
OS.EmitLabel(HandlerMapXData);
|
OS.emitLabel(HandlerMapXData);
|
||||||
for (const WinEHHandlerType &HT : TBME.HandlerArray) {
|
for (const WinEHHandlerType &HT : TBME.HandlerArray) {
|
||||||
// Get the frame escape label with the offset of the catch object. If
|
// Get the frame escape label with the offset of the catch object. If
|
||||||
// the index is INT_MAX, then there is no catch object, and we should
|
// the index is INT_MAX, then there is no catch object, and we should
|
||||||
@ -871,7 +871,7 @@ void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) {
|
|||||||
// int32_t State;
|
// int32_t State;
|
||||||
// };
|
// };
|
||||||
if (IPToStateXData) {
|
if (IPToStateXData) {
|
||||||
OS.EmitLabel(IPToStateXData);
|
OS.emitLabel(IPToStateXData);
|
||||||
for (auto &IPStatePair : IPToStateTable) {
|
for (auto &IPStatePair : IPToStateTable) {
|
||||||
AddComment("IP");
|
AddComment("IP");
|
||||||
OS.EmitValue(IPStatePair.first, 4);
|
OS.EmitValue(IPStatePair.first, 4);
|
||||||
@ -979,8 +979,8 @@ void WinException::emitExceptHandlerTable(const MachineFunction *MF) {
|
|||||||
|
|
||||||
// Emit the __ehtable label that we use for llvm.x86.seh.lsda.
|
// Emit the __ehtable label that we use for llvm.x86.seh.lsda.
|
||||||
MCSymbol *LSDALabel = Asm->OutContext.getOrCreateLSDASymbol(FLinkageName);
|
MCSymbol *LSDALabel = Asm->OutContext.getOrCreateLSDASymbol(FLinkageName);
|
||||||
OS.EmitValueToAlignment(4);
|
OS.emitValueToAlignment(4);
|
||||||
OS.EmitLabel(LSDALabel);
|
OS.emitLabel(LSDALabel);
|
||||||
|
|
||||||
const auto *Per = cast<Function>(F.getPersonalityFn()->stripPointerCasts());
|
const auto *Per = cast<Function>(F.getPersonalityFn()->stripPointerCasts());
|
||||||
StringRef PerName = Per->getName();
|
StringRef PerName = Per->getName();
|
||||||
|
@ -57,7 +57,7 @@ void FaultMaps::serializeToFaultMapSection() {
|
|||||||
OS.SwitchSection(FaultMapSection);
|
OS.SwitchSection(FaultMapSection);
|
||||||
|
|
||||||
// Emit a dummy symbol to force section inclusion.
|
// Emit a dummy symbol to force section inclusion.
|
||||||
OS.EmitLabel(OutContext.getOrCreateSymbol(Twine("__LLVM_FaultMaps")));
|
OS.emitLabel(OutContext.getOrCreateSymbol(Twine("__LLVM_FaultMaps")));
|
||||||
|
|
||||||
LLVM_DEBUG(dbgs() << "********** Fault Map Output **********\n");
|
LLVM_DEBUG(dbgs() << "********** Fault Map Output **********\n");
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ void FaultMaps::emitFunctionInfo(const MCSymbol *FnLabel,
|
|||||||
MCStreamer &OS = *AP.OutStreamer;
|
MCStreamer &OS = *AP.OutStreamer;
|
||||||
|
|
||||||
LLVM_DEBUG(dbgs() << WFMP << " function addr: " << *FnLabel << "\n");
|
LLVM_DEBUG(dbgs() << WFMP << " function addr: " << *FnLabel << "\n");
|
||||||
OS.EmitSymbolValue(FnLabel, 8);
|
OS.emitSymbolValue(FnLabel, 8);
|
||||||
|
|
||||||
LLVM_DEBUG(dbgs() << WFMP << " #faulting PCs: " << FFI.size() << "\n");
|
LLVM_DEBUG(dbgs() << WFMP << " #faulting PCs: " << FFI.size() << "\n");
|
||||||
OS.EmitIntValue(FFI.size(), 4);
|
OS.EmitIntValue(FFI.size(), 4);
|
||||||
|
@ -442,7 +442,7 @@ void StackMaps::emitFunctionFrameRecords(MCStreamer &OS) {
|
|||||||
LLVM_DEBUG(dbgs() << WSMP << "function addr: " << FR.first
|
LLVM_DEBUG(dbgs() << WSMP << "function addr: " << FR.first
|
||||||
<< " frame size: " << FR.second.StackSize
|
<< " frame size: " << FR.second.StackSize
|
||||||
<< " callsite count: " << FR.second.RecordCount << '\n');
|
<< " callsite count: " << FR.second.RecordCount << '\n');
|
||||||
OS.EmitSymbolValue(FR.first, 8);
|
OS.emitSymbolValue(FR.first, 8);
|
||||||
OS.EmitIntValue(FR.second.StackSize, 8);
|
OS.EmitIntValue(FR.second.StackSize, 8);
|
||||||
OS.EmitIntValue(FR.second.RecordCount, 8);
|
OS.EmitIntValue(FR.second.RecordCount, 8);
|
||||||
}
|
}
|
||||||
@ -528,7 +528,7 @@ void StackMaps::emitCallsiteEntries(MCStreamer &OS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Emit alignment to 8 byte.
|
// Emit alignment to 8 byte.
|
||||||
OS.EmitValueToAlignment(8);
|
OS.emitValueToAlignment(8);
|
||||||
|
|
||||||
// Num live-out registers and padding to align to 4 byte.
|
// Num live-out registers and padding to align to 4 byte.
|
||||||
OS.EmitIntValue(0, 2);
|
OS.EmitIntValue(0, 2);
|
||||||
@ -540,7 +540,7 @@ void StackMaps::emitCallsiteEntries(MCStreamer &OS) {
|
|||||||
OS.EmitIntValue(LO.Size, 1);
|
OS.EmitIntValue(LO.Size, 1);
|
||||||
}
|
}
|
||||||
// Emit alignment to 8 byte.
|
// Emit alignment to 8 byte.
|
||||||
OS.EmitValueToAlignment(8);
|
OS.emitValueToAlignment(8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -564,7 +564,7 @@ void StackMaps::serializeToStackMapSection() {
|
|||||||
OS.SwitchSection(StackMapSection);
|
OS.SwitchSection(StackMapSection);
|
||||||
|
|
||||||
// Emit a dummy symbol to force section inclusion.
|
// Emit a dummy symbol to force section inclusion.
|
||||||
OS.EmitLabel(OutContext.getOrCreateSymbol(Twine("__LLVM_StackMaps")));
|
OS.emitLabel(OutContext.getOrCreateSymbol(Twine("__LLVM_StackMaps")));
|
||||||
|
|
||||||
// Serialize data.
|
// Serialize data.
|
||||||
LLVM_DEBUG(dbgs() << "********** Stack Map Output **********\n");
|
LLVM_DEBUG(dbgs() << "********** Stack Map Output **********\n");
|
||||||
|
@ -304,7 +304,7 @@ void TargetLoweringObjectFileELF::emitModuleMetadata(MCStreamer &Streamer,
|
|||||||
if (!Section.empty()) {
|
if (!Section.empty()) {
|
||||||
auto *S = C.getELFSection(Section, ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
|
auto *S = C.getELFSection(Section, ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
|
||||||
Streamer.SwitchSection(S);
|
Streamer.SwitchSection(S);
|
||||||
Streamer.EmitLabel(C.getOrCreateSymbol(StringRef("OBJC_IMAGE_INFO")));
|
Streamer.emitLabel(C.getOrCreateSymbol(StringRef("OBJC_IMAGE_INFO")));
|
||||||
Streamer.EmitIntValue(Version, 4);
|
Streamer.EmitIntValue(Version, 4);
|
||||||
Streamer.EmitIntValue(Flags, 4);
|
Streamer.EmitIntValue(Flags, 4);
|
||||||
Streamer.AddBlankLine();
|
Streamer.AddBlankLine();
|
||||||
@ -377,13 +377,13 @@ void TargetLoweringObjectFileELF::emitPersonalityValue(
|
|||||||
ELF::SHT_PROGBITS, Flags, 0);
|
ELF::SHT_PROGBITS, Flags, 0);
|
||||||
unsigned Size = DL.getPointerSize();
|
unsigned Size = DL.getPointerSize();
|
||||||
Streamer.SwitchSection(Sec);
|
Streamer.SwitchSection(Sec);
|
||||||
Streamer.EmitValueToAlignment(DL.getPointerABIAlignment(0).value());
|
Streamer.emitValueToAlignment(DL.getPointerABIAlignment(0).value());
|
||||||
Streamer.emitSymbolAttribute(Label, MCSA_ELF_TypeObject);
|
Streamer.emitSymbolAttribute(Label, MCSA_ELF_TypeObject);
|
||||||
const MCExpr *E = MCConstantExpr::create(Size, getContext());
|
const MCExpr *E = MCConstantExpr::create(Size, getContext());
|
||||||
Streamer.emitELFSize(Label, E);
|
Streamer.emitELFSize(Label, E);
|
||||||
Streamer.EmitLabel(Label);
|
Streamer.emitLabel(Label);
|
||||||
|
|
||||||
Streamer.EmitSymbolValue(Sym, Size);
|
Streamer.emitSymbolValue(Sym, Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
const MCExpr *TargetLoweringObjectFileELF::getTTypeGlobalReference(
|
const MCExpr *TargetLoweringObjectFileELF::getTTypeGlobalReference(
|
||||||
@ -918,7 +918,7 @@ void TargetLoweringObjectFileMachO::emitModuleMetadata(MCStreamer &Streamer,
|
|||||||
MCSectionMachO *S = getContext().getMachOSection(
|
MCSectionMachO *S = getContext().getMachOSection(
|
||||||
Segment, Section, TAA, StubSize, SectionKind::getData());
|
Segment, Section, TAA, StubSize, SectionKind::getData());
|
||||||
Streamer.SwitchSection(S);
|
Streamer.SwitchSection(S);
|
||||||
Streamer.EmitLabel(getContext().
|
Streamer.emitLabel(getContext().
|
||||||
getOrCreateSymbol(StringRef("L_OBJC_IMAGE_INFO")));
|
getOrCreateSymbol(StringRef("L_OBJC_IMAGE_INFO")));
|
||||||
Streamer.EmitIntValue(VersionVal, 4);
|
Streamer.EmitIntValue(VersionVal, 4);
|
||||||
Streamer.EmitIntValue(ImageInfoFlags, 4);
|
Streamer.EmitIntValue(ImageInfoFlags, 4);
|
||||||
@ -1472,7 +1472,7 @@ void TargetLoweringObjectFileCOFF::emitModuleMetadata(MCStreamer &Streamer,
|
|||||||
Section, COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ,
|
Section, COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ,
|
||||||
SectionKind::getReadOnly());
|
SectionKind::getReadOnly());
|
||||||
Streamer.SwitchSection(S);
|
Streamer.SwitchSection(S);
|
||||||
Streamer.EmitLabel(C.getOrCreateSymbol(StringRef("OBJC_IMAGE_INFO")));
|
Streamer.emitLabel(C.getOrCreateSymbol(StringRef("OBJC_IMAGE_INFO")));
|
||||||
Streamer.EmitIntValue(Version, 4);
|
Streamer.EmitIntValue(Version, 4);
|
||||||
Streamer.EmitIntValue(Flags, 4);
|
Streamer.EmitIntValue(Flags, 4);
|
||||||
Streamer.AddBlankLine();
|
Streamer.AddBlankLine();
|
||||||
|
@ -28,8 +28,8 @@ void ConstantPool::emitEntries(MCStreamer &Streamer) {
|
|||||||
return;
|
return;
|
||||||
Streamer.emitDataRegion(MCDR_DataRegion);
|
Streamer.emitDataRegion(MCDR_DataRegion);
|
||||||
for (const ConstantPoolEntry &Entry : Entries) {
|
for (const ConstantPoolEntry &Entry : Entries) {
|
||||||
Streamer.EmitCodeAlignment(Entry.Size); // align naturally
|
Streamer.emitCodeAlignment(Entry.Size); // align naturally
|
||||||
Streamer.EmitLabel(Entry.Label);
|
Streamer.emitLabel(Entry.Label);
|
||||||
Streamer.EmitValue(Entry.Value, Entry.Size, Entry.Loc);
|
Streamer.EmitValue(Entry.Value, Entry.Size, Entry.Loc);
|
||||||
}
|
}
|
||||||
Streamer.emitDataRegion(MCDR_DataRegionEnd);
|
Streamer.emitDataRegion(MCDR_DataRegionEnd);
|
||||||
|
@ -95,7 +95,7 @@ MCAsmInfo::getExprForFDESymbol(const MCSymbol *Sym,
|
|||||||
MCContext &Context = Streamer.getContext();
|
MCContext &Context = Streamer.getContext();
|
||||||
const MCExpr *Res = MCSymbolRefExpr::create(Sym, Context);
|
const MCExpr *Res = MCSymbolRefExpr::create(Sym, Context);
|
||||||
MCSymbol *PCSym = Context.createTempSymbol();
|
MCSymbol *PCSym = Context.createTempSymbol();
|
||||||
Streamer.EmitLabel(PCSym);
|
Streamer.emitLabel(PCSym);
|
||||||
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, Context);
|
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, Context);
|
||||||
return MCBinaryExpr::createSub(Res, PC, Context);
|
return MCBinaryExpr::createSub(Res, PC, Context);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public:
|
|||||||
const MCSymbol *Aliasee) override;
|
const MCSymbol *Aliasee) override;
|
||||||
|
|
||||||
void emitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args) override;
|
void emitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args) override;
|
||||||
void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
||||||
|
|
||||||
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
|
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
|
||||||
void emitLinkerOptions(ArrayRef<std::string> Options) override;
|
void emitLinkerOptions(ArrayRef<std::string> Options) override;
|
||||||
@ -192,7 +192,7 @@ public:
|
|||||||
|
|
||||||
void emitBytes(StringRef Data) override;
|
void emitBytes(StringRef Data) override;
|
||||||
|
|
||||||
void EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc = SMLoc()) override;
|
SMLoc Loc = SMLoc()) override;
|
||||||
void EmitIntValue(uint64_t Value, unsigned Size) override;
|
void EmitIntValue(uint64_t Value, unsigned Size) override;
|
||||||
void EmitIntValueInHex(uint64_t Value, unsigned Size) override;
|
void EmitIntValueInHex(uint64_t Value, unsigned Size) override;
|
||||||
@ -202,14 +202,14 @@ public:
|
|||||||
|
|
||||||
void emitSLEB128Value(const MCExpr *Value) override;
|
void emitSLEB128Value(const MCExpr *Value) override;
|
||||||
|
|
||||||
void EmitDTPRel32Value(const MCExpr *Value) override;
|
void emitDTPRel32Value(const MCExpr *Value) override;
|
||||||
void EmitDTPRel64Value(const MCExpr *Value) override;
|
void emitDTPRel64Value(const MCExpr *Value) override;
|
||||||
void EmitTPRel32Value(const MCExpr *Value) override;
|
void emitTPRel32Value(const MCExpr *Value) override;
|
||||||
void EmitTPRel64Value(const MCExpr *Value) override;
|
void emitTPRel64Value(const MCExpr *Value) override;
|
||||||
|
|
||||||
void EmitGPRel64Value(const MCExpr *Value) override;
|
void emitGPRel64Value(const MCExpr *Value) override;
|
||||||
|
|
||||||
void EmitGPRel32Value(const MCExpr *Value) override;
|
void emitGPRel32Value(const MCExpr *Value) override;
|
||||||
|
|
||||||
void emitFill(const MCExpr &NumBytes, uint64_t FillValue,
|
void emitFill(const MCExpr &NumBytes, uint64_t FillValue,
|
||||||
SMLoc Loc = SMLoc()) override;
|
SMLoc Loc = SMLoc()) override;
|
||||||
@ -217,11 +217,11 @@ public:
|
|||||||
void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
|
void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
|
||||||
SMLoc Loc = SMLoc()) override;
|
SMLoc Loc = SMLoc()) override;
|
||||||
|
|
||||||
void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
void emitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
||||||
unsigned ValueSize = 1,
|
unsigned ValueSize = 1,
|
||||||
unsigned MaxBytesToEmit = 0) override;
|
unsigned MaxBytesToEmit = 0) override;
|
||||||
|
|
||||||
void EmitCodeAlignment(unsigned ByteAlignment,
|
void emitCodeAlignment(unsigned ByteAlignment,
|
||||||
unsigned MaxBytesToEmit = 0) override;
|
unsigned MaxBytesToEmit = 0) override;
|
||||||
|
|
||||||
void emitValueToOffset(const MCExpr *Offset,
|
void emitValueToOffset(const MCExpr *Offset,
|
||||||
@ -464,8 +464,8 @@ void MCAsmStreamer::emitELFSymverDirective(StringRef AliasName,
|
|||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
void MCAsmStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
||||||
MCStreamer::EmitLabel(Symbol, Loc);
|
MCStreamer::emitLabel(Symbol, Loc);
|
||||||
|
|
||||||
Symbol->print(OS, MAI);
|
Symbol->print(OS, MAI);
|
||||||
OS << MAI->getLabelSuffix();
|
OS << MAI->getLabelSuffix();
|
||||||
@ -979,7 +979,7 @@ void MCAsmStreamer::EmitIntValueInHexWithPadding(uint64_t Value,
|
|||||||
EmitValue(MCConstantExpr::create(Value, getContext(), true, Size), Size);
|
EmitValue(MCConstantExpr::create(Value, getContext(), true, Size), Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void MCAsmStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc) {
|
SMLoc Loc) {
|
||||||
assert(Size <= 8 && "Invalid size");
|
assert(Size <= 8 && "Invalid size");
|
||||||
assert(getCurrentSectionOnly() &&
|
assert(getCurrentSectionOnly() &&
|
||||||
@ -1059,42 +1059,42 @@ void MCAsmStreamer::emitSLEB128Value(const MCExpr *Value) {
|
|||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitDTPRel64Value(const MCExpr *Value) {
|
void MCAsmStreamer::emitDTPRel64Value(const MCExpr *Value) {
|
||||||
assert(MAI->getDTPRel64Directive() != nullptr);
|
assert(MAI->getDTPRel64Directive() != nullptr);
|
||||||
OS << MAI->getDTPRel64Directive();
|
OS << MAI->getDTPRel64Directive();
|
||||||
Value->print(OS, MAI);
|
Value->print(OS, MAI);
|
||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitDTPRel32Value(const MCExpr *Value) {
|
void MCAsmStreamer::emitDTPRel32Value(const MCExpr *Value) {
|
||||||
assert(MAI->getDTPRel32Directive() != nullptr);
|
assert(MAI->getDTPRel32Directive() != nullptr);
|
||||||
OS << MAI->getDTPRel32Directive();
|
OS << MAI->getDTPRel32Directive();
|
||||||
Value->print(OS, MAI);
|
Value->print(OS, MAI);
|
||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitTPRel64Value(const MCExpr *Value) {
|
void MCAsmStreamer::emitTPRel64Value(const MCExpr *Value) {
|
||||||
assert(MAI->getTPRel64Directive() != nullptr);
|
assert(MAI->getTPRel64Directive() != nullptr);
|
||||||
OS << MAI->getTPRel64Directive();
|
OS << MAI->getTPRel64Directive();
|
||||||
Value->print(OS, MAI);
|
Value->print(OS, MAI);
|
||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitTPRel32Value(const MCExpr *Value) {
|
void MCAsmStreamer::emitTPRel32Value(const MCExpr *Value) {
|
||||||
assert(MAI->getTPRel32Directive() != nullptr);
|
assert(MAI->getTPRel32Directive() != nullptr);
|
||||||
OS << MAI->getTPRel32Directive();
|
OS << MAI->getTPRel32Directive();
|
||||||
Value->print(OS, MAI);
|
Value->print(OS, MAI);
|
||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitGPRel64Value(const MCExpr *Value) {
|
void MCAsmStreamer::emitGPRel64Value(const MCExpr *Value) {
|
||||||
assert(MAI->getGPRel64Directive() != nullptr);
|
assert(MAI->getGPRel64Directive() != nullptr);
|
||||||
OS << MAI->getGPRel64Directive();
|
OS << MAI->getGPRel64Directive();
|
||||||
Value->print(OS, MAI);
|
Value->print(OS, MAI);
|
||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitGPRel32Value(const MCExpr *Value) {
|
void MCAsmStreamer::emitGPRel32Value(const MCExpr *Value) {
|
||||||
assert(MAI->getGPRel32Directive() != nullptr);
|
assert(MAI->getGPRel32Directive() != nullptr);
|
||||||
OS << MAI->getGPRel32Directive();
|
OS << MAI->getGPRel32Directive();
|
||||||
Value->print(OS, MAI);
|
Value->print(OS, MAI);
|
||||||
@ -1141,7 +1141,7 @@ void MCAsmStreamer::emitFill(const MCExpr &NumValues, int64_t Size,
|
|||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
void MCAsmStreamer::emitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
||||||
unsigned ValueSize,
|
unsigned ValueSize,
|
||||||
unsigned MaxBytesToEmit) {
|
unsigned MaxBytesToEmit) {
|
||||||
if (MAI->useDotAlignForAlignment()) {
|
if (MAI->useDotAlignForAlignment()) {
|
||||||
@ -1203,10 +1203,10 @@ void MCAsmStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
|||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCAsmStreamer::EmitCodeAlignment(unsigned ByteAlignment,
|
void MCAsmStreamer::emitCodeAlignment(unsigned ByteAlignment,
|
||||||
unsigned MaxBytesToEmit) {
|
unsigned MaxBytesToEmit) {
|
||||||
// Emit with a text fill value.
|
// Emit with a text fill value.
|
||||||
EmitValueToAlignment(ByteAlignment, MAI->getTextAlignFillValue(),
|
emitValueToAlignment(ByteAlignment, MAI->getTextAlignFillValue(),
|
||||||
1, MaxBytesToEmit);
|
1, MaxBytesToEmit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2038,7 +2038,7 @@ void MCAsmStreamer::FinishImpl() {
|
|||||||
assert(Tables.size() == 1 && "asm output only supports one line table");
|
assert(Tables.size() == 1 && "asm output only supports one line table");
|
||||||
if (auto *Label = Tables.begin()->second.getLabel()) {
|
if (auto *Label = Tables.begin()->second.getLabel()) {
|
||||||
SwitchSection(getContext().getObjectFileInfo()->getDwarfLineSection());
|
SwitchSection(getContext().getObjectFileInfo()->getDwarfLineSection());
|
||||||
EmitLabel(Label);
|
emitLabel(Label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ void CodeViewContext::emitStringTable(MCObjectStreamer &OS) {
|
|||||||
|
|
||||||
OS.EmitIntValue(unsigned(DebugSubsectionKind::StringTable), 4);
|
OS.EmitIntValue(unsigned(DebugSubsectionKind::StringTable), 4);
|
||||||
OS.emitAbsoluteSymbolDiff(StringEnd, StringBegin, 4);
|
OS.emitAbsoluteSymbolDiff(StringEnd, StringBegin, 4);
|
||||||
OS.EmitLabel(StringBegin);
|
OS.emitLabel(StringBegin);
|
||||||
|
|
||||||
// Put the string table data fragment here, if we haven't already put it
|
// Put the string table data fragment here, if we haven't already put it
|
||||||
// somewhere else. If somebody wants two string tables in their .s file, one
|
// somewhere else. If somebody wants two string tables in their .s file, one
|
||||||
@ -184,9 +184,9 @@ void CodeViewContext::emitStringTable(MCObjectStreamer &OS) {
|
|||||||
InsertedStrTabFragment = true;
|
InsertedStrTabFragment = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
OS.EmitValueToAlignment(4, 0);
|
OS.emitValueToAlignment(4, 0);
|
||||||
|
|
||||||
OS.EmitLabel(StringEnd);
|
OS.emitLabel(StringEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeViewContext::emitFileChecksums(MCObjectStreamer &OS) {
|
void CodeViewContext::emitFileChecksums(MCObjectStreamer &OS) {
|
||||||
@ -201,7 +201,7 @@ void CodeViewContext::emitFileChecksums(MCObjectStreamer &OS) {
|
|||||||
|
|
||||||
OS.EmitIntValue(unsigned(DebugSubsectionKind::FileChecksums), 4);
|
OS.EmitIntValue(unsigned(DebugSubsectionKind::FileChecksums), 4);
|
||||||
OS.emitAbsoluteSymbolDiff(FileEnd, FileBegin, 4);
|
OS.emitAbsoluteSymbolDiff(FileEnd, FileBegin, 4);
|
||||||
OS.EmitLabel(FileBegin);
|
OS.emitLabel(FileBegin);
|
||||||
|
|
||||||
unsigned CurrentOffset = 0;
|
unsigned CurrentOffset = 0;
|
||||||
|
|
||||||
@ -232,10 +232,10 @@ void CodeViewContext::emitFileChecksums(MCObjectStreamer &OS) {
|
|||||||
OS.EmitIntValue(static_cast<uint8_t>(File.Checksum.size()), 1);
|
OS.EmitIntValue(static_cast<uint8_t>(File.Checksum.size()), 1);
|
||||||
OS.EmitIntValue(File.ChecksumKind, 1);
|
OS.EmitIntValue(File.ChecksumKind, 1);
|
||||||
OS.emitBytes(toStringRef(File.Checksum));
|
OS.emitBytes(toStringRef(File.Checksum));
|
||||||
OS.EmitValueToAlignment(4);
|
OS.emitValueToAlignment(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
OS.EmitLabel(FileEnd);
|
OS.emitLabel(FileEnd);
|
||||||
|
|
||||||
ChecksumOffsetsAssigned = true;
|
ChecksumOffsetsAssigned = true;
|
||||||
}
|
}
|
||||||
@ -252,14 +252,14 @@ void CodeViewContext::emitFileChecksumOffset(MCObjectStreamer &OS,
|
|||||||
Files.resize(Idx + 1);
|
Files.resize(Idx + 1);
|
||||||
|
|
||||||
if (ChecksumOffsetsAssigned) {
|
if (ChecksumOffsetsAssigned) {
|
||||||
OS.EmitSymbolValue(Files[Idx].ChecksumTableOffset, 4);
|
OS.emitSymbolValue(Files[Idx].ChecksumTableOffset, 4);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MCSymbolRefExpr *SRE =
|
const MCSymbolRefExpr *SRE =
|
||||||
MCSymbolRefExpr::create(Files[Idx].ChecksumTableOffset, OS.getContext());
|
MCSymbolRefExpr::create(Files[Idx].ChecksumTableOffset, OS.getContext());
|
||||||
|
|
||||||
OS.EmitValueImpl(SRE, 4);
|
OS.emitValueImpl(SRE, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeViewContext::addLineEntry(const MCCVLoc &LineEntry) {
|
void CodeViewContext::addLineEntry(const MCCVLoc &LineEntry) {
|
||||||
@ -333,7 +333,7 @@ void CodeViewContext::emitLineTableForFunction(MCObjectStreamer &OS,
|
|||||||
|
|
||||||
OS.EmitIntValue(unsigned(DebugSubsectionKind::Lines), 4);
|
OS.EmitIntValue(unsigned(DebugSubsectionKind::Lines), 4);
|
||||||
OS.emitAbsoluteSymbolDiff(LineEnd, LineBegin, 4);
|
OS.emitAbsoluteSymbolDiff(LineEnd, LineBegin, 4);
|
||||||
OS.EmitLabel(LineBegin);
|
OS.emitLabel(LineBegin);
|
||||||
OS.EmitCOFFSecRel32(FuncBegin, /*Offset=*/0);
|
OS.EmitCOFFSecRel32(FuncBegin, /*Offset=*/0);
|
||||||
OS.EmitCOFFSectionIndex(FuncBegin);
|
OS.EmitCOFFSectionIndex(FuncBegin);
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ void CodeViewContext::emitLineTableForFunction(MCObjectStreamer &OS,
|
|||||||
}
|
}
|
||||||
I = FileSegEnd;
|
I = FileSegEnd;
|
||||||
}
|
}
|
||||||
OS.EmitLabel(LineEnd);
|
OS.emitLabel(LineEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool compressAnnotation(uint32_t Data, SmallVectorImpl<char> &Buffer) {
|
static bool compressAnnotation(uint32_t Data, SmallVectorImpl<char> &Buffer) {
|
||||||
|
@ -91,7 +91,7 @@ void MCDwarfLineEntry::Make(MCObjectStreamer *MCOS, MCSection *Section) {
|
|||||||
// Create a symbol at in the current section for use in the line entry.
|
// Create a symbol at in the current section for use in the line entry.
|
||||||
MCSymbol *LineSym = MCOS->getContext().createTempSymbol();
|
MCSymbol *LineSym = MCOS->getContext().createTempSymbol();
|
||||||
// Set the value of the symbol to use for the MCDwarfLineEntry.
|
// Set the value of the symbol to use for the MCDwarfLineEntry.
|
||||||
MCOS->EmitLabel(LineSym);
|
MCOS->emitLabel(LineSym);
|
||||||
|
|
||||||
// Get the current .loc info saved in the context.
|
// Get the current .loc info saved in the context.
|
||||||
const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc();
|
const MCDwarfLoc &DwarfLoc = MCOS->getContext().getCurrentDwarfLoc();
|
||||||
@ -263,7 +263,7 @@ void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params,
|
|||||||
return;
|
return;
|
||||||
Optional<MCDwarfLineStr> NoLineStr(None);
|
Optional<MCDwarfLineStr> NoLineStr(None);
|
||||||
MCOS.SwitchSection(Section);
|
MCOS.SwitchSection(Section);
|
||||||
MCOS.EmitLabel(Header.Emit(&MCOS, Params, None, NoLineStr).second);
|
MCOS.emitLabel(Header.Emit(&MCOS, Params, None, NoLineStr).second);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<MCSymbol *, MCSymbol *>
|
std::pair<MCSymbol *, MCSymbol *>
|
||||||
@ -455,7 +455,7 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
|
|||||||
if (!LineStartSym)
|
if (!LineStartSym)
|
||||||
LineStartSym = context.createTempSymbol();
|
LineStartSym = context.createTempSymbol();
|
||||||
// Set the value of the symbol, as we are at the start of the line table.
|
// Set the value of the symbol, as we are at the start of the line table.
|
||||||
MCOS->EmitLabel(LineStartSym);
|
MCOS->emitLabel(LineStartSym);
|
||||||
|
|
||||||
// Create a symbol for the end of the section (to be set when we get there).
|
// Create a symbol for the end of the section (to be set when we get there).
|
||||||
MCSymbol *LineEndSym = context.createTempSymbol();
|
MCSymbol *LineEndSym = context.createTempSymbol();
|
||||||
@ -515,7 +515,7 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
|
|||||||
|
|
||||||
// This is the end of the prologue, so set the value of the symbol at the
|
// This is the end of the prologue, so set the value of the symbol at the
|
||||||
// end of the prologue (that was used in a previous expression).
|
// end of the prologue (that was used in a previous expression).
|
||||||
MCOS->EmitLabel(ProEndSym);
|
MCOS->emitLabel(ProEndSym);
|
||||||
|
|
||||||
return std::make_pair(LineStartSym, LineEndSym);
|
return std::make_pair(LineStartSym, LineEndSym);
|
||||||
}
|
}
|
||||||
@ -531,7 +531,7 @@ void MCDwarfLineTable::EmitCU(MCObjectStreamer *MCOS,
|
|||||||
|
|
||||||
// This is the end of the section, so set the value of the symbol at the end
|
// This is the end of the section, so set the value of the symbol at the end
|
||||||
// of this section (that was used in a previous expression).
|
// of this section (that was used in a previous expression).
|
||||||
MCOS->EmitLabel(LineEndSym);
|
MCOS->emitLabel(LineEndSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
Expected<unsigned> MCDwarfLineTable::tryGetFile(StringRef &Directory,
|
Expected<unsigned> MCDwarfLineTable::tryGetFile(StringRef &Directory,
|
||||||
@ -886,7 +886,7 @@ static void EmitGenDwarfAranges(MCStreamer *MCOS,
|
|||||||
// The 4 byte offset to the compile unit in the .debug_info from the start
|
// The 4 byte offset to the compile unit in the .debug_info from the start
|
||||||
// of the .debug_info.
|
// of the .debug_info.
|
||||||
if (InfoSectionSymbol)
|
if (InfoSectionSymbol)
|
||||||
MCOS->EmitSymbolValue(InfoSectionSymbol, 4,
|
MCOS->emitSymbolValue(InfoSectionSymbol, 4,
|
||||||
asmInfo->needsDwarfSectionOffsetDirective());
|
asmInfo->needsDwarfSectionOffsetDirective());
|
||||||
else
|
else
|
||||||
MCOS->EmitIntValue(0, 4);
|
MCOS->EmitIntValue(0, 4);
|
||||||
@ -933,7 +933,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
|
|||||||
// Create a symbol at the start and end of this section used in here for the
|
// Create a symbol at the start and end of this section used in here for the
|
||||||
// expression to calculate the length in the header.
|
// expression to calculate the length in the header.
|
||||||
MCSymbol *InfoStart = context.createTempSymbol();
|
MCSymbol *InfoStart = context.createTempSymbol();
|
||||||
MCOS->EmitLabel(InfoStart);
|
MCOS->emitLabel(InfoStart);
|
||||||
MCSymbol *InfoEnd = context.createTempSymbol();
|
MCSymbol *InfoEnd = context.createTempSymbol();
|
||||||
|
|
||||||
// First part: the header.
|
// First part: the header.
|
||||||
@ -959,7 +959,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
|
|||||||
if (AbbrevSectionSymbol == nullptr)
|
if (AbbrevSectionSymbol == nullptr)
|
||||||
MCOS->EmitIntValue(0, 4);
|
MCOS->EmitIntValue(0, 4);
|
||||||
else
|
else
|
||||||
MCOS->EmitSymbolValue(AbbrevSectionSymbol, 4,
|
MCOS->emitSymbolValue(AbbrevSectionSymbol, 4,
|
||||||
AsmInfo.needsDwarfSectionOffsetDirective());
|
AsmInfo.needsDwarfSectionOffsetDirective());
|
||||||
if (context.getDwarfVersion() <= 4)
|
if (context.getDwarfVersion() <= 4)
|
||||||
MCOS->EmitIntValue(AddrSize, 1);
|
MCOS->EmitIntValue(AddrSize, 1);
|
||||||
@ -972,7 +972,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
|
|||||||
// DW_AT_stmt_list, a 4 byte offset from the start of the .debug_line section,
|
// DW_AT_stmt_list, a 4 byte offset from the start of the .debug_line section,
|
||||||
// which is at the start of that section so this is zero.
|
// which is at the start of that section so this is zero.
|
||||||
if (LineSectionSymbol)
|
if (LineSectionSymbol)
|
||||||
MCOS->EmitSymbolValue(LineSectionSymbol, 4,
|
MCOS->emitSymbolValue(LineSectionSymbol, 4,
|
||||||
AsmInfo.needsDwarfSectionOffsetDirective());
|
AsmInfo.needsDwarfSectionOffsetDirective());
|
||||||
else
|
else
|
||||||
MCOS->EmitIntValue(0, 4);
|
MCOS->EmitIntValue(0, 4);
|
||||||
@ -983,7 +983,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
|
|||||||
|
|
||||||
// AT_ranges, the 4 byte offset from the start of the .debug_ranges section
|
// AT_ranges, the 4 byte offset from the start of the .debug_ranges section
|
||||||
// to the address range list for this compilation unit.
|
// to the address range list for this compilation unit.
|
||||||
MCOS->EmitSymbolValue(RangesSectionSymbol, 4);
|
MCOS->emitSymbolValue(RangesSectionSymbol, 4);
|
||||||
} else {
|
} else {
|
||||||
// If we only have one non-empty code section, we can use the simpler
|
// If we only have one non-empty code section, we can use the simpler
|
||||||
// AT_low_pc and AT_high_pc attributes.
|
// AT_low_pc and AT_high_pc attributes.
|
||||||
@ -1090,7 +1090,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
|
|||||||
MCOS->EmitIntValue(0, 1);
|
MCOS->EmitIntValue(0, 1);
|
||||||
|
|
||||||
// Now set the value of the symbol at the end of the info section.
|
// Now set the value of the symbol at the end of the info section.
|
||||||
MCOS->EmitLabel(InfoEnd);
|
MCOS->emitLabel(InfoEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// When generating dwarf for assembly source files this emits the data for
|
// When generating dwarf for assembly source files this emits the data for
|
||||||
@ -1165,18 +1165,18 @@ void MCGenDwarfInfo::Emit(MCStreamer *MCOS) {
|
|||||||
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection());
|
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection());
|
||||||
if (CreateDwarfSectionSymbols) {
|
if (CreateDwarfSectionSymbols) {
|
||||||
InfoSectionSymbol = context.createTempSymbol();
|
InfoSectionSymbol = context.createTempSymbol();
|
||||||
MCOS->EmitLabel(InfoSectionSymbol);
|
MCOS->emitLabel(InfoSectionSymbol);
|
||||||
}
|
}
|
||||||
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection());
|
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection());
|
||||||
if (CreateDwarfSectionSymbols) {
|
if (CreateDwarfSectionSymbols) {
|
||||||
AbbrevSectionSymbol = context.createTempSymbol();
|
AbbrevSectionSymbol = context.createTempSymbol();
|
||||||
MCOS->EmitLabel(AbbrevSectionSymbol);
|
MCOS->emitLabel(AbbrevSectionSymbol);
|
||||||
}
|
}
|
||||||
if (UseRangesSection) {
|
if (UseRangesSection) {
|
||||||
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection());
|
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection());
|
||||||
if (CreateDwarfSectionSymbols) {
|
if (CreateDwarfSectionSymbols) {
|
||||||
RangesSectionSymbol = context.createTempSymbol();
|
RangesSectionSymbol = context.createTempSymbol();
|
||||||
MCOS->EmitLabel(RangesSectionSymbol);
|
MCOS->emitLabel(RangesSectionSymbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1234,7 +1234,7 @@ void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS,
|
|||||||
// original symbol. So when used they won't get a low bit set after
|
// original symbol. So when used they won't get a low bit set after
|
||||||
// relocation.
|
// relocation.
|
||||||
MCSymbol *Label = context.createTempSymbol();
|
MCSymbol *Label = context.createTempSymbol();
|
||||||
MCOS->EmitLabel(Label);
|
MCOS->emitLabel(Label);
|
||||||
|
|
||||||
// Create and entry for the info and add it to the other entries.
|
// Create and entry for the info and add it to the other entries.
|
||||||
MCOS->getContext().addMCGenDwarfLabelEntry(
|
MCOS->getContext().addMCGenDwarfLabelEntry(
|
||||||
@ -1516,7 +1516,7 @@ void FrameEmitterImpl::EmitCompactUnwind(const MCDwarfFrameInfo &Frame) {
|
|||||||
// Range Start
|
// Range Start
|
||||||
unsigned FDEEncoding = MOFI->getFDEEncoding();
|
unsigned FDEEncoding = MOFI->getFDEEncoding();
|
||||||
unsigned Size = getSizeForEncoding(Streamer, FDEEncoding);
|
unsigned Size = getSizeForEncoding(Streamer, FDEEncoding);
|
||||||
Streamer.EmitSymbolValue(Frame.Begin, Size);
|
Streamer.emitSymbolValue(Frame.Begin, Size);
|
||||||
|
|
||||||
// Range Length
|
// Range Length
|
||||||
const MCExpr *Range = MakeStartMinusEndExpr(Streamer, *Frame.Begin,
|
const MCExpr *Range = MakeStartMinusEndExpr(Streamer, *Frame.Begin,
|
||||||
@ -1530,14 +1530,14 @@ void FrameEmitterImpl::EmitCompactUnwind(const MCDwarfFrameInfo &Frame) {
|
|||||||
// Personality Function
|
// Personality Function
|
||||||
Size = getSizeForEncoding(Streamer, dwarf::DW_EH_PE_absptr);
|
Size = getSizeForEncoding(Streamer, dwarf::DW_EH_PE_absptr);
|
||||||
if (!DwarfEHFrameOnly && Frame.Personality)
|
if (!DwarfEHFrameOnly && Frame.Personality)
|
||||||
Streamer.EmitSymbolValue(Frame.Personality, Size);
|
Streamer.emitSymbolValue(Frame.Personality, Size);
|
||||||
else
|
else
|
||||||
Streamer.EmitIntValue(0, Size); // No personality fn
|
Streamer.EmitIntValue(0, Size); // No personality fn
|
||||||
|
|
||||||
// LSDA
|
// LSDA
|
||||||
Size = getSizeForEncoding(Streamer, Frame.LsdaEncoding);
|
Size = getSizeForEncoding(Streamer, Frame.LsdaEncoding);
|
||||||
if (!DwarfEHFrameOnly && Frame.Lsda)
|
if (!DwarfEHFrameOnly && Frame.Lsda)
|
||||||
Streamer.EmitSymbolValue(Frame.Lsda, Size);
|
Streamer.emitSymbolValue(Frame.Lsda, Size);
|
||||||
else
|
else
|
||||||
Streamer.EmitIntValue(0, Size); // No LSDA
|
Streamer.EmitIntValue(0, Size); // No LSDA
|
||||||
}
|
}
|
||||||
@ -1563,7 +1563,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(const MCDwarfFrameInfo &Frame) {
|
|||||||
const MCObjectFileInfo *MOFI = context.getObjectFileInfo();
|
const MCObjectFileInfo *MOFI = context.getObjectFileInfo();
|
||||||
|
|
||||||
MCSymbol *sectionStart = context.createTempSymbol();
|
MCSymbol *sectionStart = context.createTempSymbol();
|
||||||
Streamer.EmitLabel(sectionStart);
|
Streamer.emitLabel(sectionStart);
|
||||||
|
|
||||||
MCSymbol *sectionEnd = context.createTempSymbol();
|
MCSymbol *sectionEnd = context.createTempSymbol();
|
||||||
|
|
||||||
@ -1667,9 +1667,9 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(const MCDwarfFrameInfo &Frame) {
|
|||||||
InitialCFAOffset = CFAOffset;
|
InitialCFAOffset = CFAOffset;
|
||||||
|
|
||||||
// Padding
|
// Padding
|
||||||
Streamer.EmitValueToAlignment(IsEH ? 4 : MAI->getCodePointerSize());
|
Streamer.emitValueToAlignment(IsEH ? 4 : MAI->getCodePointerSize());
|
||||||
|
|
||||||
Streamer.EmitLabel(sectionEnd);
|
Streamer.emitLabel(sectionEnd);
|
||||||
return *sectionStart;
|
return *sectionStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1688,7 +1688,7 @@ void FrameEmitterImpl::EmitFDE(const MCSymbol &cieStart,
|
|||||||
const MCExpr *Length = MakeStartMinusEndExpr(Streamer, *fdeStart, *fdeEnd, 0);
|
const MCExpr *Length = MakeStartMinusEndExpr(Streamer, *fdeStart, *fdeEnd, 0);
|
||||||
emitAbsValue(Streamer, Length, 4);
|
emitAbsValue(Streamer, Length, 4);
|
||||||
|
|
||||||
Streamer.EmitLabel(fdeStart);
|
Streamer.emitLabel(fdeStart);
|
||||||
|
|
||||||
// CIE Pointer
|
// CIE Pointer
|
||||||
const MCAsmInfo *asmInfo = context.getAsmInfo();
|
const MCAsmInfo *asmInfo = context.getAsmInfo();
|
||||||
@ -1701,7 +1701,7 @@ void FrameEmitterImpl::EmitFDE(const MCSymbol &cieStart,
|
|||||||
MakeStartMinusEndExpr(Streamer, SectionStart, cieStart, 0);
|
MakeStartMinusEndExpr(Streamer, SectionStart, cieStart, 0);
|
||||||
emitAbsValue(Streamer, offset, 4);
|
emitAbsValue(Streamer, offset, 4);
|
||||||
} else {
|
} else {
|
||||||
Streamer.EmitSymbolValue(&cieStart, 4,
|
Streamer.emitSymbolValue(&cieStart, 4,
|
||||||
asmInfo->needsDwarfSectionOffsetDirective());
|
asmInfo->needsDwarfSectionOffsetDirective());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1738,9 +1738,9 @@ void FrameEmitterImpl::EmitFDE(const MCSymbol &cieStart,
|
|||||||
// since a null CIE is interpreted as the end. Old systems overaligned
|
// since a null CIE is interpreted as the end. Old systems overaligned
|
||||||
// .eh_frame, so we do too and account for it in the last FDE.
|
// .eh_frame, so we do too and account for it in the last FDE.
|
||||||
unsigned Align = LastInSection ? asmInfo->getCodePointerSize() : PCSize;
|
unsigned Align = LastInSection ? asmInfo->getCodePointerSize() : PCSize;
|
||||||
Streamer.EmitValueToAlignment(Align);
|
Streamer.emitValueToAlignment(Align);
|
||||||
|
|
||||||
Streamer.EmitLabel(fdeEnd);
|
Streamer.emitLabel(fdeEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -1837,7 +1837,7 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB,
|
|||||||
if (Frame.CompactUnwindEncoding == 0) continue;
|
if (Frame.CompactUnwindEncoding == 0) continue;
|
||||||
if (!SectionEmitted) {
|
if (!SectionEmitted) {
|
||||||
Streamer.SwitchSection(MOFI->getCompactUnwindSection());
|
Streamer.SwitchSection(MOFI->getCompactUnwindSection());
|
||||||
Streamer.EmitValueToAlignment(AsmInfo->getCodePointerSize());
|
Streamer.emitValueToAlignment(AsmInfo->getCodePointerSize());
|
||||||
SectionEmitted = true;
|
SectionEmitted = true;
|
||||||
}
|
}
|
||||||
NeedsEHFrameSection |=
|
NeedsEHFrameSection |=
|
||||||
@ -1855,7 +1855,7 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB,
|
|||||||
|
|
||||||
Streamer.SwitchSection(&Section);
|
Streamer.SwitchSection(&Section);
|
||||||
MCSymbol *SectionStart = Context.createTempSymbol();
|
MCSymbol *SectionStart = Context.createTempSymbol();
|
||||||
Streamer.EmitLabel(SectionStart);
|
Streamer.emitLabel(SectionStart);
|
||||||
|
|
||||||
DenseMap<CIEKey, const MCSymbol *> CIEStarts;
|
DenseMap<CIEKey, const MCSymbol *> CIEStarts;
|
||||||
|
|
||||||
|
@ -90,15 +90,15 @@ void MCELFStreamer::mergeFragment(MCDataFragment *DF,
|
|||||||
void MCELFStreamer::InitSections(bool NoExecStack) {
|
void MCELFStreamer::InitSections(bool NoExecStack) {
|
||||||
MCContext &Ctx = getContext();
|
MCContext &Ctx = getContext();
|
||||||
SwitchSection(Ctx.getObjectFileInfo()->getTextSection());
|
SwitchSection(Ctx.getObjectFileInfo()->getTextSection());
|
||||||
EmitCodeAlignment(4);
|
emitCodeAlignment(4);
|
||||||
|
|
||||||
if (NoExecStack)
|
if (NoExecStack)
|
||||||
SwitchSection(Ctx.getAsmInfo()->getNonexecutableStackSection(Ctx));
|
SwitchSection(Ctx.getAsmInfo()->getNonexecutableStackSection(Ctx));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCELFStreamer::EmitLabel(MCSymbol *S, SMLoc Loc) {
|
void MCELFStreamer::emitLabel(MCSymbol *S, SMLoc Loc) {
|
||||||
auto *Symbol = cast<MCSymbolELF>(S);
|
auto *Symbol = cast<MCSymbolELF>(S);
|
||||||
MCObjectStreamer::EmitLabel(Symbol, Loc);
|
MCObjectStreamer::emitLabel(Symbol, Loc);
|
||||||
|
|
||||||
const MCSectionELF &Section =
|
const MCSectionELF &Section =
|
||||||
static_cast<const MCSectionELF &>(*getCurrentSectionOnly());
|
static_cast<const MCSectionELF &>(*getCurrentSectionOnly());
|
||||||
@ -304,8 +304,8 @@ void MCELFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
|
|||||||
MCSectionSubPair P = getCurrentSection();
|
MCSectionSubPair P = getCurrentSection();
|
||||||
SwitchSection(&Section);
|
SwitchSection(&Section);
|
||||||
|
|
||||||
EmitValueToAlignment(ByteAlignment, 0, 1, 0);
|
emitValueToAlignment(ByteAlignment, 0, 1, 0);
|
||||||
EmitLabel(Symbol);
|
emitLabel(Symbol);
|
||||||
EmitZeros(Size);
|
EmitZeros(Size);
|
||||||
|
|
||||||
SwitchSection(P.first, P.second);
|
SwitchSection(P.first, P.second);
|
||||||
@ -338,21 +338,21 @@ void MCELFStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
|
|||||||
emitCommonSymbol(Symbol, Size, ByteAlignment);
|
emitCommonSymbol(Symbol, Size, ByteAlignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCELFStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void MCELFStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc) {
|
SMLoc Loc) {
|
||||||
if (isBundleLocked())
|
if (isBundleLocked())
|
||||||
report_fatal_error("Emitting values inside a locked bundle is forbidden");
|
report_fatal_error("Emitting values inside a locked bundle is forbidden");
|
||||||
fixSymbolsInTLSFixups(Value);
|
fixSymbolsInTLSFixups(Value);
|
||||||
MCObjectStreamer::EmitValueImpl(Value, Size, Loc);
|
MCObjectStreamer::emitValueImpl(Value, Size, Loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCELFStreamer::EmitValueToAlignment(unsigned ByteAlignment,
|
void MCELFStreamer::emitValueToAlignment(unsigned ByteAlignment,
|
||||||
int64_t Value,
|
int64_t Value,
|
||||||
unsigned ValueSize,
|
unsigned ValueSize,
|
||||||
unsigned MaxBytesToEmit) {
|
unsigned MaxBytesToEmit) {
|
||||||
if (isBundleLocked())
|
if (isBundleLocked())
|
||||||
report_fatal_error("Emitting values inside a locked bundle is forbidden");
|
report_fatal_error("Emitting values inside a locked bundle is forbidden");
|
||||||
MCObjectStreamer::EmitValueToAlignment(ByteAlignment, Value,
|
MCObjectStreamer::emitValueToAlignment(ByteAlignment, Value,
|
||||||
ValueSize, MaxBytesToEmit);
|
ValueSize, MaxBytesToEmit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public:
|
|||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
void ChangeSection(MCSection *Sect, const MCExpr *Subsect) override;
|
void ChangeSection(MCSection *Sect, const MCExpr *Subsect) override;
|
||||||
void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
||||||
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
|
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
|
||||||
void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) override;
|
void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) override;
|
||||||
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
|
void emitAssemblerFlag(MCAssemblerFlag Flag) override;
|
||||||
@ -178,13 +178,13 @@ void MCMachOStreamer::emitEHSymAttributes(const MCSymbol *Symbol,
|
|||||||
emitSymbolAttribute(EHSymbol, MCSA_PrivateExtern);
|
emitSymbolAttribute(EHSymbol, MCSA_PrivateExtern);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCMachOStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
void MCMachOStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
||||||
// We have to create a new fragment if this is an atom defining symbol,
|
// We have to create a new fragment if this is an atom defining symbol,
|
||||||
// fragments cannot span atoms.
|
// fragments cannot span atoms.
|
||||||
if (getAssembler().isSymbolLinkerVisible(*Symbol))
|
if (getAssembler().isSymbolLinkerVisible(*Symbol))
|
||||||
insert(new MCDataFragment());
|
insert(new MCDataFragment());
|
||||||
|
|
||||||
MCObjectStreamer::EmitLabel(Symbol, Loc);
|
MCObjectStreamer::emitLabel(Symbol, Loc);
|
||||||
|
|
||||||
// This causes the reference type flag to be cleared. Darwin 'as' was "trying"
|
// This causes the reference type flag to be cleared. Darwin 'as' was "trying"
|
||||||
// to clear the weak reference and weak definition bits too, but the
|
// to clear the weak reference and weak definition bits too, but the
|
||||||
@ -212,7 +212,7 @@ void MCMachOStreamer::emitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
|
|||||||
void MCMachOStreamer::emitDataRegion(DataRegionData::KindTy Kind) {
|
void MCMachOStreamer::emitDataRegion(DataRegionData::KindTy Kind) {
|
||||||
// Create a temporary label to mark the start of the data region.
|
// Create a temporary label to mark the start of the data region.
|
||||||
MCSymbol *Start = getContext().createTempSymbol();
|
MCSymbol *Start = getContext().createTempSymbol();
|
||||||
EmitLabel(Start);
|
emitLabel(Start);
|
||||||
// Record the region for the object writer to use.
|
// Record the region for the object writer to use.
|
||||||
DataRegionData Data = { Kind, Start, nullptr };
|
DataRegionData Data = { Kind, Start, nullptr };
|
||||||
std::vector<DataRegionData> &Regions = getAssembler().getDataRegions();
|
std::vector<DataRegionData> &Regions = getAssembler().getDataRegions();
|
||||||
@ -226,7 +226,7 @@ void MCMachOStreamer::emitDataRegionEnd() {
|
|||||||
assert(!Data.End && "Mismatched .end_data_region!");
|
assert(!Data.End && "Mismatched .end_data_region!");
|
||||||
// Create a temporary label to mark the end of the data region.
|
// Create a temporary label to mark the end of the data region.
|
||||||
Data.End = getContext().createTempSymbol();
|
Data.End = getContext().createTempSymbol();
|
||||||
EmitLabel(Data.End);
|
emitLabel(Data.End);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCMachOStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) {
|
void MCMachOStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) {
|
||||||
@ -438,8 +438,8 @@ void MCMachOStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
|
|||||||
|
|
||||||
// The symbol may not be present, which only creates the section.
|
// The symbol may not be present, which only creates the section.
|
||||||
if (Symbol) {
|
if (Symbol) {
|
||||||
EmitValueToAlignment(ByteAlignment, 0, 1, 0);
|
emitValueToAlignment(ByteAlignment, 0, 1, 0);
|
||||||
EmitLabel(Symbol);
|
emitLabel(Symbol);
|
||||||
EmitZeros(Size);
|
EmitZeros(Size);
|
||||||
}
|
}
|
||||||
PopSection();
|
PopSection();
|
||||||
|
@ -35,7 +35,7 @@ namespace {
|
|||||||
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
|
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
|
||||||
uint64_t Size = 0, unsigned ByteAlignment = 0,
|
uint64_t Size = 0, unsigned ByteAlignment = 0,
|
||||||
SMLoc Loc = SMLoc()) override {}
|
SMLoc Loc = SMLoc()) override {}
|
||||||
void EmitGPRel32Value(const MCExpr *Value) override {}
|
void emitGPRel32Value(const MCExpr *Value) override {}
|
||||||
void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
|
void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
|
||||||
void EmitCOFFSymbolStorageClass(int StorageClass) override {}
|
void EmitCOFFSymbolStorageClass(int StorageClass) override {}
|
||||||
void EmitCOFFSymbolType(int Type) override {}
|
void EmitCOFFSymbolType(int Type) override {}
|
||||||
|
@ -225,9 +225,9 @@ void MCObjectStreamer::emitCFISections(bool EH, bool Debug) {
|
|||||||
EmitDebugFrame = Debug;
|
EmitDebugFrame = Debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void MCObjectStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc) {
|
SMLoc Loc) {
|
||||||
MCStreamer::EmitValueImpl(Value, Size, Loc);
|
MCStreamer::emitValueImpl(Value, Size, Loc);
|
||||||
MCDataFragment *DF = getOrCreateDataFragment();
|
MCDataFragment *DF = getOrCreateDataFragment();
|
||||||
flushPendingLabels(DF, DF->getContents().size());
|
flushPendingLabels(DF, DF->getContents().size());
|
||||||
|
|
||||||
@ -252,23 +252,23 @@ void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
|
|||||||
|
|
||||||
MCSymbol *MCObjectStreamer::emitCFILabel() {
|
MCSymbol *MCObjectStreamer::emitCFILabel() {
|
||||||
MCSymbol *Label = getContext().createTempSymbol("cfi", true);
|
MCSymbol *Label = getContext().createTempSymbol("cfi", true);
|
||||||
EmitLabel(Label);
|
emitLabel(Label);
|
||||||
return Label;
|
return Label;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCObjectStreamer::emitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
|
void MCObjectStreamer::emitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
|
||||||
// We need to create a local symbol to avoid relocations.
|
// We need to create a local symbol to avoid relocations.
|
||||||
Frame.Begin = getContext().createTempSymbol();
|
Frame.Begin = getContext().createTempSymbol();
|
||||||
EmitLabel(Frame.Begin);
|
emitLabel(Frame.Begin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCObjectStreamer::emitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
|
void MCObjectStreamer::emitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
|
||||||
Frame.End = getContext().createTempSymbol();
|
Frame.End = getContext().createTempSymbol();
|
||||||
EmitLabel(Frame.End);
|
emitLabel(Frame.End);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCObjectStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
void MCObjectStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
||||||
MCStreamer::EmitLabel(Symbol, Loc);
|
MCStreamer::emitLabel(Symbol, Loc);
|
||||||
|
|
||||||
getAssembler().registerSymbol(*Symbol);
|
getAssembler().registerSymbol(*Symbol);
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ void MCObjectStreamer::emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc,
|
|||||||
MCFragment *F, uint64_t Offset) {
|
MCFragment *F, uint64_t Offset) {
|
||||||
assert(F->getParent() == getCurrentSectionOnly());
|
assert(F->getParent() == getCurrentSectionOnly());
|
||||||
|
|
||||||
MCStreamer::EmitLabel(Symbol, Loc);
|
MCStreamer::emitLabel(Symbol, Loc);
|
||||||
getAssembler().registerSymbol(*Symbol);
|
getAssembler().registerSymbol(*Symbol);
|
||||||
auto *DF = dyn_cast_or_null<MCDataFragment>(F);
|
auto *DF = dyn_cast_or_null<MCDataFragment>(F);
|
||||||
Symbol->setOffset(Offset);
|
Symbol->setOffset(Offset);
|
||||||
@ -475,7 +475,7 @@ static void emitDwarfSetLineAddr(MCObjectStreamer &OS,
|
|||||||
OS.EmitIntValue(dwarf::DW_LNS_extended_op, 1);
|
OS.EmitIntValue(dwarf::DW_LNS_extended_op, 1);
|
||||||
OS.emitULEB128IntValue(PointerSize + 1);
|
OS.emitULEB128IntValue(PointerSize + 1);
|
||||||
OS.EmitIntValue(dwarf::DW_LNE_set_address, 1);
|
OS.EmitIntValue(dwarf::DW_LNE_set_address, 1);
|
||||||
OS.EmitSymbolValue(Label, PointerSize);
|
OS.emitSymbolValue(Label, PointerSize);
|
||||||
|
|
||||||
// emit the sequence for the LineDelta (from 1) and a zero address delta.
|
// emit the sequence for the LineDelta (from 1) and a zero address delta.
|
||||||
MCDwarfLineAddr::Emit(&OS, Params, LineDelta, 0);
|
MCDwarfLineAddr::Emit(&OS, Params, LineDelta, 0);
|
||||||
@ -521,7 +521,7 @@ void MCObjectStreamer::EmitCVLocDirective(unsigned FunctionId, unsigned FileNo,
|
|||||||
|
|
||||||
// Emit a label at the current position and record it in the CodeViewContext.
|
// Emit a label at the current position and record it in the CodeViewContext.
|
||||||
MCSymbol *LineSym = getContext().createTempSymbol();
|
MCSymbol *LineSym = getContext().createTempSymbol();
|
||||||
EmitLabel(LineSym);
|
emitLabel(LineSym);
|
||||||
getContext().getCVContext().recordCVLoc(getContext(), LineSym, FunctionId,
|
getContext().getCVContext().recordCVLoc(getContext(), LineSym, FunctionId,
|
||||||
FileNo, Line, Column, PrologueEnd,
|
FileNo, Line, Column, PrologueEnd,
|
||||||
IsStmt);
|
IsStmt);
|
||||||
@ -574,7 +574,7 @@ void MCObjectStreamer::emitBytes(StringRef Data) {
|
|||||||
DF->getContents().append(Data.begin(), Data.end());
|
DF->getContents().append(Data.begin(), Data.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCObjectStreamer::EmitValueToAlignment(unsigned ByteAlignment,
|
void MCObjectStreamer::emitValueToAlignment(unsigned ByteAlignment,
|
||||||
int64_t Value,
|
int64_t Value,
|
||||||
unsigned ValueSize,
|
unsigned ValueSize,
|
||||||
unsigned MaxBytesToEmit) {
|
unsigned MaxBytesToEmit) {
|
||||||
@ -588,9 +588,9 @@ void MCObjectStreamer::EmitValueToAlignment(unsigned ByteAlignment,
|
|||||||
CurSec->setAlignment(Align(ByteAlignment));
|
CurSec->setAlignment(Align(ByteAlignment));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCObjectStreamer::EmitCodeAlignment(unsigned ByteAlignment,
|
void MCObjectStreamer::emitCodeAlignment(unsigned ByteAlignment,
|
||||||
unsigned MaxBytesToEmit) {
|
unsigned MaxBytesToEmit) {
|
||||||
EmitValueToAlignment(ByteAlignment, 0, 1, MaxBytesToEmit);
|
emitValueToAlignment(ByteAlignment, 0, 1, MaxBytesToEmit);
|
||||||
cast<MCAlignFragment>(getCurrentFragment())->setEmitNops(true);
|
cast<MCAlignFragment>(getCurrentFragment())->setEmitNops(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,7 +601,7 @@ void MCObjectStreamer::emitValueToOffset(const MCExpr *Offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Associate DTPRel32 fixup with data and resize data area
|
// Associate DTPRel32 fixup with data and resize data area
|
||||||
void MCObjectStreamer::EmitDTPRel32Value(const MCExpr *Value) {
|
void MCObjectStreamer::emitDTPRel32Value(const MCExpr *Value) {
|
||||||
MCDataFragment *DF = getOrCreateDataFragment();
|
MCDataFragment *DF = getOrCreateDataFragment();
|
||||||
flushPendingLabels(DF, DF->getContents().size());
|
flushPendingLabels(DF, DF->getContents().size());
|
||||||
|
|
||||||
@ -611,7 +611,7 @@ void MCObjectStreamer::EmitDTPRel32Value(const MCExpr *Value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Associate DTPRel64 fixup with data and resize data area
|
// Associate DTPRel64 fixup with data and resize data area
|
||||||
void MCObjectStreamer::EmitDTPRel64Value(const MCExpr *Value) {
|
void MCObjectStreamer::emitDTPRel64Value(const MCExpr *Value) {
|
||||||
MCDataFragment *DF = getOrCreateDataFragment();
|
MCDataFragment *DF = getOrCreateDataFragment();
|
||||||
flushPendingLabels(DF, DF->getContents().size());
|
flushPendingLabels(DF, DF->getContents().size());
|
||||||
|
|
||||||
@ -621,7 +621,7 @@ void MCObjectStreamer::EmitDTPRel64Value(const MCExpr *Value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Associate TPRel32 fixup with data and resize data area
|
// Associate TPRel32 fixup with data and resize data area
|
||||||
void MCObjectStreamer::EmitTPRel32Value(const MCExpr *Value) {
|
void MCObjectStreamer::emitTPRel32Value(const MCExpr *Value) {
|
||||||
MCDataFragment *DF = getOrCreateDataFragment();
|
MCDataFragment *DF = getOrCreateDataFragment();
|
||||||
flushPendingLabels(DF, DF->getContents().size());
|
flushPendingLabels(DF, DF->getContents().size());
|
||||||
|
|
||||||
@ -631,7 +631,7 @@ void MCObjectStreamer::EmitTPRel32Value(const MCExpr *Value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Associate TPRel64 fixup with data and resize data area
|
// Associate TPRel64 fixup with data and resize data area
|
||||||
void MCObjectStreamer::EmitTPRel64Value(const MCExpr *Value) {
|
void MCObjectStreamer::emitTPRel64Value(const MCExpr *Value) {
|
||||||
MCDataFragment *DF = getOrCreateDataFragment();
|
MCDataFragment *DF = getOrCreateDataFragment();
|
||||||
flushPendingLabels(DF, DF->getContents().size());
|
flushPendingLabels(DF, DF->getContents().size());
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ void MCObjectStreamer::EmitTPRel64Value(const MCExpr *Value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Associate GPRel32 fixup with data and resize data area
|
// Associate GPRel32 fixup with data and resize data area
|
||||||
void MCObjectStreamer::EmitGPRel32Value(const MCExpr *Value) {
|
void MCObjectStreamer::emitGPRel32Value(const MCExpr *Value) {
|
||||||
MCDataFragment *DF = getOrCreateDataFragment();
|
MCDataFragment *DF = getOrCreateDataFragment();
|
||||||
flushPendingLabels(DF, DF->getContents().size());
|
flushPendingLabels(DF, DF->getContents().size());
|
||||||
|
|
||||||
@ -651,7 +651,7 @@ void MCObjectStreamer::EmitGPRel32Value(const MCExpr *Value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Associate GPRel64 fixup with data and resize data area
|
// Associate GPRel64 fixup with data and resize data area
|
||||||
void MCObjectStreamer::EmitGPRel64Value(const MCExpr *Value) {
|
void MCObjectStreamer::emitGPRel64Value(const MCExpr *Value) {
|
||||||
MCDataFragment *DF = getOrCreateDataFragment();
|
MCDataFragment *DF = getOrCreateDataFragment();
|
||||||
flushPendingLabels(DF, DF->getContents().size());
|
flushPendingLabels(DF, DF->getContents().size());
|
||||||
|
|
||||||
|
@ -902,7 +902,7 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
|
|||||||
MCSection *Sec = getStreamer().getCurrentSectionOnly();
|
MCSection *Sec = getStreamer().getCurrentSectionOnly();
|
||||||
if (!Sec->getBeginSymbol()) {
|
if (!Sec->getBeginSymbol()) {
|
||||||
MCSymbol *SectionStartSym = getContext().createTempSymbol();
|
MCSymbol *SectionStartSym = getContext().createTempSymbol();
|
||||||
getStreamer().EmitLabel(SectionStartSym);
|
getStreamer().emitLabel(SectionStartSym);
|
||||||
Sec->setBeginSymbol(SectionStartSym);
|
Sec->setBeginSymbol(SectionStartSym);
|
||||||
}
|
}
|
||||||
bool InsertResult = getContext().addGenDwarfSection(Sec);
|
bool InsertResult = getContext().addGenDwarfSection(Sec);
|
||||||
@ -1097,7 +1097,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
|||||||
// This is a '$' reference, which references the current PC. Emit a
|
// This is a '$' reference, which references the current PC. Emit a
|
||||||
// temporary label to the streamer and refer to it.
|
// temporary label to the streamer and refer to it.
|
||||||
MCSymbol *Sym = Ctx.createTempSymbol();
|
MCSymbol *Sym = Ctx.createTempSymbol();
|
||||||
Out.EmitLabel(Sym);
|
Out.emitLabel(Sym);
|
||||||
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None,
|
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None,
|
||||||
getContext());
|
getContext());
|
||||||
EndLoc = FirstTokenLoc;
|
EndLoc = FirstTokenLoc;
|
||||||
@ -1223,7 +1223,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
|||||||
// This is a '.' reference, which references the current PC. Emit a
|
// This is a '.' reference, which references the current PC. Emit a
|
||||||
// temporary label to the streamer and refer to it.
|
// temporary label to the streamer and refer to it.
|
||||||
MCSymbol *Sym = Ctx.createTempSymbol();
|
MCSymbol *Sym = Ctx.createTempSymbol();
|
||||||
Out.EmitLabel(Sym);
|
Out.emitLabel(Sym);
|
||||||
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
|
Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext());
|
||||||
EndLoc = Lexer.getTok().getEndLoc();
|
EndLoc = Lexer.getTok().getEndLoc();
|
||||||
Lex(); // Eat identifier.
|
Lex(); // Eat identifier.
|
||||||
@ -1854,7 +1854,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
|
|||||||
|
|
||||||
// Emit the label.
|
// Emit the label.
|
||||||
if (!getTargetParser().isParsingInlineAsm())
|
if (!getTargetParser().isParsingInlineAsm())
|
||||||
Out.EmitLabel(Sym, IDLoc);
|
Out.emitLabel(Sym, IDLoc);
|
||||||
|
|
||||||
// If we are generating dwarf for assembly source files then gather the
|
// If we are generating dwarf for assembly source files then gather the
|
||||||
// info to make a dwarf label entry for this label if needed.
|
// info to make a dwarf label entry for this label if needed.
|
||||||
@ -3335,10 +3335,10 @@ bool AsmParser::parseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
|
|||||||
bool UseCodeAlign = Section->UseCodeAlign();
|
bool UseCodeAlign = Section->UseCodeAlign();
|
||||||
if ((!HasFillExpr || Lexer.getMAI().getTextAlignFillValue() == FillExpr) &&
|
if ((!HasFillExpr || Lexer.getMAI().getTextAlignFillValue() == FillExpr) &&
|
||||||
ValueSize == 1 && UseCodeAlign) {
|
ValueSize == 1 && UseCodeAlign) {
|
||||||
getStreamer().EmitCodeAlignment(Alignment, MaxBytesToFill);
|
getStreamer().emitCodeAlignment(Alignment, MaxBytesToFill);
|
||||||
} else {
|
} else {
|
||||||
// FIXME: Target specific behavior about how the "extra" bytes are filled.
|
// FIXME: Target specific behavior about how the "extra" bytes are filled.
|
||||||
getStreamer().EmitValueToAlignment(Alignment, FillExpr, ValueSize,
|
getStreamer().emitValueToAlignment(Alignment, FillExpr, ValueSize,
|
||||||
MaxBytesToFill);
|
MaxBytesToFill);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ bool DarwinAsmParser::parseSectionSwitch(StringRef Segment, StringRef Section,
|
|||||||
// is no good reason for someone to intentionally emit incorrectly sized
|
// is no good reason for someone to intentionally emit incorrectly sized
|
||||||
// values into the implicitly aligned sections.
|
// values into the implicitly aligned sections.
|
||||||
if (Align)
|
if (Align)
|
||||||
getStreamer().EmitValueToAlignment(Align);
|
getStreamer().emitValueToAlignment(Align);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ EndStmt:
|
|||||||
|
|
||||||
if (!ELFSection->getBeginSymbol()) {
|
if (!ELFSection->getBeginSymbol()) {
|
||||||
MCSymbol *SectionStartSymbol = getContext().createTempSymbol();
|
MCSymbol *SectionStartSymbol = getContext().createTempSymbol();
|
||||||
getStreamer().EmitLabel(SectionStartSymbol);
|
getStreamer().emitLabel(SectionStartSymbol);
|
||||||
ELFSection->setBeginSymbol(SectionStartSymbol);
|
ELFSection->setBeginSymbol(SectionStartSymbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -802,7 +802,7 @@ bool ELFAsmParser::ParseDirectiveVersion(StringRef, SMLoc) {
|
|||||||
getStreamer().EmitIntValue(1, 4); // type = NT_VERSION.
|
getStreamer().EmitIntValue(1, 4); // type = NT_VERSION.
|
||||||
getStreamer().emitBytes(Data); // name.
|
getStreamer().emitBytes(Data); // name.
|
||||||
getStreamer().EmitIntValue(0, 1); // terminate the string.
|
getStreamer().EmitIntValue(0, 1); // terminate the string.
|
||||||
getStreamer().EmitValueToAlignment(4); // ensure 4 byte alignment.
|
getStreamer().emitValueToAlignment(4); // ensure 4 byte alignment.
|
||||||
getStreamer().PopSection();
|
getStreamer().PopSection();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -160,41 +160,41 @@ void MCStreamer::emitSLEB128IntValue(int64_t Value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc) {
|
void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc) {
|
||||||
EmitValueImpl(Value, Size, Loc);
|
emitValueImpl(Value, Size, Loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
|
void MCStreamer::emitSymbolValue(const MCSymbol *Sym, unsigned Size,
|
||||||
bool IsSectionRelative) {
|
bool IsSectionRelative) {
|
||||||
assert((!IsSectionRelative || Size == 4) &&
|
assert((!IsSectionRelative || Size == 4) &&
|
||||||
"SectionRelative value requires 4-bytes");
|
"SectionRelative value requires 4-bytes");
|
||||||
|
|
||||||
if (!IsSectionRelative)
|
if (!IsSectionRelative)
|
||||||
EmitValueImpl(MCSymbolRefExpr::create(Sym, getContext()), Size);
|
emitValueImpl(MCSymbolRefExpr::create(Sym, getContext()), Size);
|
||||||
else
|
else
|
||||||
EmitCOFFSecRel32(Sym, /*Offset=*/0);
|
EmitCOFFSecRel32(Sym, /*Offset=*/0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitDTPRel64Value(const MCExpr *Value) {
|
void MCStreamer::emitDTPRel64Value(const MCExpr *Value) {
|
||||||
report_fatal_error("unsupported directive in streamer");
|
report_fatal_error("unsupported directive in streamer");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitDTPRel32Value(const MCExpr *Value) {
|
void MCStreamer::emitDTPRel32Value(const MCExpr *Value) {
|
||||||
report_fatal_error("unsupported directive in streamer");
|
report_fatal_error("unsupported directive in streamer");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitTPRel64Value(const MCExpr *Value) {
|
void MCStreamer::emitTPRel64Value(const MCExpr *Value) {
|
||||||
report_fatal_error("unsupported directive in streamer");
|
report_fatal_error("unsupported directive in streamer");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitTPRel32Value(const MCExpr *Value) {
|
void MCStreamer::emitTPRel32Value(const MCExpr *Value) {
|
||||||
report_fatal_error("unsupported directive in streamer");
|
report_fatal_error("unsupported directive in streamer");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitGPRel64Value(const MCExpr *Value) {
|
void MCStreamer::emitGPRel64Value(const MCExpr *Value) {
|
||||||
report_fatal_error("unsupported directive in streamer");
|
report_fatal_error("unsupported directive in streamer");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitGPRel32Value(const MCExpr *Value) {
|
void MCStreamer::emitGPRel32Value(const MCExpr *Value) {
|
||||||
report_fatal_error("unsupported directive in streamer");
|
report_fatal_error("unsupported directive in streamer");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ void MCStreamer::AssignFragment(MCSymbol *Symbol, MCFragment *Fragment) {
|
|||||||
SymbolOrdering[Symbol] = 1 + SymbolOrdering.size();
|
SymbolOrdering[Symbol] = 1 + SymbolOrdering.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
void MCStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
||||||
Symbol->redefineIfPossible();
|
Symbol->redefineIfPossible();
|
||||||
|
|
||||||
if (!Symbol->isUndefined() || Symbol->isVariable())
|
if (!Symbol->isUndefined() || Symbol->isVariable())
|
||||||
@ -1034,7 +1034,7 @@ void MCStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo,
|
|||||||
// Otherwise, emit with .set (aka assignment).
|
// Otherwise, emit with .set (aka assignment).
|
||||||
MCSymbol *SetLabel = Context.createTempSymbol("set", true);
|
MCSymbol *SetLabel = Context.createTempSymbol("set", true);
|
||||||
emitAssignment(SetLabel, Diff);
|
emitAssignment(SetLabel, Diff);
|
||||||
EmitSymbolValue(SetLabel, Size);
|
emitSymbolValue(SetLabel, Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi,
|
void MCStreamer::emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi,
|
||||||
@ -1079,7 +1079,7 @@ void MCStreamer::ChangeSection(MCSection *, const MCExpr *) {}
|
|||||||
void MCStreamer::emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {}
|
void MCStreamer::emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {}
|
||||||
void MCStreamer::emitBytes(StringRef Data) {}
|
void MCStreamer::emitBytes(StringRef Data) {}
|
||||||
void MCStreamer::emitBinaryData(StringRef Data) { emitBytes(Data); }
|
void MCStreamer::emitBinaryData(StringRef Data) { emitBytes(Data); }
|
||||||
void MCStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) {
|
void MCStreamer::emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) {
|
||||||
visitUsedExpr(*Value);
|
visitUsedExpr(*Value);
|
||||||
}
|
}
|
||||||
void MCStreamer::emitULEB128Value(const MCExpr *Value) {}
|
void MCStreamer::emitULEB128Value(const MCExpr *Value) {}
|
||||||
@ -1087,10 +1087,10 @@ void MCStreamer::emitSLEB128Value(const MCExpr *Value) {}
|
|||||||
void MCStreamer::emitFill(const MCExpr &NumBytes, uint64_t Value, SMLoc Loc) {}
|
void MCStreamer::emitFill(const MCExpr &NumBytes, uint64_t Value, SMLoc Loc) {}
|
||||||
void MCStreamer::emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
|
void MCStreamer::emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
|
||||||
SMLoc Loc) {}
|
SMLoc Loc) {}
|
||||||
void MCStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
void MCStreamer::emitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
||||||
unsigned ValueSize,
|
unsigned ValueSize,
|
||||||
unsigned MaxBytesToEmit) {}
|
unsigned MaxBytesToEmit) {}
|
||||||
void MCStreamer::EmitCodeAlignment(unsigned ByteAlignment,
|
void MCStreamer::emitCodeAlignment(unsigned ByteAlignment,
|
||||||
unsigned MaxBytesToEmit) {}
|
unsigned MaxBytesToEmit) {}
|
||||||
void MCStreamer::emitValueToOffset(const MCExpr *Offset, unsigned char Value,
|
void MCStreamer::emitValueToOffset(const MCExpr *Offset, unsigned char Value,
|
||||||
SMLoc Loc) {}
|
SMLoc Loc) {}
|
||||||
@ -1109,7 +1109,7 @@ void MCStreamer::SwitchSection(MCSection *Section, const MCExpr *Subsection) {
|
|||||||
assert(!Section->hasEnded() && "Section already ended");
|
assert(!Section->hasEnded() && "Section already ended");
|
||||||
MCSymbol *Sym = Section->getBeginSymbol();
|
MCSymbol *Sym = Section->getBeginSymbol();
|
||||||
if (Sym && !Sym->isInSection())
|
if (Sym && !Sym->isInSection())
|
||||||
EmitLabel(Sym);
|
emitLabel(Sym);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1121,7 +1121,7 @@ MCSymbol *MCStreamer::endSection(MCSection *Section) {
|
|||||||
return Sym;
|
return Sym;
|
||||||
|
|
||||||
SwitchSection(Section);
|
SwitchSection(Section);
|
||||||
EmitLabel(Sym);
|
emitLabel(Sym);
|
||||||
return Sym;
|
return Sym;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,15 +148,15 @@ void MCWasmStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
|
|||||||
llvm_unreachable("Local common symbols are not yet implemented for Wasm");
|
llvm_unreachable("Local common symbols are not yet implemented for Wasm");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCWasmStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void MCWasmStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc) {
|
SMLoc Loc) {
|
||||||
MCObjectStreamer::EmitValueImpl(Value, Size, Loc);
|
MCObjectStreamer::emitValueImpl(Value, Size, Loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCWasmStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
void MCWasmStreamer::emitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
||||||
unsigned ValueSize,
|
unsigned ValueSize,
|
||||||
unsigned MaxBytesToEmit) {
|
unsigned MaxBytesToEmit) {
|
||||||
MCObjectStreamer::EmitValueToAlignment(ByteAlignment, Value, ValueSize,
|
MCObjectStreamer::emitValueToAlignment(ByteAlignment, Value, ValueSize,
|
||||||
MaxBytesToEmit);
|
MaxBytesToEmit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ static void EmitRuntimeFunction(MCStreamer &streamer,
|
|||||||
const WinEH::FrameInfo *info) {
|
const WinEH::FrameInfo *info) {
|
||||||
MCContext &context = streamer.getContext();
|
MCContext &context = streamer.getContext();
|
||||||
|
|
||||||
streamer.EmitValueToAlignment(4);
|
streamer.emitValueToAlignment(4);
|
||||||
EmitSymbolRefWithOfs(streamer, info->Function, info->Begin);
|
EmitSymbolRefWithOfs(streamer, info->Function, info->Begin);
|
||||||
EmitSymbolRefWithOfs(streamer, info->Function, info->End);
|
EmitSymbolRefWithOfs(streamer, info->Function, info->End);
|
||||||
streamer.EmitValue(MCSymbolRefExpr::create(info->Symbol,
|
streamer.EmitValue(MCSymbolRefExpr::create(info->Symbol,
|
||||||
@ -159,8 +159,8 @@ static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
|
|||||||
MCContext &context = streamer.getContext();
|
MCContext &context = streamer.getContext();
|
||||||
MCSymbol *Label = context.createTempSymbol();
|
MCSymbol *Label = context.createTempSymbol();
|
||||||
|
|
||||||
streamer.EmitValueToAlignment(4);
|
streamer.emitValueToAlignment(4);
|
||||||
streamer.EmitLabel(Label);
|
streamer.emitLabel(Label);
|
||||||
info->Symbol = Label;
|
info->Symbol = Label;
|
||||||
|
|
||||||
// Upper 3 bits are the version number (currently 1).
|
// Upper 3 bits are the version number (currently 1).
|
||||||
@ -498,8 +498,8 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
|
|||||||
MCContext &context = streamer.getContext();
|
MCContext &context = streamer.getContext();
|
||||||
MCSymbol *Label = context.createTempSymbol();
|
MCSymbol *Label = context.createTempSymbol();
|
||||||
|
|
||||||
streamer.EmitValueToAlignment(4);
|
streamer.emitValueToAlignment(4);
|
||||||
streamer.EmitLabel(Label);
|
streamer.emitLabel(Label);
|
||||||
info->Symbol = Label;
|
info->Symbol = Label;
|
||||||
|
|
||||||
int64_t RawFuncLength;
|
int64_t RawFuncLength;
|
||||||
@ -646,7 +646,7 @@ static void ARM64EmitRuntimeFunction(MCStreamer &streamer,
|
|||||||
const WinEH::FrameInfo *info) {
|
const WinEH::FrameInfo *info) {
|
||||||
MCContext &context = streamer.getContext();
|
MCContext &context = streamer.getContext();
|
||||||
|
|
||||||
streamer.EmitValueToAlignment(4);
|
streamer.emitValueToAlignment(4);
|
||||||
EmitSymbolRefWithOfs(streamer, info->Function, info->Begin);
|
EmitSymbolRefWithOfs(streamer, info->Function, info->Begin);
|
||||||
streamer.EmitValue(MCSymbolRefExpr::create(info->Symbol,
|
streamer.EmitValue(MCSymbolRefExpr::create(info->Symbol,
|
||||||
MCSymbolRefExpr::VK_COFF_IMGREL32,
|
MCSymbolRefExpr::VK_COFF_IMGREL32,
|
||||||
|
@ -71,20 +71,20 @@ void MCWinCOFFStreamer::InitSections(bool NoExecStack) {
|
|||||||
// This emulates the same behavior of GNU as. This makes it easier
|
// This emulates the same behavior of GNU as. This makes it easier
|
||||||
// to compare the output as the major sections are in the same order.
|
// to compare the output as the major sections are in the same order.
|
||||||
SwitchSection(getContext().getObjectFileInfo()->getTextSection());
|
SwitchSection(getContext().getObjectFileInfo()->getTextSection());
|
||||||
EmitCodeAlignment(4);
|
emitCodeAlignment(4);
|
||||||
|
|
||||||
SwitchSection(getContext().getObjectFileInfo()->getDataSection());
|
SwitchSection(getContext().getObjectFileInfo()->getDataSection());
|
||||||
EmitCodeAlignment(4);
|
emitCodeAlignment(4);
|
||||||
|
|
||||||
SwitchSection(getContext().getObjectFileInfo()->getBSSSection());
|
SwitchSection(getContext().getObjectFileInfo()->getBSSSection());
|
||||||
EmitCodeAlignment(4);
|
emitCodeAlignment(4);
|
||||||
|
|
||||||
SwitchSection(getContext().getObjectFileInfo()->getTextSection());
|
SwitchSection(getContext().getObjectFileInfo()->getTextSection());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCWinCOFFStreamer::EmitLabel(MCSymbol *S, SMLoc Loc) {
|
void MCWinCOFFStreamer::emitLabel(MCSymbol *S, SMLoc Loc) {
|
||||||
auto *Symbol = cast<MCSymbolCOFF>(S);
|
auto *Symbol = cast<MCSymbolCOFF>(S);
|
||||||
MCObjectStreamer::EmitLabel(Symbol, Loc);
|
MCObjectStreamer::emitLabel(Symbol, Loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCWinCOFFStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) {
|
void MCWinCOFFStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) {
|
||||||
@ -301,8 +301,8 @@ void MCWinCOFFStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
|
|||||||
MCSection *Section = getContext().getObjectFileInfo()->getBSSSection();
|
MCSection *Section = getContext().getObjectFileInfo()->getBSSSection();
|
||||||
PushSection();
|
PushSection();
|
||||||
SwitchSection(Section);
|
SwitchSection(Section);
|
||||||
EmitValueToAlignment(ByteAlignment, 0, 1, 0);
|
emitValueToAlignment(ByteAlignment, 0, 1, 0);
|
||||||
EmitLabel(Symbol);
|
emitLabel(Symbol);
|
||||||
Symbol->setExternal(false);
|
Symbol->setExternal(false);
|
||||||
EmitZeros(Size);
|
EmitZeros(Size);
|
||||||
PopSection();
|
PopSection();
|
||||||
|
@ -51,7 +51,7 @@ void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
|
|||||||
Symbol->setCommon(Size, ByteAlignment);
|
Symbol->setCommon(Size, ByteAlignment);
|
||||||
|
|
||||||
// Emit the alignment and storage for the variable to the section.
|
// Emit the alignment and storage for the variable to the section.
|
||||||
EmitValueToAlignment(ByteAlignment);
|
emitValueToAlignment(ByteAlignment);
|
||||||
EmitZeros(Size);
|
EmitZeros(Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,8 +86,8 @@ void RecordStreamer::emitInstruction(const MCInst &Inst,
|
|||||||
MCStreamer::emitInstruction(Inst, STI);
|
MCStreamer::emitInstruction(Inst, STI);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecordStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
void RecordStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
||||||
MCStreamer::EmitLabel(Symbol);
|
MCStreamer::emitLabel(Symbol);
|
||||||
markDefined(*Symbol);
|
markDefined(*Symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
RecordStreamer(MCContext &Context, const Module &M);
|
RecordStreamer(MCContext &Context, const Module &M);
|
||||||
|
|
||||||
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
|
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
|
||||||
void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
||||||
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
|
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
|
||||||
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
|
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
|
||||||
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
||||||
|
@ -290,9 +290,9 @@ void AArch64AsmPrinter::EmitSled(const MachineInstr &MI, SledKind Kind)
|
|||||||
// ;DATA: higher 32 bits of the address of the trampoline
|
// ;DATA: higher 32 bits of the address of the trampoline
|
||||||
// LDP X0, X30, [SP], #16 ; pop X0 and the link register from the stack
|
// LDP X0, X30, [SP], #16 ; pop X0 and the link register from the stack
|
||||||
//
|
//
|
||||||
OutStreamer->EmitCodeAlignment(4);
|
OutStreamer->emitCodeAlignment(4);
|
||||||
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
||||||
OutStreamer->EmitLabel(CurSled);
|
OutStreamer->emitLabel(CurSled);
|
||||||
auto Target = OutContext.createTempSymbol();
|
auto Target = OutContext.createTempSymbol();
|
||||||
|
|
||||||
// Emit "B #32" instruction, which jumps over the next 28 bytes.
|
// Emit "B #32" instruction, which jumps over the next 28 bytes.
|
||||||
@ -303,7 +303,7 @@ void AArch64AsmPrinter::EmitSled(const MachineInstr &MI, SledKind Kind)
|
|||||||
for (int8_t I = 0; I < NoopsInSledCount; I++)
|
for (int8_t I = 0; I < NoopsInSledCount; I++)
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::HINT).addImm(0));
|
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::HINT).addImm(0));
|
||||||
|
|
||||||
OutStreamer->EmitLabel(Target);
|
OutStreamer->emitLabel(Target);
|
||||||
recordSled(CurSled, MI, Kind);
|
recordSled(CurSled, MI, Kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +366,7 @@ void AArch64AsmPrinter::EmitHwasanMemaccessSymbols(Module &M) {
|
|||||||
OutStreamer->emitSymbolAttribute(Sym, MCSA_ELF_TypeFunction);
|
OutStreamer->emitSymbolAttribute(Sym, MCSA_ELF_TypeFunction);
|
||||||
OutStreamer->emitSymbolAttribute(Sym, MCSA_Weak);
|
OutStreamer->emitSymbolAttribute(Sym, MCSA_Weak);
|
||||||
OutStreamer->emitSymbolAttribute(Sym, MCSA_Hidden);
|
OutStreamer->emitSymbolAttribute(Sym, MCSA_Hidden);
|
||||||
OutStreamer->EmitLabel(Sym);
|
OutStreamer->emitLabel(Sym);
|
||||||
|
|
||||||
OutStreamer->emitInstruction(MCInstBuilder(AArch64::UBFMXri)
|
OutStreamer->emitInstruction(MCInstBuilder(AArch64::UBFMXri)
|
||||||
.addReg(AArch64::X16)
|
.addReg(AArch64::X16)
|
||||||
@ -396,10 +396,10 @@ void AArch64AsmPrinter::EmitHwasanMemaccessSymbols(Module &M) {
|
|||||||
OutContext)),
|
OutContext)),
|
||||||
*STI);
|
*STI);
|
||||||
MCSymbol *ReturnSym = OutContext.createTempSymbol();
|
MCSymbol *ReturnSym = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(ReturnSym);
|
OutStreamer->emitLabel(ReturnSym);
|
||||||
OutStreamer->emitInstruction(
|
OutStreamer->emitInstruction(
|
||||||
MCInstBuilder(AArch64::RET).addReg(AArch64::LR), *STI);
|
MCInstBuilder(AArch64::RET).addReg(AArch64::LR), *STI);
|
||||||
OutStreamer->EmitLabel(HandleMismatchOrPartialSym);
|
OutStreamer->emitLabel(HandleMismatchOrPartialSym);
|
||||||
|
|
||||||
if (IsShort) {
|
if (IsShort) {
|
||||||
OutStreamer->emitInstruction(MCInstBuilder(AArch64::SUBSWri)
|
OutStreamer->emitInstruction(MCInstBuilder(AArch64::SUBSWri)
|
||||||
@ -465,7 +465,7 @@ void AArch64AsmPrinter::EmitHwasanMemaccessSymbols(Module &M) {
|
|||||||
.addExpr(MCSymbolRefExpr::create(ReturnSym, OutContext)),
|
.addExpr(MCSymbolRefExpr::create(ReturnSym, OutContext)),
|
||||||
*STI);
|
*STI);
|
||||||
|
|
||||||
OutStreamer->EmitLabel(HandleMismatchSym);
|
OutStreamer->emitLabel(HandleMismatchSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXpre)
|
OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXpre)
|
||||||
@ -783,7 +783,7 @@ void AArch64AsmPrinter::emitJumpTableInfo() {
|
|||||||
|
|
||||||
unsigned Size = AFI->getJumpTableEntrySize(JTI);
|
unsigned Size = AFI->getJumpTableEntrySize(JTI);
|
||||||
emitAlignment(Align(Size));
|
emitAlignment(Align(Size));
|
||||||
OutStreamer->EmitLabel(GetJTISymbol(JTI));
|
OutStreamer->emitLabel(GetJTISymbol(JTI));
|
||||||
|
|
||||||
for (auto *JTBB : JTBBs)
|
for (auto *JTBB : JTBBs)
|
||||||
emitJumpTableEntry(MJTI, JTBB, JTI);
|
emitJumpTableEntry(MJTI, JTBB, JTI);
|
||||||
@ -867,7 +867,7 @@ void AArch64AsmPrinter::LowerSTACKMAP(MCStreamer &OutStreamer, StackMaps &SM,
|
|||||||
|
|
||||||
auto &Ctx = OutStreamer.getContext();
|
auto &Ctx = OutStreamer.getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer.EmitLabel(MILabel);
|
OutStreamer.emitLabel(MILabel);
|
||||||
|
|
||||||
SM.recordStackMap(*MILabel, MI);
|
SM.recordStackMap(*MILabel, MI);
|
||||||
assert(NumNOPBytes % 4 == 0 && "Invalid number of NOP bytes requested!");
|
assert(NumNOPBytes % 4 == 0 && "Invalid number of NOP bytes requested!");
|
||||||
@ -897,7 +897,7 @@ void AArch64AsmPrinter::LowerPATCHPOINT(MCStreamer &OutStreamer, StackMaps &SM,
|
|||||||
const MachineInstr &MI) {
|
const MachineInstr &MI) {
|
||||||
auto &Ctx = OutStreamer.getContext();
|
auto &Ctx = OutStreamer.getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer.EmitLabel(MILabel);
|
OutStreamer.emitLabel(MILabel);
|
||||||
SM.recordPatchPoint(*MILabel, MI);
|
SM.recordPatchPoint(*MILabel, MI);
|
||||||
|
|
||||||
PatchPointOpers Opers(&MI);
|
PatchPointOpers Opers(&MI);
|
||||||
@ -991,7 +991,7 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
MCSymbol *LOHLabel = createTempSymbol("loh");
|
MCSymbol *LOHLabel = createTempSymbol("loh");
|
||||||
// Associate the instruction with the label
|
// Associate the instruction with the label
|
||||||
LOHInstToLabel[MI] = LOHLabel;
|
LOHInstToLabel[MI] = LOHLabel;
|
||||||
OutStreamer->EmitLabel(LOHLabel);
|
OutStreamer->emitLabel(LOHLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
AArch64TargetStreamer *TS =
|
AArch64TargetStreamer *TS =
|
||||||
@ -1014,7 +1014,7 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
MCInstLowering.Lower(MI, Inst);
|
MCInstLowering.Lower(MI, Inst);
|
||||||
EmitToStreamer(*OutStreamer, Inst);
|
EmitToStreamer(*OutStreamer, Inst);
|
||||||
CurrentPatchableFunctionEntrySym = createTempSymbol("patch");
|
CurrentPatchableFunctionEntrySym = createTempSymbol("patch");
|
||||||
OutStreamer->EmitLabel(CurrentPatchableFunctionEntrySym);
|
OutStreamer->emitLabel(CurrentPatchableFunctionEntrySym);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ const MCExpr *AArch64_MachoTargetObjectFile::getTTypeGlobalReference(
|
|||||||
const MCExpr *Res =
|
const MCExpr *Res =
|
||||||
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_GOT, getContext());
|
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_GOT, getContext());
|
||||||
MCSymbol *PCSym = getContext().createTempSymbol();
|
MCSymbol *PCSym = getContext().createTempSymbol();
|
||||||
Streamer.EmitLabel(PCSym);
|
Streamer.emitLabel(PCSym);
|
||||||
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, getContext());
|
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, getContext());
|
||||||
return MCBinaryExpr::createSub(Res, PC, getContext());
|
return MCBinaryExpr::createSub(Res, PC, getContext());
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ const MCExpr *AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(
|
|||||||
const MCExpr *Res =
|
const MCExpr *Res =
|
||||||
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_GOT, getContext());
|
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_GOT, getContext());
|
||||||
MCSymbol *PCSym = getContext().createTempSymbol();
|
MCSymbol *PCSym = getContext().createTempSymbol();
|
||||||
Streamer.EmitLabel(PCSym);
|
Streamer.emitLabel(PCSym);
|
||||||
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, getContext());
|
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, getContext());
|
||||||
return MCBinaryExpr::createSub(Res, PC, getContext());
|
return MCBinaryExpr::createSub(Res, PC, getContext());
|
||||||
}
|
}
|
||||||
|
@ -136,9 +136,9 @@ public:
|
|||||||
/// This is one of the functions used to emit data into an ELF section, so the
|
/// This is one of the functions used to emit data into an ELF section, so the
|
||||||
/// AArch64 streamer overrides it to add the appropriate mapping symbol ($d)
|
/// AArch64 streamer overrides it to add the appropriate mapping symbol ($d)
|
||||||
/// if necessary.
|
/// if necessary.
|
||||||
void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override {
|
void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override {
|
||||||
emitDataMappingSymbol();
|
emitDataMappingSymbol();
|
||||||
MCELFStreamer::EmitValueImpl(Value, Size, Loc);
|
MCELFStreamer::emitValueImpl(Value, Size, Loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emitFill(const MCExpr &NumBytes, uint64_t FillValue,
|
void emitFill(const MCExpr &NumBytes, uint64_t FillValue,
|
||||||
@ -170,7 +170,7 @@ private:
|
|||||||
void EmitMappingSymbol(StringRef Name) {
|
void EmitMappingSymbol(StringRef Name) {
|
||||||
auto *Symbol = cast<MCSymbolELF>(getContext().getOrCreateSymbol(
|
auto *Symbol = cast<MCSymbolELF>(getContext().getOrCreateSymbol(
|
||||||
Name + "." + Twine(MappingSymbolCounter++)));
|
Name + "." + Twine(MappingSymbolCounter++)));
|
||||||
EmitLabel(Symbol);
|
emitLabel(Symbol);
|
||||||
Symbol->setType(ELF::STT_NOTYPE);
|
Symbol->setType(ELF::STT_NOTYPE);
|
||||||
Symbol->setBinding(ELF::STB_LOCAL);
|
Symbol->setBinding(ELF::STB_LOCAL);
|
||||||
Symbol->setExternal(false);
|
Symbol->setExternal(false);
|
||||||
|
@ -60,7 +60,7 @@ const MCExpr *AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(
|
|||||||
const MCExpr *Res =
|
const MCExpr *Res =
|
||||||
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_GOT, Context);
|
MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_GOT, Context);
|
||||||
MCSymbol *PCSym = Context.createTempSymbol();
|
MCSymbol *PCSym = Context.createTempSymbol();
|
||||||
Streamer.EmitLabel(PCSym);
|
Streamer.emitLabel(PCSym);
|
||||||
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, Context);
|
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, Context);
|
||||||
return MCBinaryExpr::createSub(Res, PC, Context);
|
return MCBinaryExpr::createSub(Res, PC, Context);
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ void AMDGPUAsmPrinter::emitFunctionBodyEnd() {
|
|||||||
|
|
||||||
// CP microcode requires the kernel descriptor to be allocated on 64 byte
|
// CP microcode requires the kernel descriptor to be allocated on 64 byte
|
||||||
// alignment.
|
// alignment.
|
||||||
Streamer.EmitValueToAlignment(64, 0, 1, 0);
|
Streamer.emitValueToAlignment(64, 0, 1, 0);
|
||||||
if (ReadOnlySection.getAlignment() < 64)
|
if (ReadOnlySection.getAlignment() < 64)
|
||||||
ReadOnlySection.setAlignment(Align(64));
|
ReadOnlySection.setAlignment(Align(64));
|
||||||
|
|
||||||
|
@ -445,9 +445,9 @@ void AMDGPUTargetELFStreamer::EmitNote(
|
|||||||
S.EmitValue(DescSZ, 4); // descz
|
S.EmitValue(DescSZ, 4); // descz
|
||||||
S.EmitIntValue(NoteType, 4); // type
|
S.EmitIntValue(NoteType, 4); // type
|
||||||
S.emitBytes(Name); // name
|
S.emitBytes(Name); // name
|
||||||
S.EmitValueToAlignment(4, 0, 1, 0); // padding 0
|
S.emitValueToAlignment(4, 0, 1, 0); // padding 0
|
||||||
EmitDesc(S); // desc
|
EmitDesc(S); // desc
|
||||||
S.EmitValueToAlignment(4, 0, 1, 0); // padding 0
|
S.emitValueToAlignment(4, 0, 1, 0); // padding 0
|
||||||
S.PopSection();
|
S.PopSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,9 +539,9 @@ bool AMDGPUTargetELFStreamer::EmitISAVersion(StringRef IsaVersionString) {
|
|||||||
|
|
||||||
EmitNote(ElfNote::NoteNameV2, DescSZ, ELF::NT_AMD_AMDGPU_ISA,
|
EmitNote(ElfNote::NoteNameV2, DescSZ, ELF::NT_AMD_AMDGPU_ISA,
|
||||||
[&](MCELFStreamer &OS) {
|
[&](MCELFStreamer &OS) {
|
||||||
OS.EmitLabel(DescBegin);
|
OS.emitLabel(DescBegin);
|
||||||
OS.emitBytes(IsaVersionString);
|
OS.emitBytes(IsaVersionString);
|
||||||
OS.EmitLabel(DescEnd);
|
OS.emitLabel(DescEnd);
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -566,9 +566,9 @@ bool AMDGPUTargetELFStreamer::EmitHSAMetadata(msgpack::Document &HSAMetadataDoc,
|
|||||||
|
|
||||||
EmitNote(ElfNote::NoteNameV3, DescSZ, ELF::NT_AMDGPU_METADATA,
|
EmitNote(ElfNote::NoteNameV3, DescSZ, ELF::NT_AMDGPU_METADATA,
|
||||||
[&](MCELFStreamer &OS) {
|
[&](MCELFStreamer &OS) {
|
||||||
OS.EmitLabel(DescBegin);
|
OS.emitLabel(DescBegin);
|
||||||
OS.emitBytes(HSAMetadataString);
|
OS.emitBytes(HSAMetadataString);
|
||||||
OS.EmitLabel(DescEnd);
|
OS.emitLabel(DescEnd);
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -590,9 +590,9 @@ bool AMDGPUTargetELFStreamer::EmitHSAMetadata(
|
|||||||
|
|
||||||
EmitNote(ElfNote::NoteNameV2, DescSZ, ELF::NT_AMD_AMDGPU_HSA_METADATA,
|
EmitNote(ElfNote::NoteNameV2, DescSZ, ELF::NT_AMD_AMDGPU_HSA_METADATA,
|
||||||
[&](MCELFStreamer &OS) {
|
[&](MCELFStreamer &OS) {
|
||||||
OS.EmitLabel(DescBegin);
|
OS.emitLabel(DescBegin);
|
||||||
OS.emitBytes(HSAMetadataString);
|
OS.emitBytes(HSAMetadataString);
|
||||||
OS.EmitLabel(DescEnd);
|
OS.emitLabel(DescEnd);
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -602,7 +602,7 @@ bool AMDGPUTargetELFStreamer::EmitCodeEnd() {
|
|||||||
|
|
||||||
MCStreamer &OS = getStreamer();
|
MCStreamer &OS = getStreamer();
|
||||||
OS.PushSection();
|
OS.PushSection();
|
||||||
OS.EmitValueToAlignment(64, Encoded_s_code_end, 4);
|
OS.emitValueToAlignment(64, Encoded_s_code_end, 4);
|
||||||
for (unsigned I = 0; I < 48; ++I)
|
for (unsigned I = 0; I < 48; ++I)
|
||||||
OS.EmitIntValue(Encoded_s_code_end, 4);
|
OS.EmitIntValue(Encoded_s_code_end, 4);
|
||||||
OS.PopSection();
|
OS.PopSection();
|
||||||
@ -637,7 +637,7 @@ void AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(
|
|||||||
if (KernelCodeSymbol->getVisibility() == ELF::STV_DEFAULT)
|
if (KernelCodeSymbol->getVisibility() == ELF::STV_DEFAULT)
|
||||||
KernelCodeSymbol->setVisibility(ELF::STV_PROTECTED);
|
KernelCodeSymbol->setVisibility(ELF::STV_PROTECTED);
|
||||||
|
|
||||||
Streamer.EmitLabel(KernelDescriptorSymbol);
|
Streamer.emitLabel(KernelDescriptorSymbol);
|
||||||
Streamer.emitBytes(StringRef(
|
Streamer.emitBytes(StringRef(
|
||||||
(const char*)&(KernelDescriptor),
|
(const char*)&(KernelDescriptor),
|
||||||
offsetof(amdhsa::kernel_descriptor_t, kernel_code_entry_byte_offset)));
|
offsetof(amdhsa::kernel_descriptor_t, kernel_code_entry_byte_offset)));
|
||||||
|
@ -73,7 +73,7 @@ void ARMAsmPrinter::emitFunctionEntryLabel() {
|
|||||||
} else {
|
} else {
|
||||||
OutStreamer->emitAssemblerFlag(MCAF_Code32);
|
OutStreamer->emitAssemblerFlag(MCAF_Code32);
|
||||||
}
|
}
|
||||||
OutStreamer->EmitLabel(CurrentFnSym);
|
OutStreamer->emitLabel(CurrentFnSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMAsmPrinter::emitXXStructor(const DataLayout &DL, const Constant *CV) {
|
void ARMAsmPrinter::emitXXStructor(const DataLayout &DL, const Constant *CV) {
|
||||||
@ -170,7 +170,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
OutStreamer->emitAssemblerFlag(MCAF_Code16);
|
OutStreamer->emitAssemblerFlag(MCAF_Code16);
|
||||||
emitAlignment(Align(2));
|
emitAlignment(Align(2));
|
||||||
for (std::pair<unsigned, MCSymbol *> &TIP : ThumbIndirectPads) {
|
for (std::pair<unsigned, MCSymbol *> &TIP : ThumbIndirectPads) {
|
||||||
OutStreamer->EmitLabel(TIP.second);
|
OutStreamer->emitLabel(TIP.second);
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tBX)
|
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tBX)
|
||||||
.addReg(TIP.first)
|
.addReg(TIP.first)
|
||||||
// Add predicate operands.
|
// Add predicate operands.
|
||||||
@ -491,7 +491,7 @@ static void
|
|||||||
emitNonLazySymbolPointer(MCStreamer &OutStreamer, MCSymbol *StubLabel,
|
emitNonLazySymbolPointer(MCStreamer &OutStreamer, MCSymbol *StubLabel,
|
||||||
MachineModuleInfoImpl::StubValueTy &MCSym) {
|
MachineModuleInfoImpl::StubValueTy &MCSym) {
|
||||||
// L_foo$stub:
|
// L_foo$stub:
|
||||||
OutStreamer.EmitLabel(StubLabel);
|
OutStreamer.emitLabel(StubLabel);
|
||||||
// .indirect_symbol _foo
|
// .indirect_symbol _foo
|
||||||
OutStreamer.emitSymbolAttribute(MCSym.getPointer(), MCSA_IndirectSymbol);
|
OutStreamer.emitSymbolAttribute(MCSym.getPointer(), MCSA_IndirectSymbol);
|
||||||
|
|
||||||
@ -877,7 +877,7 @@ void ARMAsmPrinter::emitMachineConstantPoolValue(
|
|||||||
for (const auto *GV : ACPC->promotedGlobals()) {
|
for (const auto *GV : ACPC->promotedGlobals()) {
|
||||||
if (!EmittedPromotedGlobalLabels.count(GV)) {
|
if (!EmittedPromotedGlobalLabels.count(GV)) {
|
||||||
MCSymbol *GVSym = getSymbol(GV);
|
MCSymbol *GVSym = getSymbol(GV);
|
||||||
OutStreamer->EmitLabel(GVSym);
|
OutStreamer->emitLabel(GVSym);
|
||||||
EmittedPromotedGlobalLabels.insert(GV);
|
EmittedPromotedGlobalLabels.insert(GV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -926,7 +926,7 @@ void ARMAsmPrinter::emitMachineConstantPoolValue(
|
|||||||
// We want "(<expr> - .)", but MC doesn't have a concept of the '.'
|
// We want "(<expr> - .)", but MC doesn't have a concept of the '.'
|
||||||
// label, so just emit a local label end reference that instead.
|
// label, so just emit a local label end reference that instead.
|
||||||
MCSymbol *DotSym = OutContext.createTempSymbol();
|
MCSymbol *DotSym = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(DotSym);
|
OutStreamer->emitLabel(DotSym);
|
||||||
const MCExpr *DotExpr = MCSymbolRefExpr::create(DotSym, OutContext);
|
const MCExpr *DotExpr = MCSymbolRefExpr::create(DotSym, OutContext);
|
||||||
PCRelExpr = MCBinaryExpr::createSub(PCRelExpr, DotExpr, OutContext);
|
PCRelExpr = MCBinaryExpr::createSub(PCRelExpr, DotExpr, OutContext);
|
||||||
}
|
}
|
||||||
@ -945,7 +945,7 @@ void ARMAsmPrinter::emitJumpTableAddrs(const MachineInstr *MI) {
|
|||||||
|
|
||||||
// Emit a label for the jump table.
|
// Emit a label for the jump table.
|
||||||
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
||||||
OutStreamer->EmitLabel(JTISymbol);
|
OutStreamer->emitLabel(JTISymbol);
|
||||||
|
|
||||||
// Mark the jump table as data-in-code.
|
// Mark the jump table as data-in-code.
|
||||||
OutStreamer->emitDataRegion(MCDR_DataRegionJT32);
|
OutStreamer->emitDataRegion(MCDR_DataRegionJT32);
|
||||||
@ -991,7 +991,7 @@ void ARMAsmPrinter::emitJumpTableInsts(const MachineInstr *MI) {
|
|||||||
|
|
||||||
// Emit a label for the jump table.
|
// Emit a label for the jump table.
|
||||||
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
||||||
OutStreamer->EmitLabel(JTISymbol);
|
OutStreamer->emitLabel(JTISymbol);
|
||||||
|
|
||||||
// Emit each entry of the table.
|
// Emit each entry of the table.
|
||||||
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
|
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
|
||||||
@ -1019,7 +1019,7 @@ void ARMAsmPrinter::emitJumpTableTBInst(const MachineInstr *MI,
|
|||||||
emitAlignment(Align(4));
|
emitAlignment(Align(4));
|
||||||
|
|
||||||
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel(JTI);
|
||||||
OutStreamer->EmitLabel(JTISymbol);
|
OutStreamer->emitLabel(JTISymbol);
|
||||||
|
|
||||||
// Emit each entry of the table.
|
// Emit each entry of the table.
|
||||||
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
|
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
|
||||||
@ -1514,7 +1514,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// This is a pseudo op for a label used by a branch future instruction
|
// This is a pseudo op for a label used by a branch future instruction
|
||||||
|
|
||||||
// Emit the label.
|
// Emit the label.
|
||||||
OutStreamer->EmitLabel(getBFLabel(DL.getPrivateGlobalPrefix(),
|
OutStreamer->emitLabel(getBFLabel(DL.getPrivateGlobalPrefix(),
|
||||||
getFunctionNumber(),
|
getFunctionNumber(),
|
||||||
MI->getOperand(0).getIndex(), OutContext));
|
MI->getOperand(0).getIndex(), OutContext));
|
||||||
return;
|
return;
|
||||||
@ -1526,7 +1526,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// This adds the address of LPC0 to r0.
|
// This adds the address of LPC0 to r0.
|
||||||
|
|
||||||
// Emit the label.
|
// Emit the label.
|
||||||
OutStreamer->EmitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
|
OutStreamer->emitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
|
||||||
getFunctionNumber(),
|
getFunctionNumber(),
|
||||||
MI->getOperand(2).getImm(), OutContext));
|
MI->getOperand(2).getImm(), OutContext));
|
||||||
|
|
||||||
@ -1547,7 +1547,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// This adds the address of LPC0 to r0.
|
// This adds the address of LPC0 to r0.
|
||||||
|
|
||||||
// Emit the label.
|
// Emit the label.
|
||||||
OutStreamer->EmitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
|
OutStreamer->emitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
|
||||||
getFunctionNumber(),
|
getFunctionNumber(),
|
||||||
MI->getOperand(2).getImm(), OutContext));
|
MI->getOperand(2).getImm(), OutContext));
|
||||||
|
|
||||||
@ -1578,7 +1578,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// a PC-relative address at the ldr instruction.
|
// a PC-relative address at the ldr instruction.
|
||||||
|
|
||||||
// Emit the label.
|
// Emit the label.
|
||||||
OutStreamer->EmitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
|
OutStreamer->emitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
|
||||||
getFunctionNumber(),
|
getFunctionNumber(),
|
||||||
MI->getOperand(2).getImm(), OutContext));
|
MI->getOperand(2).getImm(), OutContext));
|
||||||
|
|
||||||
@ -1625,7 +1625,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
InConstantPool = true;
|
InConstantPool = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
OutStreamer->EmitLabel(GetCPISymbol(LabelId));
|
OutStreamer->emitLabel(GetCPISymbol(LabelId));
|
||||||
|
|
||||||
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
||||||
if (MCPE.isMachineConstantPoolEntry())
|
if (MCPE.isMachineConstantPoolEntry())
|
||||||
@ -1657,7 +1657,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
case ARM::t2TBH_JT: {
|
case ARM::t2TBH_JT: {
|
||||||
unsigned Opc = MI->getOpcode() == ARM::t2TBB_JT ? ARM::t2TBB : ARM::t2TBH;
|
unsigned Opc = MI->getOpcode() == ARM::t2TBB_JT ? ARM::t2TBB : ARM::t2TBH;
|
||||||
// Lower and emit the PC label, then the instruction itself.
|
// Lower and emit the PC label, then the instruction itself.
|
||||||
OutStreamer->EmitLabel(GetCPISymbol(MI->getOperand(3).getImm()));
|
OutStreamer->emitLabel(GetCPISymbol(MI->getOperand(3).getImm()));
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(Opc)
|
EmitToStreamer(*OutStreamer, MCInstBuilder(Opc)
|
||||||
.addReg(MI->getOperand(0).getReg())
|
.addReg(MI->getOperand(0).getReg())
|
||||||
.addReg(MI->getOperand(1).getReg())
|
.addReg(MI->getOperand(1).getReg())
|
||||||
@ -1699,7 +1699,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// FIXME: Ideally we could vary the LDRB index based on the padding
|
// FIXME: Ideally we could vary the LDRB index based on the padding
|
||||||
// between the sequence and jump table, however that relies on MCExprs
|
// between the sequence and jump table, however that relies on MCExprs
|
||||||
// for load indexes which are currently not supported.
|
// for load indexes which are currently not supported.
|
||||||
OutStreamer->EmitCodeAlignment(4);
|
OutStreamer->emitCodeAlignment(4);
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tADDhirr)
|
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tADDhirr)
|
||||||
.addReg(Idx)
|
.addReg(Idx)
|
||||||
.addReg(Idx)
|
.addReg(Idx)
|
||||||
@ -1741,7 +1741,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
.addImm(ARMCC::AL)
|
.addImm(ARMCC::AL)
|
||||||
.addReg(0));
|
.addReg(0));
|
||||||
|
|
||||||
OutStreamer->EmitLabel(GetCPISymbol(MI->getOperand(3).getImm()));
|
OutStreamer->emitLabel(GetCPISymbol(MI->getOperand(3).getImm()));
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tADDhirr)
|
EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::tADDhirr)
|
||||||
.addReg(ARM::PC)
|
.addReg(ARM::PC)
|
||||||
.addReg(ARM::PC)
|
.addReg(ARM::PC)
|
||||||
@ -1905,7 +1905,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
.addImm(ARMCC::AL)
|
.addImm(ARMCC::AL)
|
||||||
.addReg(0));
|
.addReg(0));
|
||||||
|
|
||||||
OutStreamer->EmitLabel(Label);
|
OutStreamer->emitLabel(Label);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,9 +194,9 @@ void ARMAsmPrinter::EmitSled(const MachineInstr &MI, SledKind Kind)
|
|||||||
// BLX ip
|
// BLX ip
|
||||||
// POP{ r0, lr }
|
// POP{ r0, lr }
|
||||||
//
|
//
|
||||||
OutStreamer->EmitCodeAlignment(4);
|
OutStreamer->emitCodeAlignment(4);
|
||||||
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
||||||
OutStreamer->EmitLabel(CurSled);
|
OutStreamer->emitLabel(CurSled);
|
||||||
auto Target = OutContext.createTempSymbol();
|
auto Target = OutContext.createTempSymbol();
|
||||||
|
|
||||||
// Emit "B #20" instruction, which jumps over the next 24 bytes (because
|
// Emit "B #20" instruction, which jumps over the next 24 bytes (because
|
||||||
@ -209,7 +209,7 @@ void ARMAsmPrinter::EmitSled(const MachineInstr &MI, SledKind Kind)
|
|||||||
|
|
||||||
emitNops(NoopsInSledCount);
|
emitNops(NoopsInSledCount);
|
||||||
|
|
||||||
OutStreamer->EmitLabel(Target);
|
OutStreamer->emitLabel(Target);
|
||||||
recordSled(CurSled, MI, Kind);
|
recordSled(CurSled, MI, Kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8323,7 +8323,7 @@ bool ARMAsmParser::processInstruction(MCInst &Inst,
|
|||||||
// Reading PC provides the start of the current instruction + 8 and
|
// Reading PC provides the start of the current instruction + 8 and
|
||||||
// the transform to adr is biased by that.
|
// the transform to adr is biased by that.
|
||||||
MCSymbol *Dot = getContext().createTempSymbol();
|
MCSymbol *Dot = getContext().createTempSymbol();
|
||||||
Out.EmitLabel(Dot);
|
Out.emitLabel(Dot);
|
||||||
const MCExpr *OpExpr = Inst.getOperand(2).getExpr();
|
const MCExpr *OpExpr = Inst.getOperand(2).getExpr();
|
||||||
const MCExpr *InstPC = MCSymbolRefExpr::create(Dot,
|
const MCExpr *InstPC = MCSymbolRefExpr::create(Dot,
|
||||||
MCSymbolRefExpr::VK_None,
|
MCSymbolRefExpr::VK_None,
|
||||||
@ -11314,9 +11314,9 @@ bool ARMAsmParser::parseDirectiveEven(SMLoc L) {
|
|||||||
|
|
||||||
assert(Section && "must have section to emit alignment");
|
assert(Section && "must have section to emit alignment");
|
||||||
if (Section->UseCodeAlign())
|
if (Section->UseCodeAlign())
|
||||||
getStreamer().EmitCodeAlignment(2);
|
getStreamer().emitCodeAlignment(2);
|
||||||
else
|
else
|
||||||
getStreamer().EmitValueToAlignment(2);
|
getStreamer().emitValueToAlignment(2);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -11516,9 +11516,9 @@ bool ARMAsmParser::parseDirectiveAlign(SMLoc L) {
|
|||||||
const MCSection *Section = getStreamer().getCurrentSectionOnly();
|
const MCSection *Section = getStreamer().getCurrentSectionOnly();
|
||||||
assert(Section && "must have section to emit alignment");
|
assert(Section && "must have section to emit alignment");
|
||||||
if (Section->UseCodeAlign())
|
if (Section->UseCodeAlign())
|
||||||
getStreamer().EmitCodeAlignment(4, 0);
|
getStreamer().emitCodeAlignment(4, 0);
|
||||||
else
|
else
|
||||||
getStreamer().EmitValueToAlignment(4, 0, 1, 0);
|
getStreamer().emitValueToAlignment(4, 0, 1, 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -543,7 +543,7 @@ public:
|
|||||||
/// This is one of the functions used to emit data into an ELF section, so the
|
/// This is one of the functions used to emit data into an ELF section, so the
|
||||||
/// ARM streamer overrides it to add the appropriate mapping symbol ($d) if
|
/// ARM streamer overrides it to add the appropriate mapping symbol ($d) if
|
||||||
/// necessary.
|
/// necessary.
|
||||||
void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override {
|
void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override {
|
||||||
if (const MCSymbolRefExpr *SRE = dyn_cast_or_null<MCSymbolRefExpr>(Value)) {
|
if (const MCSymbolRefExpr *SRE = dyn_cast_or_null<MCSymbolRefExpr>(Value)) {
|
||||||
if (SRE->getKind() == MCSymbolRefExpr::VK_ARM_SBREL && !(Size == 4)) {
|
if (SRE->getKind() == MCSymbolRefExpr::VK_ARM_SBREL && !(Size == 4)) {
|
||||||
getContext().reportError(Loc, "relocated expression must be 32-bit");
|
getContext().reportError(Loc, "relocated expression must be 32-bit");
|
||||||
@ -553,7 +553,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
emitDataMappingSymbol();
|
emitDataMappingSymbol();
|
||||||
MCELFStreamer::EmitValueImpl(Value, Size, Loc);
|
MCELFStreamer::emitValueImpl(Value, Size, Loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emitAssemblerFlag(MCAssemblerFlag Flag) override {
|
void emitAssemblerFlag(MCAssemblerFlag Flag) override {
|
||||||
@ -636,7 +636,7 @@ private:
|
|||||||
void EmitMappingSymbol(StringRef Name) {
|
void EmitMappingSymbol(StringRef Name) {
|
||||||
auto *Symbol = cast<MCSymbolELF>(getContext().getOrCreateSymbol(
|
auto *Symbol = cast<MCSymbolELF>(getContext().getOrCreateSymbol(
|
||||||
Name + "." + Twine(MappingSymbolCounter++)));
|
Name + "." + Twine(MappingSymbolCounter++)));
|
||||||
EmitLabel(Symbol);
|
emitLabel(Symbol);
|
||||||
|
|
||||||
Symbol->setType(ELF::STT_NOTYPE);
|
Symbol->setType(ELF::STT_NOTYPE);
|
||||||
Symbol->setBinding(ELF::STB_LOCAL);
|
Symbol->setBinding(ELF::STB_LOCAL);
|
||||||
@ -1207,7 +1207,7 @@ inline void ARMELFStreamer::SwitchToEHSection(StringRef Prefix,
|
|||||||
|
|
||||||
// Switch to .ARM.extab or .ARM.exidx section
|
// Switch to .ARM.extab or .ARM.exidx section
|
||||||
SwitchSection(EHSection);
|
SwitchSection(EHSection);
|
||||||
EmitCodeAlignment(4);
|
emitCodeAlignment(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ARMELFStreamer::SwitchToExTabSection(const MCSymbol &FnStart) {
|
inline void ARMELFStreamer::SwitchToExTabSection(const MCSymbol &FnStart) {
|
||||||
@ -1246,7 +1246,7 @@ void ARMELFStreamer::EHReset() {
|
|||||||
void ARMELFStreamer::emitFnStart() {
|
void ARMELFStreamer::emitFnStart() {
|
||||||
assert(FnStart == nullptr);
|
assert(FnStart == nullptr);
|
||||||
FnStart = getContext().createTempSymbol();
|
FnStart = getContext().createTempSymbol();
|
||||||
EmitLabel(FnStart);
|
emitLabel(FnStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMELFStreamer::emitFnEnd() {
|
void ARMELFStreamer::emitFnEnd() {
|
||||||
@ -1354,7 +1354,7 @@ void ARMELFStreamer::FlushUnwindOpcodes(bool NoHandlerData) {
|
|||||||
// Create .ARM.extab label for offset in .ARM.exidx
|
// Create .ARM.extab label for offset in .ARM.exidx
|
||||||
assert(!ExTab);
|
assert(!ExTab);
|
||||||
ExTab = getContext().createTempSymbol();
|
ExTab = getContext().createTempSymbol();
|
||||||
EmitLabel(ExTab);
|
emitLabel(ExTab);
|
||||||
|
|
||||||
// Emit personality
|
// Emit personality
|
||||||
if (Personality) {
|
if (Personality) {
|
||||||
|
@ -967,7 +967,7 @@ void BTFDebug::processReloc(const MachineOperand &MO) {
|
|||||||
auto *GVar = dyn_cast<GlobalVariable>(GVal);
|
auto *GVar = dyn_cast<GlobalVariable>(GVal);
|
||||||
if (GVar && GVar->hasAttribute(BPFCoreSharedInfo::AmaAttr)) {
|
if (GVar && GVar->hasAttribute(BPFCoreSharedInfo::AmaAttr)) {
|
||||||
MCSymbol *ORSym = OS.getContext().createTempSymbol();
|
MCSymbol *ORSym = OS.getContext().createTempSymbol();
|
||||||
OS.EmitLabel(ORSym);
|
OS.emitLabel(ORSym);
|
||||||
|
|
||||||
MDNode *MDN = GVar->getMetadata(LLVMContext::MD_preserve_access_index);
|
MDNode *MDN = GVar->getMetadata(LLVMContext::MD_preserve_access_index);
|
||||||
DIType *Ty = dyn_cast<DIType>(MDN);
|
DIType *Ty = dyn_cast<DIType>(MDN);
|
||||||
@ -1040,7 +1040,7 @@ void BTFDebug::beginInstruction(const MachineInstr *MI) {
|
|||||||
|
|
||||||
// Create a temporary label to remember the insn for lineinfo.
|
// Create a temporary label to remember the insn for lineinfo.
|
||||||
MCSymbol *LineSym = OS.getContext().createTempSymbol();
|
MCSymbol *LineSym = OS.getContext().createTempSymbol();
|
||||||
OS.EmitLabel(LineSym);
|
OS.emitLabel(LineSym);
|
||||||
|
|
||||||
// Construct the lineinfo.
|
// Construct the lineinfo.
|
||||||
auto SP = DL.get()->getScope()->getSubprogram();
|
auto SP = DL.get()->getScope()->getSubprogram();
|
||||||
|
@ -1497,7 +1497,7 @@ int HexagonAsmParser::processInstruction(MCInst &Inst,
|
|||||||
|
|
||||||
MES->SwitchSection(mySection);
|
MES->SwitchSection(mySection);
|
||||||
unsigned byteSize = is32bit ? 4 : 8;
|
unsigned byteSize = is32bit ? 4 : 8;
|
||||||
getStreamer().EmitCodeAlignment(byteSize, byteSize);
|
getStreamer().emitCodeAlignment(byteSize, byteSize);
|
||||||
|
|
||||||
MCSymbol *Sym;
|
MCSymbol *Sym;
|
||||||
|
|
||||||
@ -1507,7 +1507,7 @@ int HexagonAsmParser::processInstruction(MCInst &Inst,
|
|||||||
if (Absolute) {
|
if (Absolute) {
|
||||||
Sym = getContext().getOrCreateSymbol(StringRef(myCharStr.c_str() + 16));
|
Sym = getContext().getOrCreateSymbol(StringRef(myCharStr.c_str() + 16));
|
||||||
if (Sym->isUndefined()) {
|
if (Sym->isUndefined()) {
|
||||||
getStreamer().EmitLabel(Sym);
|
getStreamer().emitLabel(Sym);
|
||||||
getStreamer().emitSymbolAttribute(Sym, MCSA_Global);
|
getStreamer().emitSymbolAttribute(Sym, MCSA_Global);
|
||||||
getStreamer().EmitIntValue(Value, byteSize);
|
getStreamer().EmitIntValue(Value, byteSize);
|
||||||
}
|
}
|
||||||
@ -1529,7 +1529,7 @@ int HexagonAsmParser::processInstruction(MCInst &Inst,
|
|||||||
|
|
||||||
if (Sym->isUndefined()) {
|
if (Sym->isUndefined()) {
|
||||||
// case where symbol is not yet defined: emit symbol
|
// case where symbol is not yet defined: emit symbol
|
||||||
getStreamer().EmitLabel(Sym);
|
getStreamer().emitLabel(Sym);
|
||||||
getStreamer().emitSymbolAttribute(Sym, MCSA_Local);
|
getStreamer().emitSymbolAttribute(Sym, MCSA_Local);
|
||||||
getStreamer().EmitValue(MO_1.getExpr(), 4);
|
getStreamer().EmitValue(MO_1.getExpr(), 4);
|
||||||
}
|
}
|
||||||
|
@ -206,10 +206,10 @@ static MCSymbol *smallData(AsmPrinter &AP, const MachineInstr &MI,
|
|||||||
|
|
||||||
Sym = AP.OutContext.getOrCreateSymbol(Twine(symbolName));
|
Sym = AP.OutContext.getOrCreateSymbol(Twine(symbolName));
|
||||||
if (Sym->isUndefined()) {
|
if (Sym->isUndefined()) {
|
||||||
OutStreamer.EmitLabel(Sym);
|
OutStreamer.emitLabel(Sym);
|
||||||
OutStreamer.emitSymbolAttribute(Sym, MCSA_Global);
|
OutStreamer.emitSymbolAttribute(Sym, MCSA_Global);
|
||||||
OutStreamer.EmitIntValue(Value, AlignSize);
|
OutStreamer.EmitIntValue(Value, AlignSize);
|
||||||
OutStreamer.EmitCodeAlignment(AlignSize);
|
OutStreamer.emitCodeAlignment(AlignSize);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert(Imm.isExpr() && "Expected expression and found none");
|
assert(Imm.isExpr() && "Expected expression and found none");
|
||||||
@ -234,10 +234,10 @@ static MCSymbol *smallData(AsmPrinter &AP, const MachineInstr &MI,
|
|||||||
OutStreamer.SwitchSection(Section);
|
OutStreamer.SwitchSection(Section);
|
||||||
Sym = AP.OutContext.getOrCreateSymbol(Twine(LitaName));
|
Sym = AP.OutContext.getOrCreateSymbol(Twine(LitaName));
|
||||||
if (Sym->isUndefined()) {
|
if (Sym->isUndefined()) {
|
||||||
OutStreamer.EmitLabel(Sym);
|
OutStreamer.emitLabel(Sym);
|
||||||
OutStreamer.emitSymbolAttribute(Sym, MCSA_Local);
|
OutStreamer.emitSymbolAttribute(Sym, MCSA_Local);
|
||||||
OutStreamer.EmitValue(Imm.getExpr(), AlignSize);
|
OutStreamer.EmitValue(Imm.getExpr(), AlignSize);
|
||||||
OutStreamer.EmitCodeAlignment(AlignSize);
|
OutStreamer.emitCodeAlignment(AlignSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Sym;
|
return Sym;
|
||||||
|
@ -15,7 +15,7 @@ namespace llvm {
|
|||||||
class HexagonTargetStreamer : public MCTargetStreamer {
|
class HexagonTargetStreamer : public MCTargetStreamer {
|
||||||
public:
|
public:
|
||||||
HexagonTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
|
HexagonTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
|
||||||
virtual void EmitCodeAlignment(unsigned ByteAlignment,
|
virtual void emitCodeAlignment(unsigned ByteAlignment,
|
||||||
unsigned MaxBytesToEmit = 0){};
|
unsigned MaxBytesToEmit = 0){};
|
||||||
virtual void emitFAlign(unsigned Size, unsigned MaxBytesToEmit){};
|
virtual void emitFAlign(unsigned Size, unsigned MaxBytesToEmit){};
|
||||||
virtual void emitCommonSymbolSorted(MCSymbol *Symbol, uint64_t Size,
|
virtual void emitCommonSymbolSorted(MCSymbol *Symbol, uint64_t Size,
|
||||||
|
@ -110,8 +110,8 @@ void HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(MCSymbol *Symbol,
|
|||||||
SwitchSection(&Section);
|
SwitchSection(&Section);
|
||||||
|
|
||||||
if (ELFSymbol->isUndefined()) {
|
if (ELFSymbol->isUndefined()) {
|
||||||
EmitValueToAlignment(ByteAlignment, 0, 1, 0);
|
emitValueToAlignment(ByteAlignment, 0, 1, 0);
|
||||||
EmitLabel(Symbol);
|
emitLabel(Symbol);
|
||||||
EmitZeros(Size);
|
EmitZeros(Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ void MSP430AsmPrinter::EmitInterruptVectorSection(MachineFunction &ISR) {
|
|||||||
OutStreamer->SwitchSection(IV);
|
OutStreamer->SwitchSection(IV);
|
||||||
|
|
||||||
const MCSymbol *FunctionSymbol = getSymbol(F);
|
const MCSymbol *FunctionSymbol = getSymbol(F);
|
||||||
OutStreamer->EmitSymbolValue(FunctionSymbol, TM.getProgramPointerSize());
|
OutStreamer->emitSymbolValue(FunctionSymbol, TM.getProgramPointerSize());
|
||||||
OutStreamer->SwitchSection(Cur);
|
OutStreamer->SwitchSection(Cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2131,7 +2131,7 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
|
|||||||
TOut.getStreamer().EmitRelocDirective(*TmpExpr,
|
TOut.getStreamer().EmitRelocDirective(*TmpExpr,
|
||||||
inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR",
|
inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR",
|
||||||
RelocJalrExpr, IDLoc, *STI);
|
RelocJalrExpr, IDLoc, *STI);
|
||||||
TOut.getStreamer().EmitLabel(TmpLabel);
|
TOut.getStreamer().emitLabel(TmpLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
Inst = JalrInst;
|
Inst = JalrInst;
|
||||||
@ -3388,7 +3388,7 @@ bool MipsAsmParser::expandLoadSingleImmToFPR(MCInst &Inst, SMLoc IDLoc,
|
|||||||
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
|
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
|
||||||
|
|
||||||
getStreamer().SwitchSection(ReadOnlySection);
|
getStreamer().SwitchSection(ReadOnlySection);
|
||||||
getStreamer().EmitLabel(Sym, IDLoc);
|
getStreamer().emitLabel(Sym, IDLoc);
|
||||||
getStreamer().EmitIntValue(ImmOp32, 4);
|
getStreamer().EmitIntValue(ImmOp32, 4);
|
||||||
getStreamer().SwitchSection(CS);
|
getStreamer().SwitchSection(CS);
|
||||||
|
|
||||||
@ -3440,8 +3440,8 @@ bool MipsAsmParser::expandLoadDoubleImmToGPR(MCInst &Inst, SMLoc IDLoc,
|
|||||||
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
|
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
|
||||||
|
|
||||||
getStreamer().SwitchSection(ReadOnlySection);
|
getStreamer().SwitchSection(ReadOnlySection);
|
||||||
getStreamer().EmitLabel(Sym, IDLoc);
|
getStreamer().emitLabel(Sym, IDLoc);
|
||||||
getStreamer().EmitValueToAlignment(8);
|
getStreamer().emitValueToAlignment(8);
|
||||||
getStreamer().EmitIntValue(ImmOp64, 8);
|
getStreamer().EmitIntValue(ImmOp64, 8);
|
||||||
getStreamer().SwitchSection(CS);
|
getStreamer().SwitchSection(CS);
|
||||||
|
|
||||||
@ -3523,8 +3523,8 @@ bool MipsAsmParser::expandLoadDoubleImmToFPR(MCInst &Inst, bool Is64FPU,
|
|||||||
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
|
MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext());
|
||||||
|
|
||||||
getStreamer().SwitchSection(ReadOnlySection);
|
getStreamer().SwitchSection(ReadOnlySection);
|
||||||
getStreamer().EmitLabel(Sym, IDLoc);
|
getStreamer().emitLabel(Sym, IDLoc);
|
||||||
getStreamer().EmitValueToAlignment(8);
|
getStreamer().emitValueToAlignment(8);
|
||||||
getStreamer().EmitIntValue(ImmOp64, 8);
|
getStreamer().EmitIntValue(ImmOp64, 8);
|
||||||
getStreamer().SwitchSection(CS);
|
getStreamer().SwitchSection(CS);
|
||||||
|
|
||||||
@ -4260,7 +4260,7 @@ bool MipsAsmParser::expandDivRem(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
|
|||||||
|
|
||||||
if (!Signed) {
|
if (!Signed) {
|
||||||
if (!UseTraps)
|
if (!UseTraps)
|
||||||
TOut.getStreamer().EmitLabel(BrTarget);
|
TOut.getStreamer().emitLabel(BrTarget);
|
||||||
|
|
||||||
TOut.emitR(isDiv ? Mips::MFLO : Mips::MFHI, RdReg, IDLoc, STI);
|
TOut.emitR(isDiv ? Mips::MFLO : Mips::MFHI, RdReg, IDLoc, STI);
|
||||||
return false;
|
return false;
|
||||||
@ -4271,7 +4271,7 @@ bool MipsAsmParser::expandDivRem(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!UseTraps)
|
if (!UseTraps)
|
||||||
TOut.getStreamer().EmitLabel(BrTarget);
|
TOut.getStreamer().emitLabel(BrTarget);
|
||||||
|
|
||||||
TOut.emitRRI(Mips::ADDiu, ATReg, ZeroReg, -1, IDLoc, STI);
|
TOut.emitRRI(Mips::ADDiu, ATReg, ZeroReg, -1, IDLoc, STI);
|
||||||
|
|
||||||
@ -4299,7 +4299,7 @@ bool MipsAsmParser::expandDivRem(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
|
|||||||
TOut.emitII(Mips::BREAK, 0x6, 0, IDLoc, STI);
|
TOut.emitII(Mips::BREAK, 0x6, 0, IDLoc, STI);
|
||||||
}
|
}
|
||||||
|
|
||||||
TOut.getStreamer().EmitLabel(BrTargetEnd);
|
TOut.getStreamer().emitLabel(BrTargetEnd);
|
||||||
TOut.emitR(isDiv ? Mips::MFLO : Mips::MFHI, RdReg, IDLoc, STI);
|
TOut.emitR(isDiv ? Mips::MFLO : Mips::MFHI, RdReg, IDLoc, STI);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -5101,7 +5101,7 @@ bool MipsAsmParser::expandMulO(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
|
|||||||
TOut.emitNop(IDLoc, STI);
|
TOut.emitNop(IDLoc, STI);
|
||||||
TOut.emitII(Mips::BREAK, 6, 0, IDLoc, STI);
|
TOut.emitII(Mips::BREAK, 6, 0, IDLoc, STI);
|
||||||
|
|
||||||
TOut.getStreamer().EmitLabel(BrTarget);
|
TOut.getStreamer().emitLabel(BrTarget);
|
||||||
}
|
}
|
||||||
TOut.emitR(Mips::MFLO, DstReg, IDLoc, STI);
|
TOut.emitR(Mips::MFLO, DstReg, IDLoc, STI);
|
||||||
|
|
||||||
@ -5138,7 +5138,7 @@ bool MipsAsmParser::expandMulOU(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
|
|||||||
TOut.emitNop(IDLoc, STI);
|
TOut.emitNop(IDLoc, STI);
|
||||||
TOut.emitII(Mips::BREAK, 6, 0, IDLoc, STI);
|
TOut.emitII(Mips::BREAK, 6, 0, IDLoc, STI);
|
||||||
|
|
||||||
TOut.getStreamer().EmitLabel(BrTarget);
|
TOut.getStreamer().emitLabel(BrTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -7770,7 +7770,7 @@ bool MipsAsmParser::parseDirectiveGpWord() {
|
|||||||
// method to evaluate the expression.
|
// method to evaluate the expression.
|
||||||
if (getParser().parseExpression(Value))
|
if (getParser().parseExpression(Value))
|
||||||
return true;
|
return true;
|
||||||
getParser().getStreamer().EmitGPRel32Value(Value);
|
getParser().getStreamer().emitGPRel32Value(Value);
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||||
return Error(getLexer().getLoc(),
|
return Error(getLexer().getLoc(),
|
||||||
@ -7788,7 +7788,7 @@ bool MipsAsmParser::parseDirectiveGpDWord() {
|
|||||||
// method to evaluate the expression.
|
// method to evaluate the expression.
|
||||||
if (getParser().parseExpression(Value))
|
if (getParser().parseExpression(Value))
|
||||||
return true;
|
return true;
|
||||||
getParser().getStreamer().EmitGPRel64Value(Value);
|
getParser().getStreamer().emitGPRel64Value(Value);
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||||
return Error(getLexer().getLoc(),
|
return Error(getLexer().getLoc(),
|
||||||
@ -7806,7 +7806,7 @@ bool MipsAsmParser::parseDirectiveDtpRelWord() {
|
|||||||
// method to evaluate the expression.
|
// method to evaluate the expression.
|
||||||
if (getParser().parseExpression(Value))
|
if (getParser().parseExpression(Value))
|
||||||
return true;
|
return true;
|
||||||
getParser().getStreamer().EmitDTPRel32Value(Value);
|
getParser().getStreamer().emitDTPRel32Value(Value);
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||||
return Error(getLexer().getLoc(),
|
return Error(getLexer().getLoc(),
|
||||||
@ -7824,7 +7824,7 @@ bool MipsAsmParser::parseDirectiveDtpRelDWord() {
|
|||||||
// method to evaluate the expression.
|
// method to evaluate the expression.
|
||||||
if (getParser().parseExpression(Value))
|
if (getParser().parseExpression(Value))
|
||||||
return true;
|
return true;
|
||||||
getParser().getStreamer().EmitDTPRel64Value(Value);
|
getParser().getStreamer().emitDTPRel64Value(Value);
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||||
return Error(getLexer().getLoc(),
|
return Error(getLexer().getLoc(),
|
||||||
@ -7842,7 +7842,7 @@ bool MipsAsmParser::parseDirectiveTpRelWord() {
|
|||||||
// method to evaluate the expression.
|
// method to evaluate the expression.
|
||||||
if (getParser().parseExpression(Value))
|
if (getParser().parseExpression(Value))
|
||||||
return true;
|
return true;
|
||||||
getParser().getStreamer().EmitTPRel32Value(Value);
|
getParser().getStreamer().emitTPRel32Value(Value);
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||||
return Error(getLexer().getLoc(),
|
return Error(getLexer().getLoc(),
|
||||||
@ -7860,7 +7860,7 @@ bool MipsAsmParser::parseDirectiveTpRelDWord() {
|
|||||||
// method to evaluate the expression.
|
// method to evaluate the expression.
|
||||||
if (getParser().parseExpression(Value))
|
if (getParser().parseExpression(Value))
|
||||||
return true;
|
return true;
|
||||||
getParser().getStreamer().EmitTPRel64Value(Value);
|
getParser().getStreamer().emitTPRel64Value(Value);
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||||
return Error(getLexer().getLoc(),
|
return Error(getLexer().getLoc(),
|
||||||
|
@ -55,18 +55,18 @@ void MipsELFStreamer::emitInstruction(const MCInst &Inst,
|
|||||||
|
|
||||||
void MipsELFStreamer::emitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
|
void MipsELFStreamer::emitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
|
||||||
Frame.Begin = getContext().createTempSymbol();
|
Frame.Begin = getContext().createTempSymbol();
|
||||||
MCELFStreamer::EmitLabel(Frame.Begin);
|
MCELFStreamer::emitLabel(Frame.Begin);
|
||||||
}
|
}
|
||||||
|
|
||||||
MCSymbol *MipsELFStreamer::emitCFILabel() {
|
MCSymbol *MipsELFStreamer::emitCFILabel() {
|
||||||
MCSymbol *Label = getContext().createTempSymbol("cfi", true);
|
MCSymbol *Label = getContext().createTempSymbol("cfi", true);
|
||||||
MCELFStreamer::EmitLabel(Label);
|
MCELFStreamer::emitLabel(Label);
|
||||||
return Label;
|
return Label;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MipsELFStreamer::emitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
|
void MipsELFStreamer::emitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
|
||||||
Frame.End = getContext().createTempSymbol();
|
Frame.End = getContext().createTempSymbol();
|
||||||
MCELFStreamer::EmitLabel(Frame.End);
|
MCELFStreamer::emitLabel(Frame.End);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MipsELFStreamer::createPendingLabelRelocs() {
|
void MipsELFStreamer::createPendingLabelRelocs() {
|
||||||
@ -85,8 +85,8 @@ void MipsELFStreamer::createPendingLabelRelocs() {
|
|||||||
Labels.clear();
|
Labels.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MipsELFStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
void MipsELFStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
||||||
MCELFStreamer::EmitLabel(Symbol);
|
MCELFStreamer::emitLabel(Symbol);
|
||||||
Labels.push_back(Symbol);
|
Labels.push_back(Symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,9 +96,9 @@ void MipsELFStreamer::SwitchSection(MCSection *Section,
|
|||||||
Labels.clear();
|
Labels.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MipsELFStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
|
void MipsELFStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,
|
||||||
SMLoc Loc) {
|
SMLoc Loc) {
|
||||||
MCELFStreamer::EmitValueImpl(Value, Size, Loc);
|
MCELFStreamer::emitValueImpl(Value, Size, Loc);
|
||||||
Labels.clear();
|
Labels.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
/// Overriding this function allows us to record all labels that should be
|
/// Overriding this function allows us to record all labels that should be
|
||||||
/// marked as microMIPS. Based on this data marking is done in
|
/// marked as microMIPS. Based on this data marking is done in
|
||||||
/// EmitInstruction.
|
/// EmitInstruction.
|
||||||
void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
||||||
|
|
||||||
/// Overriding this function allows us to dismiss all labels that are
|
/// Overriding this function allows us to dismiss all labels that are
|
||||||
/// candidates for marking as microMIPS when .section directive is processed.
|
/// candidates for marking as microMIPS when .section directive is processed.
|
||||||
@ -56,7 +56,7 @@ public:
|
|||||||
/// Overriding these functions allows us to dismiss all labels that are
|
/// Overriding these functions allows us to dismiss all labels that are
|
||||||
/// candidates for marking as microMIPS when .word/.long/.4byte etc
|
/// candidates for marking as microMIPS when .word/.long/.4byte etc
|
||||||
/// directives are emitted.
|
/// directives are emitted.
|
||||||
void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override;
|
void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override;
|
||||||
void EmitIntValue(uint64_t Value, unsigned Size) override;
|
void EmitIntValue(uint64_t Value, unsigned Size) override;
|
||||||
|
|
||||||
// Overriding these functions allows us to avoid recording of these labels
|
// Overriding these functions allows us to avoid recording of these labels
|
||||||
|
@ -883,9 +883,9 @@ void MipsTargetELFStreamer::finish() {
|
|||||||
if (Alignment) {
|
if (Alignment) {
|
||||||
OS.SwitchSection(&Section);
|
OS.SwitchSection(&Section);
|
||||||
if (Section.UseCodeAlign())
|
if (Section.UseCodeAlign())
|
||||||
OS.EmitCodeAlignment(Alignment, Alignment);
|
OS.emitCodeAlignment(Alignment, Alignment);
|
||||||
else
|
else
|
||||||
OS.EmitValueToAlignment(Alignment, 0, 1, Alignment);
|
OS.emitValueToAlignment(Alignment, 0, 1, Alignment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -997,7 +997,7 @@ void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) {
|
|||||||
|
|
||||||
OS.SwitchSection(Sec);
|
OS.SwitchSection(Sec);
|
||||||
|
|
||||||
OS.EmitValueImpl(ExprRef, 4);
|
OS.emitValueImpl(ExprRef, 4);
|
||||||
|
|
||||||
OS.EmitIntValue(GPRInfoSet ? GPRBitMask : 0, 4); // reg_mask
|
OS.EmitIntValue(GPRInfoSet ? GPRBitMask : 0, 4); // reg_mask
|
||||||
OS.EmitIntValue(GPRInfoSet ? GPROffset : 0, 4); // reg_offset
|
OS.EmitIntValue(GPRInfoSet ? GPROffset : 0, 4); // reg_offset
|
||||||
@ -1017,7 +1017,7 @@ void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) {
|
|||||||
|
|
||||||
// .end also implicitly sets the size.
|
// .end also implicitly sets the size.
|
||||||
MCSymbol *CurPCSym = Context.createTempSymbol();
|
MCSymbol *CurPCSym = Context.createTempSymbol();
|
||||||
OS.EmitLabel(CurPCSym);
|
OS.emitLabel(CurPCSym);
|
||||||
const MCExpr *Size = MCBinaryExpr::createSub(
|
const MCExpr *Size = MCBinaryExpr::createSub(
|
||||||
MCSymbolRefExpr::create(CurPCSym, MCSymbolRefExpr::VK_None, Context),
|
MCSymbolRefExpr::create(CurPCSym, MCSymbolRefExpr::VK_None, Context),
|
||||||
ExprRef, Context);
|
ExprRef, Context);
|
||||||
|
@ -178,7 +178,7 @@ static void emitDirectiveRelocJalr(const MachineInstr &MI,
|
|||||||
(*OffsetExpr,
|
(*OffsetExpr,
|
||||||
Subtarget.inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR",
|
Subtarget.inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR",
|
||||||
CaleeExpr, SMLoc(), *TM.getMCSubtargetInfo());
|
CaleeExpr, SMLoc(), *TM.getMCSubtargetInfo());
|
||||||
OutStreamer.EmitLabel(OffsetLabel);
|
OutStreamer.emitLabel(OffsetLabel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ void MipsAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
InConstantPool = true;
|
InConstantPool = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
OutStreamer->EmitLabel(GetCPISymbol(LabelId));
|
OutStreamer->emitLabel(GetCPISymbol(LabelId));
|
||||||
|
|
||||||
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
||||||
if (MCPE.isMachineConstantPoolEntry())
|
if (MCPE.isMachineConstantPoolEntry())
|
||||||
@ -419,7 +419,7 @@ void MipsAsmPrinter::emitFunctionEntryLabel() {
|
|||||||
TS.emitDirectiveSetNoMips16();
|
TS.emitDirectiveSetNoMips16();
|
||||||
|
|
||||||
TS.emitDirectiveEnt(*CurrentFnSym);
|
TS.emitDirectiveEnt(*CurrentFnSym);
|
||||||
OutStreamer->EmitLabel(CurrentFnSym);
|
OutStreamer->emitLabel(CurrentFnSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EmitFunctionBodyStart - Targets can override this to emit stuff before
|
/// EmitFunctionBodyStart - Targets can override this to emit stuff before
|
||||||
@ -1054,7 +1054,7 @@ void MipsAsmPrinter::EmitFPCallStub(
|
|||||||
//
|
//
|
||||||
// .align 2
|
// .align 2
|
||||||
//
|
//
|
||||||
OutStreamer->EmitValueToAlignment(4);
|
OutStreamer->emitValueToAlignment(4);
|
||||||
MipsTargetStreamer &TS = getTargetStreamer();
|
MipsTargetStreamer &TS = getTargetStreamer();
|
||||||
//
|
//
|
||||||
// .set nomips16
|
// .set nomips16
|
||||||
@ -1074,7 +1074,7 @@ void MipsAsmPrinter::EmitFPCallStub(
|
|||||||
MCSymbol *MType =
|
MCSymbol *MType =
|
||||||
OutContext.getOrCreateSymbol("__call_stub_fp_" + Twine(Symbol));
|
OutContext.getOrCreateSymbol("__call_stub_fp_" + Twine(Symbol));
|
||||||
OutStreamer->emitSymbolAttribute(MType, MCSA_ELF_TypeFunction);
|
OutStreamer->emitSymbolAttribute(MType, MCSA_ELF_TypeFunction);
|
||||||
OutStreamer->EmitLabel(Stub);
|
OutStreamer->emitLabel(Stub);
|
||||||
|
|
||||||
// Only handle non-pic for now.
|
// Only handle non-pic for now.
|
||||||
assert(!isPositionIndependent() &&
|
assert(!isPositionIndependent() &&
|
||||||
@ -1113,7 +1113,7 @@ void MipsAsmPrinter::EmitFPCallStub(
|
|||||||
EmitInstrReg(*STI, Mips::JR, Mips::S2);
|
EmitInstrReg(*STI, Mips::JR, Mips::S2);
|
||||||
|
|
||||||
MCSymbol *Tmp = OutContext.createTempSymbol();
|
MCSymbol *Tmp = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(Tmp);
|
OutStreamer->emitLabel(Tmp);
|
||||||
const MCSymbolRefExpr *E = MCSymbolRefExpr::create(Stub, OutContext);
|
const MCSymbolRefExpr *E = MCSymbolRefExpr::create(Stub, OutContext);
|
||||||
const MCSymbolRefExpr *T = MCSymbolRefExpr::create(Tmp, OutContext);
|
const MCSymbolRefExpr *T = MCSymbolRefExpr::create(Tmp, OutContext);
|
||||||
const MCExpr *T_min_E = MCBinaryExpr::createSub(T, E, OutContext);
|
const MCExpr *T_min_E = MCBinaryExpr::createSub(T, E, OutContext);
|
||||||
@ -1203,9 +1203,9 @@ void MipsAsmPrinter::EmitSled(const MachineInstr &MI, SledKind Kind) {
|
|||||||
// LD RA, 8(SP)
|
// LD RA, 8(SP)
|
||||||
// DADDIU SP, SP, 16
|
// DADDIU SP, SP, 16
|
||||||
//
|
//
|
||||||
OutStreamer->EmitCodeAlignment(4);
|
OutStreamer->emitCodeAlignment(4);
|
||||||
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
||||||
OutStreamer->EmitLabel(CurSled);
|
OutStreamer->emitLabel(CurSled);
|
||||||
auto Target = OutContext.createTempSymbol();
|
auto Target = OutContext.createTempSymbol();
|
||||||
|
|
||||||
// Emit "B .tmpN" instruction, which jumps over the nop sled to the actual
|
// Emit "B .tmpN" instruction, which jumps over the nop sled to the actual
|
||||||
@ -1223,7 +1223,7 @@ void MipsAsmPrinter::EmitSled(const MachineInstr &MI, SledKind Kind) {
|
|||||||
.addReg(Mips::ZERO)
|
.addReg(Mips::ZERO)
|
||||||
.addImm(0));
|
.addImm(0));
|
||||||
|
|
||||||
OutStreamer->EmitLabel(Target);
|
OutStreamer->emitLabel(Target);
|
||||||
|
|
||||||
if (!Subtarget->isGP64bit()) {
|
if (!Subtarget->isGP64bit()) {
|
||||||
EmitToStreamer(*OutStreamer,
|
EmitToStreamer(*OutStreamer,
|
||||||
@ -1260,10 +1260,10 @@ void MipsAsmPrinter::emitDebugValue(const MCExpr *Value, unsigned Size) const {
|
|||||||
if (MipsExpr && MipsExpr->getKind() == MipsMCExpr::MEK_DTPREL) {
|
if (MipsExpr && MipsExpr->getKind() == MipsMCExpr::MEK_DTPREL) {
|
||||||
switch (Size) {
|
switch (Size) {
|
||||||
case 4:
|
case 4:
|
||||||
OutStreamer->EmitDTPRel32Value(MipsExpr->getSubExpr());
|
OutStreamer->emitDTPRel32Value(MipsExpr->getSubExpr());
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
OutStreamer->EmitDTPRel64Value(MipsExpr->getSubExpr());
|
OutStreamer->emitDTPRel64Value(MipsExpr->getSubExpr());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
llvm_unreachable("Unexpected size of expression value.");
|
llvm_unreachable("Unexpected size of expression value.");
|
||||||
|
@ -1702,7 +1702,7 @@ bool PPCAsmParser::ParseDirectiveTC(unsigned Size, AsmToken ID) {
|
|||||||
return addErrorSuffix(" in '.tc' directive");
|
return addErrorSuffix(" in '.tc' directive");
|
||||||
|
|
||||||
// Align to word size.
|
// Align to word size.
|
||||||
getParser().getStreamer().EmitValueToAlignment(Size);
|
getParser().getStreamer().emitValueToAlignment(Size);
|
||||||
|
|
||||||
// Emit expressions.
|
// Emit expressions.
|
||||||
return ParseDirectiveWord(Size, ID);
|
return ParseDirectiveWord(Size, ID);
|
||||||
|
@ -65,7 +65,7 @@ void PPCELFStreamer::emitInstruction(const MCInst &Inst,
|
|||||||
// all of the nops required as part of the alignment operation. In the cases
|
// all of the nops required as part of the alignment operation. In the cases
|
||||||
// when no nops are added then The fragment is still created but it remains
|
// when no nops are added then The fragment is still created but it remains
|
||||||
// empty.
|
// empty.
|
||||||
EmitCodeAlignment(64, 4);
|
emitCodeAlignment(64, 4);
|
||||||
|
|
||||||
// Emit the instruction.
|
// Emit the instruction.
|
||||||
// Since the previous emit created a new fragment then adding this instruction
|
// Since the previous emit created a new fragment then adding this instruction
|
||||||
@ -93,10 +93,10 @@ void PPCELFStreamer::emitInstruction(const MCInst &Inst,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPCELFStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
void PPCELFStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
|
||||||
LastLabel = Symbol;
|
LastLabel = Symbol;
|
||||||
LastLabelLoc = Loc;
|
LastLabelLoc = Loc;
|
||||||
MCELFStreamer::EmitLabel(Symbol);
|
MCELFStreamer::emitLabel(Symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
MCELFStreamer *llvm::createPPCELFStreamer(
|
MCELFStreamer *llvm::createPPCELFStreamer(
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
|
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
|
||||||
|
|
||||||
// EmitLabel updates LastLabel and LastLabelLoc when a new label is emitted.
|
// EmitLabel updates LastLabel and LastLabelLoc when a new label is emitted.
|
||||||
void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
MCELFStreamer *createPPCELFStreamer(MCContext &Context,
|
MCELFStreamer *createPPCELFStreamer(MCContext &Context,
|
||||||
|
@ -159,8 +159,8 @@ public:
|
|||||||
|
|
||||||
void emitTCEntry(const MCSymbol &S) override {
|
void emitTCEntry(const MCSymbol &S) override {
|
||||||
// Creates a R_PPC64_TOC relocation
|
// Creates a R_PPC64_TOC relocation
|
||||||
Streamer.EmitValueToAlignment(8);
|
Streamer.emitValueToAlignment(8);
|
||||||
Streamer.EmitSymbolValue(&S, 8);
|
Streamer.emitSymbolValue(&S, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emitMachine(StringRef CPU) override {
|
void emitMachine(StringRef CPU) override {
|
||||||
@ -261,8 +261,8 @@ public:
|
|||||||
void emitTCEntry(const MCSymbol &S) override {
|
void emitTCEntry(const MCSymbol &S) override {
|
||||||
const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
|
const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
|
||||||
const unsigned PointerSize = MAI->getCodePointerSize();
|
const unsigned PointerSize = MAI->getCodePointerSize();
|
||||||
Streamer.EmitValueToAlignment(PointerSize);
|
Streamer.emitValueToAlignment(PointerSize);
|
||||||
Streamer.EmitSymbolValue(&S, PointerSize);
|
Streamer.emitSymbolValue(&S, PointerSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emitMachine(StringRef CPU) override {
|
void emitMachine(StringRef CPU) override {
|
||||||
|
@ -326,7 +326,7 @@ void PPCAsmPrinter::LowerSTACKMAP(StackMaps &SM, const MachineInstr &MI) {
|
|||||||
|
|
||||||
auto &Ctx = OutStreamer->getContext();
|
auto &Ctx = OutStreamer->getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(MILabel);
|
OutStreamer->emitLabel(MILabel);
|
||||||
|
|
||||||
SM.recordStackMap(*MILabel, MI);
|
SM.recordStackMap(*MILabel, MI);
|
||||||
assert(NumNOPBytes % 4 == 0 && "Invalid number of NOP bytes requested!");
|
assert(NumNOPBytes % 4 == 0 && "Invalid number of NOP bytes requested!");
|
||||||
@ -355,7 +355,7 @@ void PPCAsmPrinter::LowerSTACKMAP(StackMaps &SM, const MachineInstr &MI) {
|
|||||||
void PPCAsmPrinter::LowerPATCHPOINT(StackMaps &SM, const MachineInstr &MI) {
|
void PPCAsmPrinter::LowerPATCHPOINT(StackMaps &SM, const MachineInstr &MI) {
|
||||||
auto &Ctx = OutStreamer->getContext();
|
auto &Ctx = OutStreamer->getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(MILabel);
|
OutStreamer->emitLabel(MILabel);
|
||||||
|
|
||||||
SM.recordPatchPoint(*MILabel, MI);
|
SM.recordPatchPoint(*MILabel, MI);
|
||||||
PatchPointOpers Opers(&MI);
|
PatchPointOpers Opers(&MI);
|
||||||
@ -591,7 +591,7 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
.addExpr(MCSymbolRefExpr::create(PICBase, OutContext)));
|
.addExpr(MCSymbolRefExpr::create(PICBase, OutContext)));
|
||||||
|
|
||||||
// Emit the label.
|
// Emit the label.
|
||||||
OutStreamer->EmitLabel(PICBase);
|
OutStreamer->emitLabel(PICBase);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case PPC::UpdateGBR: {
|
case PPC::UpdateGBR: {
|
||||||
@ -935,9 +935,9 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
MCBinaryExpr::createSub(MCSymbolRefExpr::create(GOTSymbol, OutContext),
|
MCBinaryExpr::createSub(MCSymbolRefExpr::create(GOTSymbol, OutContext),
|
||||||
MCSymbolRefExpr::create(GOTRef, OutContext),
|
MCSymbolRefExpr::create(GOTRef, OutContext),
|
||||||
OutContext);
|
OutContext);
|
||||||
OutStreamer->EmitLabel(GOTRef);
|
OutStreamer->emitLabel(GOTRef);
|
||||||
OutStreamer->EmitValue(OffsExpr, 4);
|
OutStreamer->EmitValue(OffsExpr, 4);
|
||||||
OutStreamer->EmitLabel(NextInstr);
|
OutStreamer->emitLabel(NextInstr);
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::MFLR)
|
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::MFLR)
|
||||||
.addReg(MI->getOperand(0).getReg()));
|
.addReg(MI->getOperand(0).getReg()));
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::LWZ)
|
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::LWZ)
|
||||||
@ -1170,7 +1170,7 @@ void PPCLinuxAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// of instructions change.
|
// of instructions change.
|
||||||
MCSymbol *BeginOfSled = OutContext.createTempSymbol();
|
MCSymbol *BeginOfSled = OutContext.createTempSymbol();
|
||||||
MCSymbol *EndOfSled = OutContext.createTempSymbol();
|
MCSymbol *EndOfSled = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(BeginOfSled);
|
OutStreamer->emitLabel(BeginOfSled);
|
||||||
EmitToStreamer(*OutStreamer,
|
EmitToStreamer(*OutStreamer,
|
||||||
MCInstBuilder(PPC::B).addExpr(
|
MCInstBuilder(PPC::B).addExpr(
|
||||||
MCSymbolRefExpr::create(EndOfSled, OutContext)));
|
MCSymbolRefExpr::create(EndOfSled, OutContext)));
|
||||||
@ -1185,7 +1185,7 @@ void PPCLinuxAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
OutContext.getOrCreateSymbol("__xray_FunctionEntry"),
|
OutContext.getOrCreateSymbol("__xray_FunctionEntry"),
|
||||||
OutContext)));
|
OutContext)));
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::MTLR8).addReg(PPC::X0));
|
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::MTLR8).addReg(PPC::X0));
|
||||||
OutStreamer->EmitLabel(EndOfSled);
|
OutStreamer->emitLabel(EndOfSled);
|
||||||
recordSled(BeginOfSled, *MI, SledKind::FUNCTION_ENTER);
|
recordSled(BeginOfSled, *MI, SledKind::FUNCTION_ENTER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1256,9 +1256,9 @@ void PPCLinuxAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
//
|
//
|
||||||
// Update compiler-rt/lib/xray/xray_powerpc64.cc accordingly when number
|
// Update compiler-rt/lib/xray/xray_powerpc64.cc accordingly when number
|
||||||
// of instructions change.
|
// of instructions change.
|
||||||
OutStreamer->EmitCodeAlignment(8);
|
OutStreamer->emitCodeAlignment(8);
|
||||||
MCSymbol *BeginOfSled = OutContext.createTempSymbol();
|
MCSymbol *BeginOfSled = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(BeginOfSled);
|
OutStreamer->emitLabel(BeginOfSled);
|
||||||
EmitToStreamer(*OutStreamer, RetInst);
|
EmitToStreamer(*OutStreamer, RetInst);
|
||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::NOP));
|
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::NOP));
|
||||||
EmitToStreamer(
|
EmitToStreamer(
|
||||||
@ -1273,7 +1273,7 @@ void PPCLinuxAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::MTLR8).addReg(PPC::X0));
|
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::MTLR8).addReg(PPC::X0));
|
||||||
EmitToStreamer(*OutStreamer, RetInst);
|
EmitToStreamer(*OutStreamer, RetInst);
|
||||||
if (IsConditional)
|
if (IsConditional)
|
||||||
OutStreamer->EmitLabel(FallthroughLabel);
|
OutStreamer->emitLabel(FallthroughLabel);
|
||||||
recordSled(BeginOfSled, *MI, SledKind::FUNCTION_EXIT);
|
recordSled(BeginOfSled, *MI, SledKind::FUNCTION_EXIT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1309,7 +1309,7 @@ void PPCLinuxAsmPrinter::emitStartOfAsmFile(Module &M) {
|
|||||||
MCSymbol *TOCSym = OutContext.getOrCreateSymbol(Twine(".LTOC"));
|
MCSymbol *TOCSym = OutContext.getOrCreateSymbol(Twine(".LTOC"));
|
||||||
MCSymbol *CurrentPos = OutContext.createTempSymbol();
|
MCSymbol *CurrentPos = OutContext.createTempSymbol();
|
||||||
|
|
||||||
OutStreamer->EmitLabel(CurrentPos);
|
OutStreamer->emitLabel(CurrentPos);
|
||||||
|
|
||||||
// The GOT pointer points to the middle of the GOT, in order to reference the
|
// The GOT pointer points to the middle of the GOT, in order to reference the
|
||||||
// entire 64kB range. 0x8000 is the midpoint.
|
// entire 64kB range. 0x8000 is the midpoint.
|
||||||
@ -1335,7 +1335,7 @@ void PPCLinuxAsmPrinter::emitFunctionEntryLabel() {
|
|||||||
if (PPCFI->usesPICBase() && !Subtarget->isSecurePlt()) {
|
if (PPCFI->usesPICBase() && !Subtarget->isSecurePlt()) {
|
||||||
MCSymbol *RelocSymbol = PPCFI->getPICOffsetSymbol();
|
MCSymbol *RelocSymbol = PPCFI->getPICOffsetSymbol();
|
||||||
MCSymbol *PICBase = MF->getPICBaseSymbol();
|
MCSymbol *PICBase = MF->getPICBaseSymbol();
|
||||||
OutStreamer->EmitLabel(RelocSymbol);
|
OutStreamer->emitLabel(RelocSymbol);
|
||||||
|
|
||||||
const MCExpr *OffsExpr =
|
const MCExpr *OffsExpr =
|
||||||
MCBinaryExpr::createSub(
|
MCBinaryExpr::createSub(
|
||||||
@ -1344,7 +1344,7 @@ void PPCLinuxAsmPrinter::emitFunctionEntryLabel() {
|
|||||||
MCSymbolRefExpr::create(PICBase, OutContext),
|
MCSymbolRefExpr::create(PICBase, OutContext),
|
||||||
OutContext);
|
OutContext);
|
||||||
OutStreamer->EmitValue(OffsExpr, 4);
|
OutStreamer->EmitValue(OffsExpr, 4);
|
||||||
OutStreamer->EmitLabel(CurrentFnSym);
|
OutStreamer->emitLabel(CurrentFnSym);
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
return AsmPrinter::emitFunctionEntryLabel();
|
return AsmPrinter::emitFunctionEntryLabel();
|
||||||
@ -1368,7 +1368,7 @@ void PPCLinuxAsmPrinter::emitFunctionEntryLabel() {
|
|||||||
OutContext),
|
OutContext),
|
||||||
OutContext);
|
OutContext);
|
||||||
|
|
||||||
OutStreamer->EmitLabel(PPCFI->getTOCOffsetSymbol());
|
OutStreamer->emitLabel(PPCFI->getTOCOffsetSymbol());
|
||||||
OutStreamer->EmitValue(TOCDeltaExpr, 8);
|
OutStreamer->EmitValue(TOCDeltaExpr, 8);
|
||||||
}
|
}
|
||||||
return AsmPrinter::emitFunctionEntryLabel();
|
return AsmPrinter::emitFunctionEntryLabel();
|
||||||
@ -1379,8 +1379,8 @@ void PPCLinuxAsmPrinter::emitFunctionEntryLabel() {
|
|||||||
MCSectionELF *Section = OutStreamer->getContext().getELFSection(
|
MCSectionELF *Section = OutStreamer->getContext().getELFSection(
|
||||||
".opd", ELF::SHT_PROGBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC);
|
".opd", ELF::SHT_PROGBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC);
|
||||||
OutStreamer->SwitchSection(Section);
|
OutStreamer->SwitchSection(Section);
|
||||||
OutStreamer->EmitLabel(CurrentFnSym);
|
OutStreamer->emitLabel(CurrentFnSym);
|
||||||
OutStreamer->EmitValueToAlignment(8);
|
OutStreamer->emitValueToAlignment(8);
|
||||||
MCSymbol *Symbol1 = CurrentFnSymForSize;
|
MCSymbol *Symbol1 = CurrentFnSymForSize;
|
||||||
// Generates a R_PPC64_ADDR64 (from FK_DATA_8) relocation for the function
|
// Generates a R_PPC64_ADDR64 (from FK_DATA_8) relocation for the function
|
||||||
// entry point.
|
// entry point.
|
||||||
@ -1419,12 +1419,12 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
|
|||||||
const MCSymbol *const TOCEntryTarget = TOCMapPair.first;
|
const MCSymbol *const TOCEntryTarget = TOCMapPair.first;
|
||||||
MCSymbol *const TOCEntryLabel = TOCMapPair.second;
|
MCSymbol *const TOCEntryLabel = TOCMapPair.second;
|
||||||
|
|
||||||
OutStreamer->EmitLabel(TOCEntryLabel);
|
OutStreamer->emitLabel(TOCEntryLabel);
|
||||||
if (isPPC64) {
|
if (isPPC64) {
|
||||||
TS.emitTCEntry(*TOCEntryTarget);
|
TS.emitTCEntry(*TOCEntryTarget);
|
||||||
} else {
|
} else {
|
||||||
OutStreamer->EmitValueToAlignment(4);
|
OutStreamer->emitValueToAlignment(4);
|
||||||
OutStreamer->EmitSymbolValue(TOCEntryTarget, 4);
|
OutStreamer->emitSymbolValue(TOCEntryTarget, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1474,7 +1474,7 @@ void PPCLinuxAsmPrinter::emitFunctionBodyStart() {
|
|||||||
const PPCFunctionInfo *PPCFI = MF->getInfo<PPCFunctionInfo>();
|
const PPCFunctionInfo *PPCFI = MF->getInfo<PPCFunctionInfo>();
|
||||||
|
|
||||||
MCSymbol *GlobalEntryLabel = PPCFI->getGlobalEPSymbol();
|
MCSymbol *GlobalEntryLabel = PPCFI->getGlobalEPSymbol();
|
||||||
OutStreamer->EmitLabel(GlobalEntryLabel);
|
OutStreamer->emitLabel(GlobalEntryLabel);
|
||||||
const MCSymbolRefExpr *GlobalEntryLabelExp =
|
const MCSymbolRefExpr *GlobalEntryLabelExp =
|
||||||
MCSymbolRefExpr::create(GlobalEntryLabel, OutContext);
|
MCSymbolRefExpr::create(GlobalEntryLabel, OutContext);
|
||||||
|
|
||||||
@ -1512,7 +1512,7 @@ void PPCLinuxAsmPrinter::emitFunctionBodyStart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MCSymbol *LocalEntryLabel = PPCFI->getLocalEPSymbol();
|
MCSymbol *LocalEntryLabel = PPCFI->getLocalEPSymbol();
|
||||||
OutStreamer->EmitLabel(LocalEntryLabel);
|
OutStreamer->emitLabel(LocalEntryLabel);
|
||||||
const MCSymbolRefExpr *LocalEntryLabelExp =
|
const MCSymbolRefExpr *LocalEntryLabelExp =
|
||||||
MCSymbolRefExpr::create(LocalEntryLabel, OutContext);
|
MCSymbolRefExpr::create(LocalEntryLabel, OutContext);
|
||||||
const MCExpr *LocalOffsetExp =
|
const MCExpr *LocalOffsetExp =
|
||||||
@ -1633,7 +1633,7 @@ void PPCAIXAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
MCSymbol *EmittedInitSym = GVSym;
|
MCSymbol *EmittedInitSym = GVSym;
|
||||||
emitLinkage(GV, EmittedInitSym);
|
emitLinkage(GV, EmittedInitSym);
|
||||||
emitAlignment(getGVAlignment(GV, DL), GV);
|
emitAlignment(getGVAlignment(GV, DL), GV);
|
||||||
OutStreamer->EmitLabel(EmittedInitSym);
|
OutStreamer->emitLabel(EmittedInitSym);
|
||||||
emitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());
|
emitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1645,7 +1645,7 @@ void PPCAIXAsmPrinter::emitFunctionDescriptor() {
|
|||||||
// Emit function descriptor.
|
// Emit function descriptor.
|
||||||
OutStreamer->SwitchSection(
|
OutStreamer->SwitchSection(
|
||||||
cast<MCSymbolXCOFF>(CurrentFnDescSym)->getContainingCsect());
|
cast<MCSymbolXCOFF>(CurrentFnDescSym)->getContainingCsect());
|
||||||
OutStreamer->EmitLabel(CurrentFnDescSym);
|
OutStreamer->emitLabel(CurrentFnDescSym);
|
||||||
// Emit function entry point address.
|
// Emit function entry point address.
|
||||||
OutStreamer->EmitValue(MCSymbolRefExpr::create(CurrentFnSym, OutContext),
|
OutStreamer->EmitValue(MCSymbolRefExpr::create(CurrentFnSym, OutContext),
|
||||||
PointerSize);
|
PointerSize);
|
||||||
@ -1690,7 +1690,7 @@ void PPCAIXAsmPrinter::emitEndOfAsmFile(Module &M) {
|
|||||||
cast<MCSymbolXCOFF>(I.second)->setContainingCsect(TCEntry);
|
cast<MCSymbolXCOFF>(I.second)->setContainingCsect(TCEntry);
|
||||||
OutStreamer->SwitchSection(TCEntry);
|
OutStreamer->SwitchSection(TCEntry);
|
||||||
|
|
||||||
OutStreamer->EmitLabel(I.second);
|
OutStreamer->emitLabel(I.second);
|
||||||
TS.emitTCEntry(*I.first);
|
TS.emitTCEntry(*I.first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1718,7 +1718,7 @@ void RISCVAsmParser::emitAuipcInstPair(MCOperand DestReg, MCOperand TmpReg,
|
|||||||
|
|
||||||
MCSymbol *TmpLabel = Ctx.createTempSymbol(
|
MCSymbol *TmpLabel = Ctx.createTempSymbol(
|
||||||
"pcrel_hi", /* AlwaysAddSuffix */ true, /* CanBeUnnamed */ false);
|
"pcrel_hi", /* AlwaysAddSuffix */ true, /* CanBeUnnamed */ false);
|
||||||
Out.EmitLabel(TmpLabel);
|
Out.emitLabel(TmpLabel);
|
||||||
|
|
||||||
const RISCVMCExpr *SymbolHi = RISCVMCExpr::create(Symbol, VKHi, Ctx);
|
const RISCVMCExpr *SymbolHi = RISCVMCExpr::create(Symbol, VKHi, Ctx);
|
||||||
emitToStreamer(
|
emitToStreamer(
|
||||||
|
@ -233,15 +233,15 @@ void SparcAsmPrinter::LowerGETPCXAndEmitMCInsts(const MachineInstr *MI,
|
|||||||
// or <MO>, %lo(_GLOBAL_OFFSET_TABLE_+(<EndLabel>-<StartLabel>))), <MO>
|
// or <MO>, %lo(_GLOBAL_OFFSET_TABLE_+(<EndLabel>-<StartLabel>))), <MO>
|
||||||
// add <MO>, %o7, <MO>
|
// add <MO>, %o7, <MO>
|
||||||
|
|
||||||
OutStreamer->EmitLabel(StartLabel);
|
OutStreamer->emitLabel(StartLabel);
|
||||||
MCOperand Callee = createPCXCallOP(EndLabel, OutContext);
|
MCOperand Callee = createPCXCallOP(EndLabel, OutContext);
|
||||||
EmitCall(*OutStreamer, Callee, STI);
|
EmitCall(*OutStreamer, Callee, STI);
|
||||||
OutStreamer->EmitLabel(SethiLabel);
|
OutStreamer->emitLabel(SethiLabel);
|
||||||
MCOperand hiImm = createPCXRelExprOp(SparcMCExpr::VK_Sparc_PC22,
|
MCOperand hiImm = createPCXRelExprOp(SparcMCExpr::VK_Sparc_PC22,
|
||||||
GOTLabel, StartLabel, SethiLabel,
|
GOTLabel, StartLabel, SethiLabel,
|
||||||
OutContext);
|
OutContext);
|
||||||
EmitSETHI(*OutStreamer, hiImm, MCRegOP, STI);
|
EmitSETHI(*OutStreamer, hiImm, MCRegOP, STI);
|
||||||
OutStreamer->EmitLabel(EndLabel);
|
OutStreamer->emitLabel(EndLabel);
|
||||||
MCOperand loImm = createPCXRelExprOp(SparcMCExpr::VK_Sparc_PC10,
|
MCOperand loImm = createPCXRelExprOp(SparcMCExpr::VK_Sparc_PC10,
|
||||||
GOTLabel, StartLabel, EndLabel,
|
GOTLabel, StartLabel, EndLabel,
|
||||||
OutContext);
|
OutContext);
|
||||||
|
@ -1358,7 +1358,7 @@ SystemZAsmParser::parsePCRel(OperandVector &Operands, int64_t MinVal,
|
|||||||
}
|
}
|
||||||
int64_t Value = CE->getValue();
|
int64_t Value = CE->getValue();
|
||||||
MCSymbol *Sym = Ctx.createTempSymbol();
|
MCSymbol *Sym = Ctx.createTempSymbol();
|
||||||
Out.EmitLabel(Sym);
|
Out.emitLabel(Sym);
|
||||||
const MCExpr *Base = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None,
|
const MCExpr *Base = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None,
|
||||||
Ctx);
|
Ctx);
|
||||||
Expr = Value == 0 ? Base : MCBinaryExpr::createAdd(Base, Expr, Ctx);
|
Expr = Value == 0 ? Base : MCBinaryExpr::createAdd(Base, Expr, Ctx);
|
||||||
|
@ -479,7 +479,7 @@ void SystemZAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// that instead.
|
// that instead.
|
||||||
case SystemZ::Trap: {
|
case SystemZ::Trap: {
|
||||||
MCSymbol *DotSym = OutContext.createTempSymbol();
|
MCSymbol *DotSym = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(DotSym);
|
OutStreamer->emitLabel(DotSym);
|
||||||
|
|
||||||
const MCSymbolRefExpr *Expr = MCSymbolRefExpr::create(DotSym, OutContext);
|
const MCSymbolRefExpr *Expr = MCSymbolRefExpr::create(DotSym, OutContext);
|
||||||
const MCConstantExpr *ConstExpr = MCConstantExpr::create(2, OutContext);
|
const MCConstantExpr *ConstExpr = MCConstantExpr::create(2, OutContext);
|
||||||
@ -492,7 +492,7 @@ void SystemZAsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// to the relative immediate field of the jump instruction. (eg. "jo .+2")
|
// to the relative immediate field of the jump instruction. (eg. "jo .+2")
|
||||||
case SystemZ::CondTrap: {
|
case SystemZ::CondTrap: {
|
||||||
MCSymbol *DotSym = OutContext.createTempSymbol();
|
MCSymbol *DotSym = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(DotSym);
|
OutStreamer->emitLabel(DotSym);
|
||||||
|
|
||||||
const MCSymbolRefExpr *Expr = MCSymbolRefExpr::create(DotSym, OutContext);
|
const MCSymbolRefExpr *Expr = MCSymbolRefExpr::create(DotSym, OutContext);
|
||||||
const MCConstantExpr *ConstExpr = MCConstantExpr::create(2, OutContext);
|
const MCConstantExpr *ConstExpr = MCConstantExpr::create(2, OutContext);
|
||||||
@ -544,7 +544,7 @@ static unsigned EmitNop(MCContext &OutContext, MCStreamer &OutStreamer,
|
|||||||
else {
|
else {
|
||||||
MCSymbol *DotSym = OutContext.createTempSymbol();
|
MCSymbol *DotSym = OutContext.createTempSymbol();
|
||||||
const MCSymbolRefExpr *Dot = MCSymbolRefExpr::create(DotSym, OutContext);
|
const MCSymbolRefExpr *Dot = MCSymbolRefExpr::create(DotSym, OutContext);
|
||||||
OutStreamer.EmitLabel(DotSym);
|
OutStreamer.emitLabel(DotSym);
|
||||||
OutStreamer.emitInstruction(
|
OutStreamer.emitInstruction(
|
||||||
MCInstBuilder(SystemZ::BRCLAsm).addImm(0).addExpr(Dot), STI);
|
MCInstBuilder(SystemZ::BRCLAsm).addImm(0).addExpr(Dot), STI);
|
||||||
return 6;
|
return 6;
|
||||||
@ -559,9 +559,9 @@ void SystemZAsmPrinter::LowerFENTRY_CALL(const MachineInstr &MI,
|
|||||||
OutStreamer->PushSection();
|
OutStreamer->PushSection();
|
||||||
OutStreamer->SwitchSection(
|
OutStreamer->SwitchSection(
|
||||||
Ctx.getELFSection("__mcount_loc", ELF::SHT_PROGBITS, ELF::SHF_ALLOC));
|
Ctx.getELFSection("__mcount_loc", ELF::SHT_PROGBITS, ELF::SHF_ALLOC));
|
||||||
OutStreamer->EmitSymbolValue(DotSym, 8);
|
OutStreamer->emitSymbolValue(DotSym, 8);
|
||||||
OutStreamer->PopSection();
|
OutStreamer->PopSection();
|
||||||
OutStreamer->EmitLabel(DotSym);
|
OutStreamer->emitLabel(DotSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MF->getFunction().hasFnAttribute("mnop-mcount")) {
|
if (MF->getFunction().hasFnAttribute("mnop-mcount")) {
|
||||||
@ -585,7 +585,7 @@ void SystemZAsmPrinter::LowerSTACKMAP(const MachineInstr &MI) {
|
|||||||
|
|
||||||
auto &Ctx = OutStreamer->getContext();
|
auto &Ctx = OutStreamer->getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(MILabel);
|
OutStreamer->emitLabel(MILabel);
|
||||||
|
|
||||||
SM.recordStackMap(*MILabel, MI);
|
SM.recordStackMap(*MILabel, MI);
|
||||||
assert(NumNOPBytes % 2 == 0 && "Invalid number of NOP bytes requested!");
|
assert(NumNOPBytes % 2 == 0 && "Invalid number of NOP bytes requested!");
|
||||||
@ -618,7 +618,7 @@ void SystemZAsmPrinter::LowerPATCHPOINT(const MachineInstr &MI,
|
|||||||
SystemZMCInstLower &Lower) {
|
SystemZMCInstLower &Lower) {
|
||||||
auto &Ctx = OutStreamer->getContext();
|
auto &Ctx = OutStreamer->getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(MILabel);
|
OutStreamer->emitLabel(MILabel);
|
||||||
|
|
||||||
SM.recordPatchPoint(*MILabel, MI);
|
SM.recordPatchPoint(*MILabel, MI);
|
||||||
PatchPointOpers Opers(&MI);
|
PatchPointOpers Opers(&MI);
|
||||||
|
@ -327,7 +327,7 @@ getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding,
|
|||||||
// Emit a label to the streamer for the current position. This gives us
|
// Emit a label to the streamer for the current position. This gives us
|
||||||
// .-foo addressing.
|
// .-foo addressing.
|
||||||
MCSymbol *PCSym = getContext().createTempSymbol();
|
MCSymbol *PCSym = getContext().createTempSymbol();
|
||||||
Streamer.EmitLabel(PCSym);
|
Streamer.emitLabel(PCSym);
|
||||||
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, getContext());
|
const MCExpr *PC = MCSymbolRefExpr::create(PCSym, getContext());
|
||||||
return MCBinaryExpr::createSub(Sym, PC, getContext());
|
return MCBinaryExpr::createSub(Sym, PC, getContext());
|
||||||
}
|
}
|
||||||
|
@ -894,7 +894,7 @@ public:
|
|||||||
// user.
|
// user.
|
||||||
if (!LastFunctionLabel) return;
|
if (!LastFunctionLabel) return;
|
||||||
auto TempSym = getContext().createLinkerPrivateTempSymbol();
|
auto TempSym = getContext().createLinkerPrivateTempSymbol();
|
||||||
getStreamer().EmitLabel(TempSym);
|
getStreamer().emitLabel(TempSym);
|
||||||
auto Start = MCSymbolRefExpr::create(LastFunctionLabel, getContext());
|
auto Start = MCSymbolRefExpr::create(LastFunctionLabel, getContext());
|
||||||
auto End = MCSymbolRefExpr::create(TempSym, getContext());
|
auto End = MCSymbolRefExpr::create(TempSym, getContext());
|
||||||
auto Expr =
|
auto Expr =
|
||||||
|
@ -3737,9 +3737,9 @@ bool X86AsmParser::parseDirectiveEven(SMLoc L) {
|
|||||||
Section = getStreamer().getCurrentSectionOnly();
|
Section = getStreamer().getCurrentSectionOnly();
|
||||||
}
|
}
|
||||||
if (Section->UseCodeAlign())
|
if (Section->UseCodeAlign())
|
||||||
getStreamer().EmitCodeAlignment(2, 0);
|
getStreamer().emitCodeAlignment(2, 0);
|
||||||
else
|
else
|
||||||
getStreamer().EmitValueToAlignment(2, 0, 1, 0);
|
getStreamer().emitValueToAlignment(2, 0, 1, 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ bool X86WinCOFFTargetStreamer::checkInFPOPrologue(SMLoc L) {
|
|||||||
|
|
||||||
MCSymbol *X86WinCOFFTargetStreamer::emitFPOLabel() {
|
MCSymbol *X86WinCOFFTargetStreamer::emitFPOLabel() {
|
||||||
MCSymbol *Label = getContext().createTempSymbol("cfi", true);
|
MCSymbol *Label = getContext().createTempSymbol("cfi", true);
|
||||||
getStreamer().EmitLabel(Label);
|
getStreamer().emitLabel(Label);
|
||||||
return Label;
|
return Label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,7 +400,7 @@ bool X86WinCOFFTargetStreamer::emitFPOData(const MCSymbol *ProcSym, SMLoc L) {
|
|||||||
|
|
||||||
OS.EmitIntValue(unsigned(DebugSubsectionKind::FrameData), 4);
|
OS.EmitIntValue(unsigned(DebugSubsectionKind::FrameData), 4);
|
||||||
OS.emitAbsoluteSymbolDiff(FrameEnd, FrameBegin, 4);
|
OS.emitAbsoluteSymbolDiff(FrameEnd, FrameBegin, 4);
|
||||||
OS.EmitLabel(FrameBegin);
|
OS.emitLabel(FrameBegin);
|
||||||
|
|
||||||
// Start with the RVA of the function in question.
|
// Start with the RVA of the function in question.
|
||||||
OS.EmitValue(MCSymbolRefExpr::create(FPO->Function,
|
OS.EmitValue(MCSymbolRefExpr::create(FPO->Function,
|
||||||
@ -437,8 +437,8 @@ bool X86WinCOFFTargetStreamer::emitFPOData(const MCSymbol *ProcSym, SMLoc L) {
|
|||||||
FSM.emitFrameDataRecord(OS, Inst.Label);
|
FSM.emitFrameDataRecord(OS, Inst.Label);
|
||||||
}
|
}
|
||||||
|
|
||||||
OS.EmitValueToAlignment(4, 0);
|
OS.emitValueToAlignment(4, 0);
|
||||||
OS.EmitLabel(FrameEnd);
|
OS.emitLabel(FrameEnd);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -656,7 +656,7 @@ static void
|
|||||||
emitNonLazySymbolPointer(MCStreamer &OutStreamer, MCSymbol *StubLabel,
|
emitNonLazySymbolPointer(MCStreamer &OutStreamer, MCSymbol *StubLabel,
|
||||||
MachineModuleInfoImpl::StubValueTy &MCSym) {
|
MachineModuleInfoImpl::StubValueTy &MCSym) {
|
||||||
// L_foo$stub:
|
// L_foo$stub:
|
||||||
OutStreamer.EmitLabel(StubLabel);
|
OutStreamer.emitLabel(StubLabel);
|
||||||
// .indirect_symbol _foo
|
// .indirect_symbol _foo
|
||||||
OutStreamer.emitSymbolAttribute(MCSym.getPointer(), MCSA_IndirectSymbol);
|
OutStreamer.emitSymbolAttribute(MCSym.getPointer(), MCSA_IndirectSymbol);
|
||||||
|
|
||||||
|
@ -1245,7 +1245,7 @@ void X86AsmPrinter::LowerSTATEPOINT(const MachineInstr &MI,
|
|||||||
// and PATCHPOINT
|
// and PATCHPOINT
|
||||||
auto &Ctx = OutStreamer->getContext();
|
auto &Ctx = OutStreamer->getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(MILabel);
|
OutStreamer->emitLabel(MILabel);
|
||||||
SM.recordStatepoint(*MILabel, MI);
|
SM.recordStatepoint(*MILabel, MI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1265,7 +1265,7 @@ void X86AsmPrinter::LowerFAULTING_OP(const MachineInstr &FaultingMI,
|
|||||||
|
|
||||||
auto &Ctx = OutStreamer->getContext();
|
auto &Ctx = OutStreamer->getContext();
|
||||||
MCSymbol *FaultingLabel = Ctx.createTempSymbol();
|
MCSymbol *FaultingLabel = Ctx.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(FaultingLabel);
|
OutStreamer->emitLabel(FaultingLabel);
|
||||||
|
|
||||||
assert(FK < FaultMaps::FaultKindMax && "Invalid Faulting Kind!");
|
assert(FK < FaultMaps::FaultKindMax && "Invalid Faulting Kind!");
|
||||||
FM.recordFaultingOp(FK, FaultingLabel, HandlerLabel);
|
FM.recordFaultingOp(FK, FaultingLabel, HandlerLabel);
|
||||||
@ -1345,7 +1345,7 @@ void X86AsmPrinter::LowerSTACKMAP(const MachineInstr &MI) {
|
|||||||
|
|
||||||
auto &Ctx = OutStreamer->getContext();
|
auto &Ctx = OutStreamer->getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(MILabel);
|
OutStreamer->emitLabel(MILabel);
|
||||||
|
|
||||||
SM.recordStackMap(*MILabel, MI);
|
SM.recordStackMap(*MILabel, MI);
|
||||||
unsigned NumShadowBytes = MI.getOperand(1).getImm();
|
unsigned NumShadowBytes = MI.getOperand(1).getImm();
|
||||||
@ -1364,7 +1364,7 @@ void X86AsmPrinter::LowerPATCHPOINT(const MachineInstr &MI,
|
|||||||
|
|
||||||
auto &Ctx = OutStreamer->getContext();
|
auto &Ctx = OutStreamer->getContext();
|
||||||
MCSymbol *MILabel = Ctx.createTempSymbol();
|
MCSymbol *MILabel = Ctx.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(MILabel);
|
OutStreamer->emitLabel(MILabel);
|
||||||
SM.recordPatchPoint(*MILabel, MI);
|
SM.recordPatchPoint(*MILabel, MI);
|
||||||
|
|
||||||
PatchPointOpers opers(&MI);
|
PatchPointOpers opers(&MI);
|
||||||
@ -1445,8 +1445,8 @@ void X86AsmPrinter::LowerPATCHABLE_EVENT_CALL(const MachineInstr &MI,
|
|||||||
// First we emit the label and the jump.
|
// First we emit the label and the jump.
|
||||||
auto CurSled = OutContext.createTempSymbol("xray_event_sled_", true);
|
auto CurSled = OutContext.createTempSymbol("xray_event_sled_", true);
|
||||||
OutStreamer->AddComment("# XRay Custom Event Log");
|
OutStreamer->AddComment("# XRay Custom Event Log");
|
||||||
OutStreamer->EmitCodeAlignment(2);
|
OutStreamer->emitCodeAlignment(2);
|
||||||
OutStreamer->EmitLabel(CurSled);
|
OutStreamer->emitLabel(CurSled);
|
||||||
|
|
||||||
// Use a two-byte `jmp`. This version of JMP takes an 8-bit relative offset as
|
// Use a two-byte `jmp`. This version of JMP takes an 8-bit relative offset as
|
||||||
// an operand (computed as an offset from the jmp instruction).
|
// an operand (computed as an offset from the jmp instruction).
|
||||||
@ -1541,8 +1541,8 @@ void X86AsmPrinter::LowerPATCHABLE_TYPED_EVENT_CALL(const MachineInstr &MI,
|
|||||||
// First we emit the label and the jump.
|
// First we emit the label and the jump.
|
||||||
auto CurSled = OutContext.createTempSymbol("xray_typed_event_sled_", true);
|
auto CurSled = OutContext.createTempSymbol("xray_typed_event_sled_", true);
|
||||||
OutStreamer->AddComment("# XRay Typed Event Log");
|
OutStreamer->AddComment("# XRay Typed Event Log");
|
||||||
OutStreamer->EmitCodeAlignment(2);
|
OutStreamer->emitCodeAlignment(2);
|
||||||
OutStreamer->EmitLabel(CurSled);
|
OutStreamer->emitLabel(CurSled);
|
||||||
|
|
||||||
// Use a two-byte `jmp`. This version of JMP takes an 8-bit relative offset as
|
// Use a two-byte `jmp`. This version of JMP takes an 8-bit relative offset as
|
||||||
// an operand (computed as an offset from the jmp instruction).
|
// an operand (computed as an offset from the jmp instruction).
|
||||||
@ -1643,8 +1643,8 @@ void X86AsmPrinter::LowerPATCHABLE_FUNCTION_ENTER(const MachineInstr &MI,
|
|||||||
// call <relative offset, 32-bits> // 5 bytes
|
// call <relative offset, 32-bits> // 5 bytes
|
||||||
//
|
//
|
||||||
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
||||||
OutStreamer->EmitCodeAlignment(2);
|
OutStreamer->emitCodeAlignment(2);
|
||||||
OutStreamer->EmitLabel(CurSled);
|
OutStreamer->emitLabel(CurSled);
|
||||||
|
|
||||||
// Use a two-byte `jmp`. This version of JMP takes an 8-bit relative offset as
|
// Use a two-byte `jmp`. This version of JMP takes an 8-bit relative offset as
|
||||||
// an operand (computed as an offset from the jmp instruction).
|
// an operand (computed as an offset from the jmp instruction).
|
||||||
@ -1673,8 +1673,8 @@ void X86AsmPrinter::LowerPATCHABLE_RET(const MachineInstr &MI,
|
|||||||
//
|
//
|
||||||
// This just makes sure that the alignment for the next instruction is 2.
|
// This just makes sure that the alignment for the next instruction is 2.
|
||||||
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
||||||
OutStreamer->EmitCodeAlignment(2);
|
OutStreamer->emitCodeAlignment(2);
|
||||||
OutStreamer->EmitLabel(CurSled);
|
OutStreamer->emitLabel(CurSled);
|
||||||
unsigned OpCode = MI.getOperand(0).getImm();
|
unsigned OpCode = MI.getOperand(0).getImm();
|
||||||
MCInst Ret;
|
MCInst Ret;
|
||||||
Ret.setOpcode(OpCode);
|
Ret.setOpcode(OpCode);
|
||||||
@ -1697,8 +1697,8 @@ void X86AsmPrinter::LowerPATCHABLE_TAIL_CALL(const MachineInstr &MI,
|
|||||||
// the PATCHABLE_FUNCTION_ENTER case, followed by the lowering of the actual
|
// the PATCHABLE_FUNCTION_ENTER case, followed by the lowering of the actual
|
||||||
// tail call much like how we have it in PATCHABLE_RET.
|
// tail call much like how we have it in PATCHABLE_RET.
|
||||||
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
auto CurSled = OutContext.createTempSymbol("xray_sled_", true);
|
||||||
OutStreamer->EmitCodeAlignment(2);
|
OutStreamer->emitCodeAlignment(2);
|
||||||
OutStreamer->EmitLabel(CurSled);
|
OutStreamer->emitLabel(CurSled);
|
||||||
auto Target = OutContext.createTempSymbol();
|
auto Target = OutContext.createTempSymbol();
|
||||||
|
|
||||||
// Use a two-byte `jmp`. This version of JMP takes an 8-bit relative offset as
|
// Use a two-byte `jmp`. This version of JMP takes an 8-bit relative offset as
|
||||||
@ -1706,7 +1706,7 @@ void X86AsmPrinter::LowerPATCHABLE_TAIL_CALL(const MachineInstr &MI,
|
|||||||
// FIXME: Find another less hacky way do force the relative jump.
|
// FIXME: Find another less hacky way do force the relative jump.
|
||||||
OutStreamer->emitBytes("\xeb\x09");
|
OutStreamer->emitBytes("\xeb\x09");
|
||||||
EmitNops(*OutStreamer, 9, Subtarget->is64Bit(), getSubtargetInfo());
|
EmitNops(*OutStreamer, 9, Subtarget->is64Bit(), getSubtargetInfo());
|
||||||
OutStreamer->EmitLabel(Target);
|
OutStreamer->emitLabel(Target);
|
||||||
recordSled(CurSled, MI, SledKind::TAIL_CALL);
|
recordSled(CurSled, MI, SledKind::TAIL_CALL);
|
||||||
|
|
||||||
unsigned OpCode = MI.getOperand(0).getImm();
|
unsigned OpCode = MI.getOperand(0).getImm();
|
||||||
@ -2018,7 +2018,7 @@ void X86AsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
MCInstLowering.Lower(MI, Inst);
|
MCInstLowering.Lower(MI, Inst);
|
||||||
EmitAndCountInstruction(Inst);
|
EmitAndCountInstruction(Inst);
|
||||||
CurrentPatchableFunctionEntrySym = createTempSymbol("patch");
|
CurrentPatchableFunctionEntrySym = createTempSymbol("patch");
|
||||||
OutStreamer->EmitLabel(CurrentPatchableFunctionEntrySym);
|
OutStreamer->emitLabel(CurrentPatchableFunctionEntrySym);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2141,7 +2141,7 @@ void X86AsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Emit the label.
|
// Emit the label.
|
||||||
OutStreamer->EmitLabel(PICBase);
|
OutStreamer->emitLabel(PICBase);
|
||||||
|
|
||||||
// popl $reg
|
// popl $reg
|
||||||
EmitAndCountInstruction(
|
EmitAndCountInstruction(
|
||||||
@ -2166,7 +2166,7 @@ void X86AsmPrinter::emitInstruction(const MachineInstr *MI) {
|
|||||||
// However, we can't generate a ".", so just emit a new label here and refer
|
// However, we can't generate a ".", so just emit a new label here and refer
|
||||||
// to it.
|
// to it.
|
||||||
MCSymbol *DotSym = OutContext.createTempSymbol();
|
MCSymbol *DotSym = OutContext.createTempSymbol();
|
||||||
OutStreamer->EmitLabel(DotSym);
|
OutStreamer->emitLabel(DotSym);
|
||||||
|
|
||||||
// Now that we have emitted the label, lower the complex operand expression.
|
// Now that we have emitted the label, lower the complex operand expression.
|
||||||
MCSymbol *OpSym = MCInstLowering.GetSymbolFromOperand(MI->getOperand(2));
|
MCSymbol *OpSym = MCInstLowering.GetSymbolFromOperand(MI->getOperand(2));
|
||||||
|
@ -152,7 +152,7 @@ void XCoreAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
|
|||||||
OutStreamer->emitSymbolAttribute(GVSym, MCSA_ELF_TypeObject);
|
OutStreamer->emitSymbolAttribute(GVSym, MCSA_ELF_TypeObject);
|
||||||
OutStreamer->emitELFSize(GVSym, MCConstantExpr::create(Size, OutContext));
|
OutStreamer->emitELFSize(GVSym, MCConstantExpr::create(Size, OutContext));
|
||||||
}
|
}
|
||||||
OutStreamer->EmitLabel(GVSym);
|
OutStreamer->emitLabel(GVSym);
|
||||||
|
|
||||||
emitGlobalConstant(DL, C);
|
emitGlobalConstant(DL, C);
|
||||||
// The ABI requires that unsigned scalar types smaller than 32 bits
|
// The ABI requires that unsigned scalar types smaller than 32 bits
|
||||||
@ -178,7 +178,7 @@ void XCoreAsmPrinter::emitFunctionBodyEnd() {
|
|||||||
void XCoreAsmPrinter::emitFunctionEntryLabel() {
|
void XCoreAsmPrinter::emitFunctionEntryLabel() {
|
||||||
// Mark the start of the function
|
// Mark the start of the function
|
||||||
getTargetStreamer().emitCCTopFunction(CurrentFnSym->getName());
|
getTargetStreamer().emitCCTopFunction(CurrentFnSym->getName());
|
||||||
OutStreamer->EmitLabel(CurrentFnSym);
|
OutStreamer->emitLabel(CurrentFnSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCoreAsmPrinter::
|
void XCoreAsmPrinter::
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
# Linker could satisfy alignment by removing NOPs after linker relaxation.
|
# Linker could satisfy alignment by removing NOPs after linker relaxation.
|
||||||
|
|
||||||
# The first R_RISCV_ALIGN come from
|
# The first R_RISCV_ALIGN come from
|
||||||
# MCELFStreamer::InitSections() EmitCodeAlignment(4).
|
# MCELFStreamer::InitSections() emitCodeAlignment(4).
|
||||||
# C-EXT-RELAX-RELOC: R_RISCV_ALIGN - 0x2
|
# C-EXT-RELAX-RELOC: R_RISCV_ALIGN - 0x2
|
||||||
# C-EXT-RELAX-INST: c.nop
|
# C-EXT-RELAX-INST: c.nop
|
||||||
test:
|
test:
|
||||||
|
@ -158,7 +158,7 @@ void DwarfStreamer::emitCompileUnitHeader(CompileUnit &Unit) {
|
|||||||
|
|
||||||
/// The start of the unit within its section.
|
/// The start of the unit within its section.
|
||||||
Unit.setLabelBegin(Asm->createTempSymbol("cu_begin"));
|
Unit.setLabelBegin(Asm->createTempSymbol("cu_begin"));
|
||||||
Asm->OutStreamer->EmitLabel(Unit.getLabelBegin());
|
Asm->OutStreamer->emitLabel(Unit.getLabelBegin());
|
||||||
|
|
||||||
// Emit size of content not including length itself. The size has already
|
// Emit size of content not including length itself. The size has already
|
||||||
// been computed in CompileUnit::computeOffsets(). Subtract 4 to that size to
|
// been computed in CompileUnit::computeOffsets(). Subtract 4 to that size to
|
||||||
@ -270,7 +270,7 @@ void DwarfStreamer::emitAppleNamespaces(
|
|||||||
AccelTable<AppleAccelTableStaticOffsetData> &Table) {
|
AccelTable<AppleAccelTableStaticOffsetData> &Table) {
|
||||||
Asm->OutStreamer->SwitchSection(MOFI->getDwarfAccelNamespaceSection());
|
Asm->OutStreamer->SwitchSection(MOFI->getDwarfAccelNamespaceSection());
|
||||||
auto *SectionBegin = Asm->createTempSymbol("namespac_begin");
|
auto *SectionBegin = Asm->createTempSymbol("namespac_begin");
|
||||||
Asm->OutStreamer->EmitLabel(SectionBegin);
|
Asm->OutStreamer->emitLabel(SectionBegin);
|
||||||
emitAppleAccelTable(Asm.get(), Table, "namespac", SectionBegin);
|
emitAppleAccelTable(Asm.get(), Table, "namespac", SectionBegin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ void DwarfStreamer::emitAppleNames(
|
|||||||
AccelTable<AppleAccelTableStaticOffsetData> &Table) {
|
AccelTable<AppleAccelTableStaticOffsetData> &Table) {
|
||||||
Asm->OutStreamer->SwitchSection(MOFI->getDwarfAccelNamesSection());
|
Asm->OutStreamer->SwitchSection(MOFI->getDwarfAccelNamesSection());
|
||||||
auto *SectionBegin = Asm->createTempSymbol("names_begin");
|
auto *SectionBegin = Asm->createTempSymbol("names_begin");
|
||||||
Asm->OutStreamer->EmitLabel(SectionBegin);
|
Asm->OutStreamer->emitLabel(SectionBegin);
|
||||||
emitAppleAccelTable(Asm.get(), Table, "names", SectionBegin);
|
emitAppleAccelTable(Asm.get(), Table, "names", SectionBegin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ void DwarfStreamer::emitAppleObjc(
|
|||||||
AccelTable<AppleAccelTableStaticOffsetData> &Table) {
|
AccelTable<AppleAccelTableStaticOffsetData> &Table) {
|
||||||
Asm->OutStreamer->SwitchSection(MOFI->getDwarfAccelObjCSection());
|
Asm->OutStreamer->SwitchSection(MOFI->getDwarfAccelObjCSection());
|
||||||
auto *SectionBegin = Asm->createTempSymbol("objc_begin");
|
auto *SectionBegin = Asm->createTempSymbol("objc_begin");
|
||||||
Asm->OutStreamer->EmitLabel(SectionBegin);
|
Asm->OutStreamer->emitLabel(SectionBegin);
|
||||||
emitAppleAccelTable(Asm.get(), Table, "objc", SectionBegin);
|
emitAppleAccelTable(Asm.get(), Table, "objc", SectionBegin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,7 +294,7 @@ void DwarfStreamer::emitAppleTypes(
|
|||||||
AccelTable<AppleAccelTableStaticTypeData> &Table) {
|
AccelTable<AppleAccelTableStaticTypeData> &Table) {
|
||||||
Asm->OutStreamer->SwitchSection(MOFI->getDwarfAccelTypesSection());
|
Asm->OutStreamer->SwitchSection(MOFI->getDwarfAccelTypesSection());
|
||||||
auto *SectionBegin = Asm->createTempSymbol("types_begin");
|
auto *SectionBegin = Asm->createTempSymbol("types_begin");
|
||||||
Asm->OutStreamer->EmitLabel(SectionBegin);
|
Asm->OutStreamer->emitLabel(SectionBegin);
|
||||||
emitAppleAccelTable(Asm.get(), Table, "types", SectionBegin);
|
emitAppleAccelTable(Asm.get(), Table, "types", SectionBegin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ void DwarfStreamer::emitUnitRangesEntries(CompileUnit &Unit,
|
|||||||
unsigned Padding = offsetToAlignment(HeaderSize, Align(TupleSize));
|
unsigned Padding = offsetToAlignment(HeaderSize, Align(TupleSize));
|
||||||
|
|
||||||
Asm->emitLabelDifference(EndLabel, BeginLabel, 4); // Arange length
|
Asm->emitLabelDifference(EndLabel, BeginLabel, 4); // Arange length
|
||||||
Asm->OutStreamer->EmitLabel(BeginLabel);
|
Asm->OutStreamer->emitLabel(BeginLabel);
|
||||||
Asm->emitInt16(dwarf::DW_ARANGES_VERSION); // Version number
|
Asm->emitInt16(dwarf::DW_ARANGES_VERSION); // Version number
|
||||||
Asm->emitInt32(Unit.getStartOffset()); // Corresponding unit's offset
|
Asm->emitInt32(Unit.getStartOffset()); // Corresponding unit's offset
|
||||||
Asm->emitInt8(AddressSize); // Address size
|
Asm->emitInt8(AddressSize); // Address size
|
||||||
@ -403,7 +403,7 @@ void DwarfStreamer::emitUnitRangesEntries(CompileUnit &Unit,
|
|||||||
// Emit terminator
|
// Emit terminator
|
||||||
Asm->OutStreamer->EmitIntValue(0, AddressSize);
|
Asm->OutStreamer->EmitIntValue(0, AddressSize);
|
||||||
Asm->OutStreamer->EmitIntValue(0, AddressSize);
|
Asm->OutStreamer->EmitIntValue(0, AddressSize);
|
||||||
Asm->OutStreamer->EmitLabel(EndLabel);
|
Asm->OutStreamer->emitLabel(EndLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DoDebugRanges)
|
if (!DoDebugRanges)
|
||||||
@ -506,7 +506,7 @@ void DwarfStreamer::emitLineTableForUnit(MCDwarfLineTableParams Params,
|
|||||||
// The first 4 bytes is the total length of the information for this
|
// The first 4 bytes is the total length of the information for this
|
||||||
// compilation unit (not including these 4 bytes for the length).
|
// compilation unit (not including these 4 bytes for the length).
|
||||||
Asm->emitLabelDifference(LineEndSym, LineStartSym, 4);
|
Asm->emitLabelDifference(LineEndSym, LineStartSym, 4);
|
||||||
Asm->OutStreamer->EmitLabel(LineStartSym);
|
Asm->OutStreamer->emitLabel(LineStartSym);
|
||||||
// Copy Prologue.
|
// Copy Prologue.
|
||||||
MS->emitBytes(PrologueBytes);
|
MS->emitBytes(PrologueBytes);
|
||||||
LineSectionSize += PrologueBytes.size() + 4;
|
LineSectionSize += PrologueBytes.size() + 4;
|
||||||
@ -521,7 +521,7 @@ void DwarfStreamer::emitLineTableForUnit(MCDwarfLineTableParams Params,
|
|||||||
EncodingOS);
|
EncodingOS);
|
||||||
MS->emitBytes(EncodingOS.str());
|
MS->emitBytes(EncodingOS.str());
|
||||||
LineSectionSize += EncodingBuffer.size();
|
LineSectionSize += EncodingBuffer.size();
|
||||||
MS->EmitLabel(LineEndSym);
|
MS->emitLabel(LineEndSym);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -636,7 +636,7 @@ void DwarfStreamer::emitLineTableForUnit(MCDwarfLineTableParams Params,
|
|||||||
EncodingBuffer.resize(0);
|
EncodingBuffer.resize(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
MS->EmitLabel(LineEndSym);
|
MS->emitLabel(LineEndSym);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Copy the debug_line over to the updated binary while unobfuscating the file
|
/// Copy the debug_line over to the updated binary while unobfuscating the file
|
||||||
@ -661,14 +661,14 @@ void DwarfStreamer::translateLineTable(DataExtractor Data, uint64_t Offset) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
|
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
|
||||||
Asm->OutStreamer->EmitLabel(BeginLabel);
|
Asm->OutStreamer->emitLabel(BeginLabel);
|
||||||
Asm->emitInt16(Version);
|
Asm->emitInt16(Version);
|
||||||
LineSectionSize += 6;
|
LineSectionSize += 6;
|
||||||
|
|
||||||
MCSymbol *HeaderBeginLabel = MC->createTempSymbol();
|
MCSymbol *HeaderBeginLabel = MC->createTempSymbol();
|
||||||
MCSymbol *HeaderEndLabel = MC->createTempSymbol();
|
MCSymbol *HeaderEndLabel = MC->createTempSymbol();
|
||||||
Asm->emitLabelDifference(HeaderEndLabel, HeaderBeginLabel, 4);
|
Asm->emitLabelDifference(HeaderEndLabel, HeaderBeginLabel, 4);
|
||||||
Asm->OutStreamer->EmitLabel(HeaderBeginLabel);
|
Asm->OutStreamer->emitLabel(HeaderBeginLabel);
|
||||||
Offset += 4;
|
Offset += 4;
|
||||||
LineSectionSize += 4;
|
LineSectionSize += 4;
|
||||||
|
|
||||||
@ -711,13 +711,13 @@ void DwarfStreamer::translateLineTable(DataExtractor Data, uint64_t Offset) {
|
|||||||
Asm->emitInt8(0);
|
Asm->emitInt8(0);
|
||||||
LineSectionSize += 1;
|
LineSectionSize += 1;
|
||||||
|
|
||||||
Asm->OutStreamer->EmitLabel(HeaderEndLabel);
|
Asm->OutStreamer->emitLabel(HeaderEndLabel);
|
||||||
|
|
||||||
// Copy the actual line table program over.
|
// Copy the actual line table program over.
|
||||||
Asm->OutStreamer->emitBytes(Contents.slice(Offset, UnitEnd));
|
Asm->OutStreamer->emitBytes(Contents.slice(Offset, UnitEnd));
|
||||||
LineSectionSize += UnitEnd - Offset;
|
LineSectionSize += UnitEnd - Offset;
|
||||||
|
|
||||||
Asm->OutStreamer->EmitLabel(EndLabel);
|
Asm->OutStreamer->emitLabel(EndLabel);
|
||||||
Offset = UnitEnd;
|
Offset = UnitEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,7 +762,7 @@ void DwarfStreamer::emitPubSectionForUnit(
|
|||||||
if (!HeaderEmitted) {
|
if (!HeaderEmitted) {
|
||||||
// Emit the header.
|
// Emit the header.
|
||||||
Asm->emitLabelDifference(EndLabel, BeginLabel, 4); // Length
|
Asm->emitLabelDifference(EndLabel, BeginLabel, 4); // Length
|
||||||
Asm->OutStreamer->EmitLabel(BeginLabel);
|
Asm->OutStreamer->emitLabel(BeginLabel);
|
||||||
Asm->emitInt16(dwarf::DW_PUBNAMES_VERSION); // Version
|
Asm->emitInt16(dwarf::DW_PUBNAMES_VERSION); // Version
|
||||||
Asm->emitInt32(Unit.getStartOffset()); // Unit offset
|
Asm->emitInt32(Unit.getStartOffset()); // Unit offset
|
||||||
Asm->emitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset()); // Size
|
Asm->emitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset()); // Size
|
||||||
@ -779,7 +779,7 @@ void DwarfStreamer::emitPubSectionForUnit(
|
|||||||
if (!HeaderEmitted)
|
if (!HeaderEmitted)
|
||||||
return;
|
return;
|
||||||
Asm->emitInt32(0); // End marker.
|
Asm->emitInt32(0); // End marker.
|
||||||
Asm->OutStreamer->EmitLabel(EndLabel);
|
Asm->OutStreamer->emitLabel(EndLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Emit .debug_pubnames for \p Unit.
|
/// Emit .debug_pubnames for \p Unit.
|
||||||
|
@ -92,7 +92,7 @@ private:
|
|||||||
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override {
|
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
void emitValueToAlignment(unsigned ByteAlignment, int64_t Value,
|
||||||
unsigned ValueSize,
|
unsigned ValueSize,
|
||||||
unsigned MaxBytesToEmit) override {}
|
unsigned MaxBytesToEmit) override {}
|
||||||
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
|
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
|
||||||
uint64_t Size = 0, unsigned ByteAlignment = 0,
|
uint64_t Size = 0, unsigned ByteAlignment = 0,
|
||||||
SMLoc Loc = SMLoc()) override {}
|
SMLoc Loc = SMLoc()) override {}
|
||||||
void EmitGPRel32Value(const MCExpr *Value) override {}
|
void emitGPRel32Value(const MCExpr *Value) override {}
|
||||||
void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
|
void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
|
||||||
void EmitCOFFSymbolStorageClass(int StorageClass) override {}
|
void EmitCOFFSymbolStorageClass(int StorageClass) override {}
|
||||||
void EmitCOFFSymbolType(int Type) override {}
|
void EmitCOFFSymbolType(int Type) override {}
|
||||||
|
@ -236,7 +236,7 @@ void dwarfgen::LineTable::generate(MCContext &MC, AsmPrinter &Asm) const {
|
|||||||
|
|
||||||
writeData(Contents, Asm);
|
writeData(Contents, Asm);
|
||||||
if (EndSymbol != nullptr)
|
if (EndSymbol != nullptr)
|
||||||
Asm.OutStreamer->EmitLabel(EndSymbol);
|
Asm.OutStreamer->emitLabel(EndSymbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dwarfgen::LineTable::writeData(ArrayRef<ValueAndLength> Data,
|
void dwarfgen::LineTable::writeData(ArrayRef<ValueAndLength> Data,
|
||||||
@ -287,7 +287,7 @@ MCSymbol *dwarfgen::LineTable::writeDefaultPrologue(AsmPrinter &Asm) const {
|
|||||||
} else {
|
} else {
|
||||||
Asm.emitLabelDifference(UnitEnd, UnitStart, 4);
|
Asm.emitLabelDifference(UnitEnd, UnitStart, 4);
|
||||||
}
|
}
|
||||||
Asm.OutStreamer->EmitLabel(UnitStart);
|
Asm.OutStreamer->emitLabel(UnitStart);
|
||||||
Asm.emitInt16(Version);
|
Asm.emitInt16(Version);
|
||||||
if (Version == 5) {
|
if (Version == 5) {
|
||||||
Asm.emitInt8(AddrSize);
|
Asm.emitInt8(AddrSize);
|
||||||
@ -298,11 +298,11 @@ MCSymbol *dwarfgen::LineTable::writeDefaultPrologue(AsmPrinter &Asm) const {
|
|||||||
MCSymbol *PrologueEnd = Asm.createTempSymbol("line_prologue_end");
|
MCSymbol *PrologueEnd = Asm.createTempSymbol("line_prologue_end");
|
||||||
Asm.emitLabelDifference(PrologueEnd, PrologueStart,
|
Asm.emitLabelDifference(PrologueEnd, PrologueStart,
|
||||||
Format == DwarfFormat::DWARF64 ? 8 : 4);
|
Format == DwarfFormat::DWARF64 ? 8 : 4);
|
||||||
Asm.OutStreamer->EmitLabel(PrologueStart);
|
Asm.OutStreamer->emitLabel(PrologueStart);
|
||||||
|
|
||||||
DWARFDebugLine::Prologue DefaultPrologue = createBasicPrologue();
|
DWARFDebugLine::Prologue DefaultPrologue = createBasicPrologue();
|
||||||
writeProloguePayload(DefaultPrologue, Asm);
|
writeProloguePayload(DefaultPrologue, Asm);
|
||||||
Asm.OutStreamer->EmitLabel(PrologueEnd);
|
Asm.OutStreamer->emitLabel(PrologueEnd);
|
||||||
return UnitEnd;
|
return UnitEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user