[AsmPrinter] De-capitalize some AsmPrinter::Emit* functions

Similar to rL328848.
This commit is contained in:
Fangrui Song 2020-02-13 13:26:21 -08:00
parent c2e8a421ac
commit 0bc77a0f0d
32 changed files with 308 additions and 305 deletions

View File

@ -970,7 +970,7 @@ a realistic example:
// Emit the address of the safe point.
OS.AddComment("safe point address");
MCSymbol *Label = PI->Label;
AP.EmitLabelPlusOffset(Label/*Hi*/, 0/*Offset*/, 4/*Size*/);
AP.emitLabelPlusOffset(Label/*Hi*/, 0/*Offset*/, 4/*Size*/);
}
// Stack information never change in safe points! Only print info from the

View File

@ -512,38 +512,39 @@ public:
/// Emit something like ".long Hi-Lo" where the size in bytes of the directive
/// is specified by Size and Hi/Lo specify the labels. This implicitly uses
/// .set if it is available.
void EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo,
void emitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo,
unsigned Size) const;
/// Emit something like ".uleb128 Hi-Lo".
void EmitLabelDifferenceAsULEB128(const MCSymbol *Hi,
void emitLabelDifferenceAsULEB128(const MCSymbol *Hi,
const MCSymbol *Lo) const;
/// Emit something like ".long Label+Offset" where the size in bytes of the
/// directive is specified by Size and Label specifies the label. This
/// implicitly uses .set if it is available.
void EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
void emitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
unsigned Size, bool IsSectionRelative = false) const;
/// Emit something like ".long Label" where the size in bytes of the directive
/// is specified by Size and Label specifies the label.
void EmitLabelReference(const MCSymbol *Label, unsigned Size,
void emitLabelReference(const MCSymbol *Label, unsigned Size,
bool IsSectionRelative = false) const {
EmitLabelPlusOffset(Label, 0, Size, IsSectionRelative);
emitLabelPlusOffset(Label, 0, Size, IsSectionRelative);
}
/// Emit something like ".long Label + Offset".
void EmitDwarfOffset(const MCSymbol *Label, uint64_t Offset) const;
void emitDwarfOffset(const MCSymbol *Label, uint64_t Offset) const;
//===------------------------------------------------------------------===//
// Dwarf Emission Helper Routines
//===------------------------------------------------------------------===//
/// Emit the specified signed leb128 value.
void EmitSLEB128(int64_t Value, const char *Desc = nullptr) const;
void emitSLEB128(int64_t Value, const char *Desc = nullptr) const;
/// Emit the specified unsigned leb128 value.
void EmitULEB128(uint64_t Value, const char *Desc = nullptr, unsigned PadTo = 0) const;
void emitULEB128(uint64_t Value, const char *Desc = nullptr,
unsigned PadTo = 0) const;
/// Emit a .byte 42 directive that corresponds to an encoding. If verbose
/// assembly output is enabled, we output comments describing the encoding.
@ -575,10 +576,10 @@ public:
}
/// Emit reference to a call site with a specified encoding
void EmitCallSiteOffset(const MCSymbol *Hi, const MCSymbol *Lo,
void emitCallSiteOffset(const MCSymbol *Hi, const MCSymbol *Lo,
unsigned Encoding) const;
/// Emit an integer value corresponding to the call site encoding
void EmitCallSiteValue(uint64_t Value, unsigned Encoding) const;
void emitCallSiteValue(uint64_t Value, unsigned Encoding) const;
/// Get the value for DW_AT_APPLE_isa. Zero if no isa encoding specified.
virtual unsigned getISAEncoding() { return 0; }
@ -587,7 +588,7 @@ public:
///
/// \p Value - The value to emit.
/// \p Size - The size of the integer (in bytes) to emit.
virtual void EmitDebugValue(const MCExpr *Value, unsigned Size) const;
virtual void emitDebugValue(const MCExpr *Value, unsigned Size) const;
//===------------------------------------------------------------------===//
// Dwarf Lowering Routines
@ -603,7 +604,7 @@ public:
emitDwarfAbbrev(*Abbrev);
// Mark end of abbreviations.
EmitULEB128(0, "EOM(3)");
emitULEB128(0, "EOM(3)");
}
void emitDwarfAbbrev(const DIEAbbrev &Abbrev) const;
@ -659,12 +660,12 @@ public:
/// This emits visibility information about symbol, if this is supported by
/// the target.
void EmitVisibility(MCSymbol *Sym, unsigned Visibility,
void emitVisibility(MCSymbol *Sym, unsigned Visibility,
bool IsDefinition = true) const;
/// This emits linkage information about \p GVSym based on \p GV, if this is
/// supported by the target.
void EmitLinkage(const GlobalValue *GV, MCSymbol *GVSym) const;
void emitLinkage(const GlobalValue *GV, MCSymbol *GVSym) const;
/// Return the alignment for the specified \p GV.
static Align getGVAlignment(const GlobalValue *GV, const DataLayout &DL,

View File

@ -41,7 +41,7 @@ public:
void InitSections(bool NoExecStack) override;
void ChangeSection(MCSection *Section, const MCExpr *Subsection) 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;
void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
void EmitThumbFunc(MCSymbol *Func) override;

View File

@ -114,13 +114,13 @@ public:
/// @{
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);
void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
void EmitValueImpl(const MCExpr *Value, unsigned Size,
SMLoc Loc = SMLoc()) override;
void EmitULEB128Value(const MCExpr *Value) override;
void EmitSLEB128Value(const MCExpr *Value) override;
void emitULEB128Value(const MCExpr *Value) override;
void emitSLEB128Value(const MCExpr *Value) override;
void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override;
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
@ -140,14 +140,13 @@ public:
unsigned MaxBytesToEmit = 0) override;
void emitValueToOffset(const MCExpr *Offset, unsigned char Value,
SMLoc Loc) override;
void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
unsigned Column, unsigned Flags,
unsigned Isa, unsigned Discriminator,
void emitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column,
unsigned Flags, unsigned Isa,
unsigned Discriminator,
StringRef FileName) override;
void EmitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel,
const MCSymbol *Label,
unsigned PointerSize);
void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
void emitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel,
const MCSymbol *Label, unsigned PointerSize);
void emitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
const MCSymbol *Label);
void EmitCVLocDirective(unsigned FunctionId, unsigned FileNo, unsigned Line,
unsigned Column, bool PrologueEnd, bool IsStmt,

View File

@ -670,17 +670,17 @@ public:
EmitIntValue(Value, Size);
}
virtual void EmitULEB128Value(const MCExpr *Value);
virtual void emitULEB128Value(const MCExpr *Value);
virtual void EmitSLEB128Value(const MCExpr *Value);
virtual void emitSLEB128Value(const MCExpr *Value);
/// Special case of EmitULEB128Value that avoids the client having to
/// pass in a MCExpr for constant integers.
void EmitULEB128IntValue(uint64_t Value, unsigned PadTo = 0);
void emitULEB128IntValue(uint64_t Value, unsigned PadTo = 0);
/// Special case of EmitSLEB128Value that avoids the client having to
/// pass in a MCExpr for constant integers.
void EmitSLEB128IntValue(int64_t Value);
void emitSLEB128IntValue(int64_t Value);
/// Special case of EmitValue that avoids the client having to pass in
/// a MCExpr for MCSymbols.
@ -821,7 +821,7 @@ public:
/// Associate a filename with a specified logical file number. This
/// implements the DWARF2 '.file 4 "foo.c"' assembler directive.
unsigned EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
unsigned emitDwarfFileDirective(unsigned FileNo, StringRef Directory,
StringRef Filename,
Optional<MD5::MD5Result> Checksum = None,
Optional<StringRef> Source = None,
@ -851,7 +851,7 @@ public:
/// This implements the DWARF2 '.loc fileno lineno ...' assembler
/// directive.
virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
virtual void emitDwarfLocDirective(unsigned FileNo, unsigned Line,
unsigned Column, unsigned Flags,
unsigned Isa, unsigned Discriminator,
StringRef FileName);

View File

@ -271,7 +271,7 @@ void AccelTableWriter::emitOffsets(const MCSymbol *Base) const {
continue;
PrevHash = HashValue;
Asm->OutStreamer->AddComment("Offset in Bucket " + Twine(i));
Asm->EmitLabelDifference(Hash->Sym, Base, sizeof(uint32_t));
Asm->emitLabelDifference(Hash->Sym, Base, sizeof(uint32_t));
}
}
}
@ -368,7 +368,7 @@ void Dwarf5AccelTableWriter<DataT>::Header::emit(
AsmPrinter *Asm = Ctx.Asm;
Asm->OutStreamer->AddComment("Header: unit length");
Asm->EmitLabelDifference(Ctx.ContributionEnd, Ctx.ContributionStart,
Asm->emitLabelDifference(Ctx.ContributionEnd, Ctx.ContributionStart,
sizeof(uint32_t));
Asm->OutStreamer->EmitLabel(Ctx.ContributionStart);
Asm->OutStreamer->AddComment("Header: version");
@ -386,7 +386,7 @@ void Dwarf5AccelTableWriter<DataT>::Header::emit(
Asm->OutStreamer->AddComment("Header: name count");
Asm->emitInt32(NameCount);
Asm->OutStreamer->AddComment("Header: abbreviation table size");
Asm->EmitLabelDifference(Ctx.AbbrevEnd, Ctx.AbbrevStart, sizeof(uint32_t));
Asm->emitLabelDifference(Ctx.AbbrevEnd, Ctx.AbbrevStart, sizeof(uint32_t));
Asm->OutStreamer->AddComment("Header: augmentation string size");
assert(AugmentationStringSize % 4 == 0);
Asm->emitInt32(AugmentationStringSize);
@ -457,18 +457,18 @@ void Dwarf5AccelTableWriter<DataT>::emitAbbrevs() const {
for (const auto &Abbrev : Abbreviations) {
Asm->OutStreamer->AddComment("Abbrev code");
assert(Abbrev.first != 0);
Asm->EmitULEB128(Abbrev.first);
Asm->emitULEB128(Abbrev.first);
Asm->OutStreamer->AddComment(dwarf::TagString(Abbrev.first));
Asm->EmitULEB128(Abbrev.first);
Asm->emitULEB128(Abbrev.first);
for (const auto &AttrEnc : Abbrev.second) {
Asm->EmitULEB128(AttrEnc.Index, dwarf::IndexString(AttrEnc.Index).data());
Asm->EmitULEB128(AttrEnc.Form,
Asm->emitULEB128(AttrEnc.Index, dwarf::IndexString(AttrEnc.Index).data());
Asm->emitULEB128(AttrEnc.Form,
dwarf::FormEncodingString(AttrEnc.Form).data());
}
Asm->EmitULEB128(0, "End of abbrev");
Asm->EmitULEB128(0, "End of abbrev");
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);
}
@ -478,7 +478,7 @@ void Dwarf5AccelTableWriter<DataT>::emitEntry(const DataT &Entry) const {
assert(AbbrevIt != Abbreviations.end() &&
"Why wasn't this abbrev generated?");
Asm->EmitULEB128(AbbrevIt->first, "Abbreviation code");
Asm->emitULEB128(AbbrevIt->first, "Abbreviation code");
for (const auto &AttrEnc : AbbrevIt->second) {
Asm->OutStreamer->AddComment(dwarf::IndexString(AttrEnc.Index));
switch (AttrEnc.Index) {

View File

@ -30,7 +30,7 @@ MCSymbol *AddressPool::emitHeader(AsmPrinter &Asm, MCSection *Section) {
MCSymbol *EndLabel = Asm.createTempSymbol(Prefix + "end");
Asm.OutStreamer->AddComment("Length of contribution");
Asm.EmitLabelDifference(EndLabel, BeginLabel,
Asm.emitLabelDifference(EndLabel, BeginLabel,
4); // TODO: Support DWARF64 format.
Asm.OutStreamer->EmitLabel(BeginLabel);
Asm.OutStreamer->AddComment("DWARF version number");

View File

@ -397,7 +397,7 @@ static bool canBeHidden(const GlobalValue *GV, const MCAsmInfo &MAI) {
return GV->canBeOmittedFromSymbolTable();
}
void AsmPrinter::EmitLinkage(const GlobalValue *GV, MCSymbol *GVSym) const {
void AsmPrinter::emitLinkage(const GlobalValue *GV, MCSymbol *GVSym) const {
GlobalValue::LinkageTypes Linkage = GV->getLinkage();
switch (Linkage) {
case GlobalValue::CommonLinkage:
@ -501,7 +501,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
// getOrCreateEmuTLSControlSym only creates the symbol with name and default
// attributes.
// GV's or GVSym's attributes will be used for the EmittedSym.
EmitVisibility(EmittedSym, GV->getVisibility(), !GV->isDeclaration());
emitVisibility(EmittedSym, GV->getVisibility(), !GV->isDeclaration());
if (!GV->hasInitializer()) // External globals require no extra code.
return;
@ -551,7 +551,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
TheSection->isVirtualSection()) {
if (Size == 0)
Size = 1; // zerofill of 0 bytes is undefined.
EmitLinkage(GV, GVSym);
emitLinkage(GV, GVSym);
// .zerofill __DATA, __bss, _foo, 400, 5
OutStreamer->EmitZerofill(TheSection, GVSym, Size, Alignment.value());
return;
@ -621,7 +621,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
OutStreamer->SwitchSection(TLVSect);
// Emit the linkage here.
EmitLinkage(GV, GVSym);
emitLinkage(GV, GVSym);
OutStreamer->EmitLabel(GVSym);
// Three pointers in size:
@ -642,7 +642,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
OutStreamer->SwitchSection(TheSection);
EmitLinkage(GV, EmittedInitSym);
emitLinkage(GV, EmittedInitSym);
EmitAlignment(Alignment, GV);
OutStreamer->EmitLabel(EmittedInitSym);
@ -664,7 +664,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
///
/// \p Value - The value to emit.
/// \p Size - The size of the integer (in bytes) to emit.
void AsmPrinter::EmitDebugValue(const MCExpr *Value, unsigned Size) const {
void AsmPrinter::emitDebugValue(const MCExpr *Value, unsigned Size) const {
OutStreamer->EmitValue(Value, Size);
}
@ -683,13 +683,13 @@ void AsmPrinter::emitFunctionHeader() {
// Print the 'header' of function.
OutStreamer->SwitchSection(getObjFileLowering().SectionForGlobal(&F, TM));
EmitVisibility(CurrentFnSym, F.getVisibility());
emitVisibility(CurrentFnSym, F.getVisibility());
if (MAI->needsFunctionDescriptors() &&
F.getLinkage() != GlobalValue::InternalLinkage)
EmitLinkage(&F, CurrentFnDescSym);
emitLinkage(&F, CurrentFnDescSym);
EmitLinkage(&F, CurrentFnSym);
emitLinkage(&F, CurrentFnSym);
if (MAI->hasFunctionAlignment())
EmitAlignment(MF->getAlignment(), &F);
@ -1046,7 +1046,7 @@ void AsmPrinter::emitStackSizeSection(const MachineFunction &MF) {
const MCSymbol *FunctionSymbol = getFunctionBegin();
uint64_t StackSize = FrameInfo.getStackSize();
OutStreamer->EmitSymbolValue(FunctionSymbol, TM.getProgramPointerSize());
OutStreamer->EmitULEB128IntValue(StackSize);
OutStreamer->emitULEB128IntValue(StackSize);
OutStreamer->PopSection();
}
@ -1374,7 +1374,7 @@ void AsmPrinter::emitGlobalIndirectSymbol(Module &M,
? MCSA_ELF_TypeIndFunction
: MCSA_ELF_TypeFunction);
EmitVisibility(Name, GIS.getVisibility());
emitVisibility(Name, GIS.getVisibility());
const MCExpr *Expr = lowerConstant(GIS.getIndirectSymbol());
@ -1459,7 +1459,7 @@ bool AsmPrinter::doFinalization(Module &M) {
continue;
MCSymbol *Name = getSymbol(&F);
EmitVisibility(Name, V, false);
emitVisibility(Name, V, false);
}
// Emit the remarks section contents.
@ -2182,7 +2182,7 @@ void AsmPrinter::emitInt64(uint64_t Value) const {
/// Emit something like ".long Hi-Lo" where the size in bytes of the directive
/// is specified by Size and Hi/Lo specify the labels. This implicitly uses
/// .set if it avoids relocations.
void AsmPrinter::EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo,
void AsmPrinter::emitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo,
unsigned Size) const {
OutStreamer->emitAbsoluteSymbolDiff(Hi, Lo, Size);
}
@ -2190,7 +2190,7 @@ void AsmPrinter::EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo,
/// EmitLabelPlusOffset - Emit something like ".long Label+Offset"
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label. This implicitly uses .set if it is available.
void AsmPrinter::EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
void AsmPrinter::emitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
unsigned Size,
bool IsSectionRelative) const {
if (MAI->needsDwarfSectionOffsetDirective() && IsSectionRelative) {
@ -3043,7 +3043,7 @@ void AsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {
void AsmPrinter::emitBasicBlockEnd(const MachineBasicBlock &MBB) {}
void AsmPrinter::EmitVisibility(MCSymbol *Sym, unsigned Visibility,
void AsmPrinter::emitVisibility(MCSymbol *Sym, unsigned Visibility,
bool IsDefinition) const {
MCSymbolAttr Attr = MCSA_Invalid;

View File

@ -36,22 +36,23 @@ using namespace llvm;
//===----------------------------------------------------------------------===//
/// EmitSLEB128 - emit the specified signed leb128 value.
void AsmPrinter::EmitSLEB128(int64_t Value, const char *Desc) const {
void AsmPrinter::emitSLEB128(int64_t Value, const char *Desc) const {
if (isVerbose() && Desc)
OutStreamer->AddComment(Desc);
OutStreamer->EmitSLEB128IntValue(Value);
OutStreamer->emitSLEB128IntValue(Value);
}
void AsmPrinter::EmitULEB128(uint64_t Value, const char *Desc, unsigned PadTo) const {
void AsmPrinter::emitULEB128(uint64_t Value, const char *Desc,
unsigned PadTo) const {
if (isVerbose() && Desc)
OutStreamer->AddComment(Desc);
OutStreamer->EmitULEB128IntValue(Value, PadTo);
OutStreamer->emitULEB128IntValue(Value, PadTo);
}
/// Emit something like ".uleb128 Hi-Lo".
void AsmPrinter::EmitLabelDifferenceAsULEB128(const MCSymbol *Hi,
void AsmPrinter::emitLabelDifferenceAsULEB128(const MCSymbol *Hi,
const MCSymbol *Lo) const {
OutStreamer->emitAbsoluteSymbolDiffAsULEB128(Hi, Lo);
}
@ -165,7 +166,7 @@ void AsmPrinter::emitDwarfSymbolReference(const MCSymbol *Label,
}
// Otherwise, emit it as a label difference from the start of the section.
EmitLabelDifference(Label, Label->getSection().getBeginSymbol(), 4);
emitLabelDifference(Label, Label->getSection().getBeginSymbol(), 4);
}
void AsmPrinter::emitDwarfStringOffset(DwarfStringPoolEntry S) const {
@ -179,25 +180,23 @@ void AsmPrinter::emitDwarfStringOffset(DwarfStringPoolEntry S) const {
emitInt32(S.Offset);
}
void AsmPrinter::EmitDwarfOffset(const MCSymbol *Label, uint64_t Offset) const {
EmitLabelPlusOffset(Label, Offset, MAI->getCodePointerSize());
void AsmPrinter::emitDwarfOffset(const MCSymbol *Label, uint64_t Offset) const {
emitLabelPlusOffset(Label, Offset, MAI->getCodePointerSize());
}
void AsmPrinter::EmitCallSiteOffset(const MCSymbol *Hi,
const MCSymbol *Lo,
void AsmPrinter::emitCallSiteOffset(const MCSymbol *Hi, const MCSymbol *Lo,
unsigned Encoding) const {
// The least significant 3 bits specify the width of the encoding
if ((Encoding & 0x7) == dwarf::DW_EH_PE_uleb128)
EmitLabelDifferenceAsULEB128(Hi, Lo);
emitLabelDifferenceAsULEB128(Hi, Lo);
else
EmitLabelDifference(Hi, Lo, GetSizeOfEncodedValue(Encoding));
emitLabelDifference(Hi, Lo, GetSizeOfEncodedValue(Encoding));
}
void AsmPrinter::EmitCallSiteValue(uint64_t Value,
unsigned Encoding) const {
void AsmPrinter::emitCallSiteValue(uint64_t Value, unsigned Encoding) const {
// The least significant 3 bits specify the width of the encoding
if ((Encoding & 0x7) == dwarf::DW_EH_PE_uleb128)
EmitULEB128(Value);
emitULEB128(Value);
else
OutStreamer->EmitIntValue(Value, GetSizeOfEncodedValue(Encoding));
}
@ -256,7 +255,7 @@ void AsmPrinter::emitDwarfDIE(const DIE &Die) const {
Twine::utohexstr(Die.getOffset()) + ":0x" +
Twine::utohexstr(Die.getSize()) + " " +
dwarf::TagString(Die.getTag()));
EmitULEB128(Die.getAbbrevNumber());
emitULEB128(Die.getAbbrevNumber());
// Emit the DIE attribute values.
for (const auto &V : Die.values()) {
@ -286,7 +285,7 @@ void AsmPrinter::emitDwarfDIE(const DIE &Die) const {
void AsmPrinter::emitDwarfAbbrev(const DIEAbbrev &Abbrev) const {
// Emit the abbreviations code (base 1 index.)
EmitULEB128(Abbrev.getNumber(), "Abbreviation Code");
emitULEB128(Abbrev.getNumber(), "Abbreviation Code");
// Emit the abbreviations data.
Abbrev.Emit(this);

View File

@ -30,8 +30,9 @@ class ByteStreamer {
public:
// For now we're just handling the calls we need for dwarf emission/hashing.
virtual void EmitInt8(uint8_t Byte, const Twine &Comment = "") = 0;
virtual void EmitSLEB128(uint64_t DWord, const Twine &Comment = "") = 0;
virtual void EmitULEB128(uint64_t DWord, const Twine &Comment = "", unsigned PadTo = 0) = 0;
virtual void emitSLEB128(uint64_t DWord, const Twine &Comment = "") = 0;
virtual void emitULEB128(uint64_t DWord, const Twine &Comment = "",
unsigned PadTo = 0) = 0;
};
class APByteStreamer final : public ByteStreamer {
@ -44,13 +45,14 @@ public:
AP.OutStreamer->AddComment(Comment);
AP.emitInt8(Byte);
}
void EmitSLEB128(uint64_t DWord, const Twine &Comment) override {
void emitSLEB128(uint64_t DWord, const Twine &Comment) override {
AP.OutStreamer->AddComment(Comment);
AP.EmitSLEB128(DWord);
AP.emitSLEB128(DWord);
}
void EmitULEB128(uint64_t DWord, const Twine &Comment, unsigned PadTo) override {
void emitULEB128(uint64_t DWord, const Twine &Comment,
unsigned PadTo) override {
AP.OutStreamer->AddComment(Comment);
AP.EmitULEB128(DWord, nullptr, PadTo);
AP.emitULEB128(DWord, nullptr, PadTo);
}
};
@ -62,10 +64,11 @@ class HashingByteStreamer final : public ByteStreamer {
void EmitInt8(uint8_t Byte, const Twine &Comment) override {
Hash.update(Byte);
}
void EmitSLEB128(uint64_t DWord, const Twine &Comment) override {
void emitSLEB128(uint64_t DWord, const Twine &Comment) override {
Hash.addSLEB128(DWord);
}
void EmitULEB128(uint64_t DWord, const Twine &Comment, unsigned PadTo) override {
void emitULEB128(uint64_t DWord, const Twine &Comment,
unsigned PadTo) override {
Hash.addULEB128(DWord);
}
};
@ -90,7 +93,7 @@ public:
if (GenerateComments)
Comments.push_back(Comment.str());
}
void EmitSLEB128(uint64_t DWord, const Twine &Comment) override {
void emitSLEB128(uint64_t DWord, const Twine &Comment) override {
raw_svector_ostream OSE(Buffer);
unsigned Length = encodeSLEB128(DWord, OSE);
if (GenerateComments) {
@ -102,7 +105,8 @@ public:
}
}
void EmitULEB128(uint64_t DWord, const Twine &Comment, unsigned PadTo) override {
void emitULEB128(uint64_t DWord, const Twine &Comment,
unsigned PadTo) override {
raw_svector_ostream OSE(Buffer);
unsigned Length = encodeULEB128(DWord, OSE, PadTo);
if (GenerateComments) {

View File

@ -67,17 +67,17 @@ void DIEAbbrev::Profile(FoldingSetNodeID &ID) const {
///
void DIEAbbrev::Emit(const AsmPrinter *AP) const {
// Emit its Dwarf tag type.
AP->EmitULEB128(Tag, dwarf::TagString(Tag).data());
AP->emitULEB128(Tag, dwarf::TagString(Tag).data());
// Emit whether it has children DIEs.
AP->EmitULEB128((unsigned)Children, dwarf::ChildrenString(Children).data());
AP->emitULEB128((unsigned)Children, dwarf::ChildrenString(Children).data());
// For each attribute description.
for (unsigned i = 0, N = Data.size(); i < N; ++i) {
const DIEAbbrevData &AttrData = Data[i];
// Emit attribute type.
AP->EmitULEB128(AttrData.getAttribute(),
AP->emitULEB128(AttrData.getAttribute(),
dwarf::AttributeString(AttrData.getAttribute()).data());
// Emit form type.
@ -92,17 +92,17 @@ void DIEAbbrev::Emit(const AsmPrinter *AP) const {
llvm_unreachable("Invalid form for specified DWARF version");
}
#endif
AP->EmitULEB128(AttrData.getForm(),
AP->emitULEB128(AttrData.getForm(),
dwarf::FormEncodingString(AttrData.getForm()).data());
// Emit value for DW_FORM_implicit_const.
if (AttrData.getForm() == dwarf::DW_FORM_implicit_const)
AP->EmitSLEB128(AttrData.getValue());
AP->emitSLEB128(AttrData.getValue());
}
// Mark end of abbreviation.
AP->EmitULEB128(0, "EOM(1)");
AP->EmitULEB128(0, "EOM(2)");
AP->emitULEB128(0, "EOM(1)");
AP->emitULEB128(0, "EOM(2)");
}
LLVM_DUMP_METHOD
@ -418,10 +418,10 @@ void DIEInteger::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const {
case dwarf::DW_FORM_addrx:
case dwarf::DW_FORM_rnglistx:
case dwarf::DW_FORM_udata:
Asm->EmitULEB128(Integer);
Asm->emitULEB128(Integer);
return;
case dwarf::DW_FORM_sdata:
Asm->EmitSLEB128(Integer);
Asm->emitSLEB128(Integer);
return;
default: llvm_unreachable("DIE Value form not supported yet");
}
@ -466,7 +466,7 @@ void DIEInteger::print(raw_ostream &O) const {
/// EmitValue - Emit expression value.
///
void DIEExpr::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
AP->EmitDebugValue(Expr, SizeOf(AP, Form));
AP->emitDebugValue(Expr, SizeOf(AP, Form));
}
/// SizeOf - Determine size of expression value in bytes.
@ -488,11 +488,10 @@ void DIEExpr::print(raw_ostream &O) const { O << "Expr: " << *Expr; }
/// EmitValue - Emit label value.
///
void DIELabel::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
AP->EmitLabelReference(Label, SizeOf(AP, Form),
Form == dwarf::DW_FORM_strp ||
Form == dwarf::DW_FORM_sec_offset ||
Form == dwarf::DW_FORM_ref_addr ||
Form == dwarf::DW_FORM_data4);
AP->emitLabelReference(
Label, SizeOf(AP, Form),
Form == dwarf::DW_FORM_strp || Form == dwarf::DW_FORM_sec_offset ||
Form == dwarf::DW_FORM_ref_addr || Form == dwarf::DW_FORM_data4);
}
/// SizeOf - Determine size of label value in bytes.
@ -514,7 +513,7 @@ void DIELabel::print(raw_ostream &O) const { O << "Lbl: " << Label->getName(); }
void DIEBaseTypeRef::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
uint64_t Offset = CU->ExprRefedBaseTypes[Index].Die->getOffset();
assert(Offset < (1ULL << (ULEB128PadSize * 7)) && "Offset wont fit");
AP->EmitULEB128(Offset, nullptr, ULEB128PadSize);
AP->emitULEB128(Offset, nullptr, ULEB128PadSize);
}
unsigned DIEBaseTypeRef::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
@ -531,7 +530,7 @@ void DIEBaseTypeRef::print(raw_ostream &O) const { O << "BaseTypeRef: " << Index
/// EmitValue - Emit delta value.
///
void DIEDelta::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
AP->EmitLabelDifference(LabelHi, LabelLo, SizeOf(AP, Form));
AP->emitLabelDifference(LabelHi, LabelLo, SizeOf(AP, Form));
}
/// SizeOf - Determine size of delta value in bytes.
@ -641,7 +640,7 @@ void DIEEntry::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
return;
case dwarf::DW_FORM_ref_udata:
AP->EmitULEB128(Entry->getOffset());
AP->emitULEB128(Entry->getOffset());
return;
case dwarf::DW_FORM_ref_addr: {
@ -649,7 +648,7 @@ void DIEEntry::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
unsigned Addr = Entry->getDebugSectionOffset();
if (const MCSymbol *SectionSym =
Entry->getUnit()->getCrossSectionRelativeBaseAddress()) {
AP->EmitLabelPlusOffset(SectionSym, Addr, SizeOf(AP, Form), true);
AP->emitLabelPlusOffset(SectionSym, Addr, SizeOf(AP, Form), true);
return;
}
@ -719,7 +718,8 @@ void DIELoc::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const {
case dwarf::DW_FORM_block4: Asm->emitInt32(Size); break;
case dwarf::DW_FORM_block:
case dwarf::DW_FORM_exprloc:
Asm->EmitULEB128(Size); break;
Asm->emitULEB128(Size);
break;
}
for (const auto &V : values())
@ -768,7 +768,9 @@ void DIEBlock::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const {
case dwarf::DW_FORM_block1: Asm->emitInt8(Size); break;
case dwarf::DW_FORM_block2: Asm->emitInt16(Size); break;
case dwarf::DW_FORM_block4: Asm->emitInt32(Size); break;
case dwarf::DW_FORM_block: Asm->EmitULEB128(Size); break;
case dwarf::DW_FORM_block:
Asm->emitULEB128(Size);
break;
case dwarf::DW_FORM_string: break;
case dwarf::DW_FORM_data16: break;
}
@ -813,7 +815,7 @@ unsigned DIELocList::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
///
void DIELocList::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
if (Form == dwarf::DW_FORM_loclistx) {
AP->EmitULEB128(Index);
AP->emitULEB128(Index);
return;
}
DwarfDebug *DD = AP->getDwarfDebug();

View File

@ -113,8 +113,9 @@ unsigned DwarfCompileUnit::getOrCreateSourceID(const DIFile *File) {
// extend .file to support this.
unsigned CUID = Asm->OutStreamer->hasRawTextSupport() ? 0 : getUniqueID();
if (!File)
return Asm->OutStreamer->EmitDwarfFileDirective(0, "", "", None, None, CUID);
return Asm->OutStreamer->EmitDwarfFileDirective(
return Asm->OutStreamer->emitDwarfFileDirective(0, "", "", None, None,
CUID);
return Asm->OutStreamer->emitDwarfFileDirective(
0, File->getDirectory(), File->getFilename(), getMD5AsBytes(File),
File->getSource(), CUID);
}

View File

@ -176,11 +176,11 @@ void DebugLocDwarfExpression::emitOp(uint8_t Op, const char *Comment) {
}
void DebugLocDwarfExpression::emitSigned(int64_t Value) {
getActiveStreamer().EmitSLEB128(Value, Twine(Value));
getActiveStreamer().emitSLEB128(Value, Twine(Value));
}
void DebugLocDwarfExpression::emitUnsigned(uint64_t Value) {
getActiveStreamer().EmitULEB128(Value, Twine(Value));
getActiveStreamer().emitULEB128(Value, Twine(Value));
}
void DebugLocDwarfExpression::emitData1(uint8_t Value) {
@ -189,7 +189,7 @@ void DebugLocDwarfExpression::emitData1(uint8_t Value) {
void DebugLocDwarfExpression::emitBaseTypeRef(uint64_t Idx) {
assert(Idx < (1ULL << (ULEB128PadSize * 7)) && "Idx wont fit");
getActiveStreamer().EmitULEB128(Idx, Twine(Idx), ULEB128PadSize);
getActiveStreamer().emitULEB128(Idx, Twine(Idx), ULEB128PadSize);
}
bool DebugLocDwarfExpression::isFrameRegister(const TargetRegisterInfo &TRI,
@ -1840,7 +1840,7 @@ static void recordSourceLine(AsmPrinter &Asm, unsigned Line, unsigned Col,
FileNo = static_cast<DwarfCompileUnit &>(*DCUs[CUID])
.getOrCreateSourceID(Scope->getFile());
}
Asm.OutStreamer->EmitDwarfLocDirective(FileNo, Line, Col, Flags, 0,
Asm.OutStreamer->emitDwarfLocDirective(FileNo, Line, Col, Flags, 0,
Discriminator, Fn);
}
@ -2148,7 +2148,7 @@ void DwarfDebug::emitDebugPubSections() {
void DwarfDebug::emitSectionReference(const DwarfCompileUnit &CU) {
if (useSectionsAsReferences())
Asm->EmitDwarfOffset(CU.getSection()->getBeginSymbol(),
Asm->emitDwarfOffset(CU.getSection()->getBeginSymbol(),
CU.getDebugSectionOffset());
else
Asm->emitDwarfSymbolReference(CU.getLabelBegin());
@ -2164,7 +2164,7 @@ void DwarfDebug::emitDebugPubSection(bool GnuStyle, StringRef Name,
Asm->OutStreamer->AddComment("Length of Public " + Name + " Info");
MCSymbol *BeginLabel = Asm->createTempSymbol("pub" + Name + "_begin");
MCSymbol *EndLabel = Asm->createTempSymbol("pub" + Name + "_end");
Asm->EmitLabelDifference(EndLabel, BeginLabel, 4);
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
Asm->OutStreamer->EmitLabel(BeginLabel);
@ -2246,7 +2246,7 @@ void DwarfDebug::emitDebugLocEntry(ByteStreamer &Streamer,
uint64_t Offset =
CU->ExprRefedBaseTypes[Op.getRawOperand(I)].Die->getOffset();
assert(Offset < (1ULL << (ULEB128PadSize * 7)) && "Offset wont fit");
Streamer.EmitULEB128(Offset, "", ULEB128PadSize);
Streamer.emitULEB128(Offset, "", ULEB128PadSize);
// Make sure comments stay aligned.
for (unsigned J = 0; J < ULEB128PadSize; ++J)
if (Comment != End)
@ -2337,7 +2337,7 @@ void DwarfDebug::emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry,
// Emit the size.
Asm->OutStreamer->AddComment("Loc expr size");
if (getDwarfVersion() >= 5)
Asm->EmitULEB128(DebugLocs.getBytes(Entry).size());
Asm->emitULEB128(DebugLocs.getBytes(Entry).size());
else if (DebugLocs.getBytes(Entry).size() <= std::numeric_limits<uint16_t>::max())
Asm->emitInt16(DebugLocs.getBytes(Entry).size());
else {
@ -2357,7 +2357,7 @@ static void emitListsTableHeaderStart(AsmPrinter *Asm,
MCSymbol *TableEnd) {
// Build the table header, which starts with the length field.
Asm->OutStreamer->AddComment("Length");
Asm->EmitLabelDifference(TableEnd, TableStart, 4);
Asm->emitLabelDifference(TableEnd, TableStart, 4);
Asm->OutStreamer->EmitLabel(TableStart);
// Version number (DWARF v5 and later).
Asm->OutStreamer->AddComment("Version");
@ -2384,8 +2384,7 @@ static MCSymbol *emitRnglistsTableHeader(AsmPrinter *Asm,
Asm->OutStreamer->EmitLabel(Holder.getRnglistsTableBaseSym());
for (const RangeSpanList &List : Holder.getRangeLists())
Asm->EmitLabelDifference(List.Label, Holder.getRnglistsTableBaseSym(),
4);
Asm->emitLabelDifference(List.Label, Holder.getRnglistsTableBaseSym(), 4);
return TableEnd;
}
@ -2406,7 +2405,7 @@ static MCSymbol *emitLoclistsTableHeader(AsmPrinter *Asm,
Asm->OutStreamer->EmitLabel(DebugLocs.getSym());
for (const auto &List : DebugLocs.getLists())
Asm->EmitLabelDifference(List.Label, DebugLocs.getSym(), 4);
Asm->emitLabelDifference(List.Label, DebugLocs.getSym(), 4);
return TableEnd;
}
@ -2455,7 +2454,7 @@ static void emitRangeList(
Asm->OutStreamer->AddComment(StringifyEnum(BaseAddressx));
Asm->emitInt8(BaseAddressx);
Asm->OutStreamer->AddComment(" base address index");
Asm->EmitULEB128(DD.getAddressPool().getIndex(Base));
Asm->emitULEB128(DD.getAddressPool().getIndex(Base));
}
} else if (BaseIsSet && !UseDwarf5) {
BaseIsSet = false;
@ -2475,20 +2474,20 @@ static void emitRangeList(
Asm->OutStreamer->AddComment(StringifyEnum(OffsetPair));
Asm->emitInt8(OffsetPair);
Asm->OutStreamer->AddComment(" starting offset");
Asm->EmitLabelDifferenceAsULEB128(Begin, Base);
Asm->emitLabelDifferenceAsULEB128(Begin, Base);
Asm->OutStreamer->AddComment(" ending offset");
Asm->EmitLabelDifferenceAsULEB128(End, Base);
Asm->emitLabelDifferenceAsULEB128(End, Base);
} else {
Asm->EmitLabelDifference(Begin, Base, Size);
Asm->EmitLabelDifference(End, Base, Size);
Asm->emitLabelDifference(Begin, Base, Size);
Asm->emitLabelDifference(End, Base, Size);
}
} else if (UseDwarf5) {
Asm->OutStreamer->AddComment(StringifyEnum(StartxLength));
Asm->emitInt8(StartxLength);
Asm->OutStreamer->AddComment(" start index");
Asm->EmitULEB128(DD.getAddressPool().getIndex(Begin));
Asm->emitULEB128(DD.getAddressPool().getIndex(Begin));
Asm->OutStreamer->AddComment(" length");
Asm->EmitLabelDifferenceAsULEB128(End, Begin);
Asm->emitLabelDifferenceAsULEB128(End, Begin);
} else {
Asm->OutStreamer->EmitSymbolValue(Begin, Size);
Asm->OutStreamer->EmitSymbolValue(End, Size);
@ -2569,10 +2568,10 @@ void DwarfDebug::emitDebugLocDWO() {
// addresses in the address pool to minimize object size/relocations.
Asm->emitInt8(dwarf::DW_LLE_startx_length);
unsigned idx = AddrPool.getIndex(Entry.Begin);
Asm->EmitULEB128(idx);
Asm->emitULEB128(idx);
// Also the pre-standard encoding is slightly different, emitting this as
// an address-length entry here, but its a ULEB128 in DWARFv5 loclists.
Asm->EmitLabelDifference(Entry.End, Entry.Begin, 4);
Asm->emitLabelDifference(Entry.End, Entry.Begin, 4);
emitDebugLocEntryLocation(Entry, List.CU);
}
Asm->emitInt8(dwarf::DW_LLE_end_of_list);
@ -2717,11 +2716,11 @@ void DwarfDebug::emitDebugARanges() {
Asm->OutStreamer->emitFill(Padding, 0xff);
for (const ArangeSpan &Span : List) {
Asm->EmitLabelReference(Span.Start, PtrSize);
Asm->emitLabelReference(Span.Start, PtrSize);
// Calculate the size as being from the span start to it's end.
if (Span.End) {
Asm->EmitLabelDifference(Span.End, Span.Start, PtrSize);
Asm->emitLabelDifference(Span.End, Span.Start, PtrSize);
} else {
// For symbols without an end marker (e.g. common), we
// write a single arange entry containing just that one symbol.
@ -2802,8 +2801,8 @@ void DwarfDebug::handleMacroNodes(DIMacroNodeArray Nodes, DwarfCompileUnit &U) {
}
void DwarfDebug::emitMacro(DIMacro &M) {
Asm->EmitULEB128(M.getMacinfoType());
Asm->EmitULEB128(M.getLine());
Asm->emitULEB128(M.getMacinfoType());
Asm->emitULEB128(M.getLine());
StringRef Name = M.getName();
StringRef Value = M.getValue();
Asm->OutStreamer->EmitBytes(Name);
@ -2817,11 +2816,11 @@ void DwarfDebug::emitMacro(DIMacro &M) {
void DwarfDebug::emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U) {
assert(F.getMacinfoType() == dwarf::DW_MACINFO_start_file);
Asm->EmitULEB128(dwarf::DW_MACINFO_start_file);
Asm->EmitULEB128(F.getLine());
Asm->EmitULEB128(U.getOrCreateSourceID(F.getFile()));
Asm->emitULEB128(dwarf::DW_MACINFO_start_file);
Asm->emitULEB128(F.getLine());
Asm->emitULEB128(U.getOrCreateSourceID(F.getFile()));
handleMacroNodes(F.getElements(), U);
Asm->EmitULEB128(dwarf::DW_MACINFO_end_file);
Asm->emitULEB128(dwarf::DW_MACINFO_end_file);
}
void DwarfDebug::emitDebugMacinfoImpl(MCSection *Section) {

View File

@ -1628,7 +1628,7 @@ void DwarfUnit::emitCommonHeader(bool UseOffsets, dwarf::UnitType UT) {
StringRef Prefix = isDwoUnit() ? "debug_info_dwo_" : "debug_info_";
MCSymbol *BeginLabel = Asm->createTempSymbol(Prefix + "start");
EndLabel = Asm->createTempSymbol(Prefix + "end");
Asm->EmitLabelDifference(EndLabel, BeginLabel, 4);
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
Asm->OutStreamer->EmitLabel(BeginLabel);
} else
Asm->emitInt32(getHeaderSize() + getUnitDie().getSize());

View File

@ -447,7 +447,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
// the type table. See PR35809 or GNU as bug 4029.
MCSymbol *TTBaseRefLabel = Asm->createTempSymbol("ttbaseref");
TTBaseLabel = Asm->createTempSymbol("ttbase");
Asm->EmitLabelDifferenceAsULEB128(TTBaseLabel, TTBaseRefLabel);
Asm->emitLabelDifferenceAsULEB128(TTBaseLabel, TTBaseRefLabel);
Asm->OutStreamer->EmitLabel(TTBaseRefLabel);
}
@ -457,7 +457,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
MCSymbol *CstBeginLabel = Asm->createTempSymbol("cst_begin");
MCSymbol *CstEndLabel = Asm->createTempSymbol("cst_end");
Asm->EmitEncodingByte(CallSiteEncoding, "Call site");
Asm->EmitLabelDifferenceAsULEB128(CstEndLabel, CstBeginLabel);
Asm->emitLabelDifferenceAsULEB128(CstEndLabel, CstBeginLabel);
Asm->OutStreamer->EmitLabel(CstBeginLabel);
// SjLj / Wasm Exception handling
@ -472,7 +472,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
Asm->OutStreamer->AddComment(">> Call Site " + Twine(idx) + " <<");
Asm->OutStreamer->AddComment(" On exception at call site "+Twine(idx));
}
Asm->EmitULEB128(idx);
Asm->emitULEB128(idx);
// Offset of the first associated action record, relative to the start of
// the action table. This value is biased by 1 (1 indicates the start of
@ -484,7 +484,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
Asm->OutStreamer->AddComment(" Action: " +
Twine((S.Action - 1) / 2 + 1));
}
Asm->EmitULEB128(S.Action);
Asm->emitULEB128(S.Action);
}
} else {
// Itanium LSDA exception handling
@ -524,23 +524,23 @@ MCSymbol *EHStreamer::emitExceptionTable() {
// Offset of the call site relative to the start of the procedure.
if (VerboseAsm)
Asm->OutStreamer->AddComment(">> Call Site " + Twine(++Entry) + " <<");
Asm->EmitCallSiteOffset(BeginLabel, EHFuncBeginSym, CallSiteEncoding);
Asm->emitCallSiteOffset(BeginLabel, EHFuncBeginSym, CallSiteEncoding);
if (VerboseAsm)
Asm->OutStreamer->AddComment(Twine(" Call between ") +
BeginLabel->getName() + " and " +
EndLabel->getName());
Asm->EmitCallSiteOffset(EndLabel, BeginLabel, CallSiteEncoding);
Asm->emitCallSiteOffset(EndLabel, BeginLabel, CallSiteEncoding);
// Offset of the landing pad relative to the start of the procedure.
if (!S.LPad) {
if (VerboseAsm)
Asm->OutStreamer->AddComment(" has no landing pad");
Asm->EmitCallSiteValue(0, CallSiteEncoding);
Asm->emitCallSiteValue(0, CallSiteEncoding);
} else {
if (VerboseAsm)
Asm->OutStreamer->AddComment(Twine(" jumps to ") +
S.LPad->LandingPadLabel->getName());
Asm->EmitCallSiteOffset(S.LPad->LandingPadLabel, EHFuncBeginSym,
Asm->emitCallSiteOffset(S.LPad->LandingPadLabel, EHFuncBeginSym,
CallSiteEncoding);
}
@ -554,7 +554,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
Asm->OutStreamer->AddComment(" On action: " +
Twine((S.Action - 1) / 2 + 1));
}
Asm->EmitULEB128(S.Action);
Asm->emitULEB128(S.Action);
}
}
Asm->OutStreamer->EmitLabel(CstEndLabel);
@ -584,7 +584,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
else
Asm->OutStreamer->AddComment(" Cleanup");
}
Asm->EmitSLEB128(Action.ValueForTypeID);
Asm->emitSLEB128(Action.ValueForTypeID);
// Action Record
//
@ -598,7 +598,7 @@ MCSymbol *EHStreamer::emitExceptionTable() {
Asm->OutStreamer->AddComment(" Continue to action "+Twine(NextAction));
}
}
Asm->EmitSLEB128(Action.NextAction);
Asm->emitSLEB128(Action.NextAction);
}
if (HaveTTData) {
@ -649,6 +649,6 @@ void EHStreamer::emitTypeInfos(unsigned TTypeEncoding, MCSymbol *TTBaseLabel) {
Asm->OutStreamer->AddComment("FilterInfo " + Twine(Entry));
}
Asm->EmitULEB128(TypeID);
Asm->emitULEB128(TypeID);
}
}

View File

@ -84,7 +84,7 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
// Emit the address of the safe point.
OS.AddComment("safe point address");
MCSymbol *Label = PI->Label;
AP.EmitLabelPlusOffset(Label /*Hi*/, 0 /*Offset*/, 4 /*Size*/);
AP.emitLabelPlusOffset(Label /*Hi*/, 0 /*Offset*/, 4 /*Size*/);
}
// Stack information never change in safe points! Only print info from the

View File

@ -198,9 +198,9 @@ public:
void EmitIntValueInHex(uint64_t Value, unsigned Size) override;
void EmitIntValueInHexWithPadding(uint64_t Value, unsigned Size) 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;
void EmitDTPRel32Value(const MCExpr *Value) override;
void EmitDTPRel64Value(const MCExpr *Value) override;
@ -239,9 +239,9 @@ public:
Optional<MD5::MD5Result> Checksum,
Optional<StringRef> Source,
unsigned CUID = 0) override;
void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
unsigned Column, unsigned Flags,
unsigned Isa, unsigned Discriminator,
void emitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column,
unsigned Flags, unsigned Isa,
unsigned Discriminator,
StringRef FileName) override;
MCSymbol *getDwarfLineTableSymbol(unsigned CUID) override;
@ -1037,10 +1037,10 @@ void MCAsmStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
}
}
void MCAsmStreamer::EmitULEB128Value(const MCExpr *Value) {
void MCAsmStreamer::emitULEB128Value(const MCExpr *Value) {
int64_t IntValue;
if (Value->evaluateAsAbsolute(IntValue)) {
EmitULEB128IntValue(IntValue);
emitULEB128IntValue(IntValue);
return;
}
OS << "\t.uleb128 ";
@ -1048,10 +1048,10 @@ void MCAsmStreamer::EmitULEB128Value(const MCExpr *Value) {
EmitEOL();
}
void MCAsmStreamer::EmitSLEB128Value(const MCExpr *Value) {
void MCAsmStreamer::emitSLEB128Value(const MCExpr *Value) {
int64_t IntValue;
if (Value->evaluateAsAbsolute(IntValue)) {
EmitSLEB128IntValue(IntValue);
emitSLEB128IntValue(IntValue);
return;
}
OS << "\t.sleb128 ";
@ -1313,10 +1313,9 @@ void MCAsmStreamer::emitDwarfFile0Directive(StringRef Directory,
EmitRawText(OS1.str());
}
void MCAsmStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
void MCAsmStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line,
unsigned Column, unsigned Flags,
unsigned Isa,
unsigned Discriminator,
unsigned Isa, unsigned Discriminator,
StringRef FileName) {
OS << "\t.loc\t" << FileNo << " " << Line << " " << Column;
if (MAI->supportsExtendedDwarfLocDirective()) {
@ -1349,8 +1348,8 @@ void MCAsmStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
<< Line << ':' << Column;
}
EmitEOL();
this->MCStreamer::EmitDwarfLocDirective(FileNo, Line, Column, Flags,
Isa, Discriminator, FileName);
this->MCStreamer::emitDwarfLocDirective(FileNo, Line, Column, Flags, Isa,
Discriminator, FileName);
}
MCSymbol *MCAsmStreamer::getDwarfLineTableSymbol(unsigned CUID) {

View File

@ -146,9 +146,9 @@ makeStartPlusIntExpr(MCContext &Ctx, const MCSymbol &Start, int IntVal) {
// This emits the Dwarf line table for the specified section from the entries
// in the LineSection.
//
static inline void
EmitDwarfLineTable(MCObjectStreamer *MCOS, MCSection *Section,
const MCLineSection::MCDwarfLineEntryCollection &LineEntries) {
static inline void emitDwarfLineTable(
MCObjectStreamer *MCOS, MCSection *Section,
const MCLineSection::MCDwarfLineEntryCollection &LineEntries) {
unsigned FileNum = 1;
unsigned LastLine = 1;
unsigned Column = 0;
@ -164,26 +164,26 @@ EmitDwarfLineTable(MCObjectStreamer *MCOS, MCSection *Section,
if (FileNum != LineEntry.getFileNum()) {
FileNum = LineEntry.getFileNum();
MCOS->EmitIntValue(dwarf::DW_LNS_set_file, 1);
MCOS->EmitULEB128IntValue(FileNum);
MCOS->emitULEB128IntValue(FileNum);
}
if (Column != LineEntry.getColumn()) {
Column = LineEntry.getColumn();
MCOS->EmitIntValue(dwarf::DW_LNS_set_column, 1);
MCOS->EmitULEB128IntValue(Column);
MCOS->emitULEB128IntValue(Column);
}
if (Discriminator != LineEntry.getDiscriminator() &&
MCOS->getContext().getDwarfVersion() >= 4) {
Discriminator = LineEntry.getDiscriminator();
unsigned Size = getULEB128Size(Discriminator);
MCOS->EmitIntValue(dwarf::DW_LNS_extended_op, 1);
MCOS->EmitULEB128IntValue(Size + 1);
MCOS->emitULEB128IntValue(Size + 1);
MCOS->EmitIntValue(dwarf::DW_LNE_set_discriminator, 1);
MCOS->EmitULEB128IntValue(Discriminator);
MCOS->emitULEB128IntValue(Discriminator);
}
if (Isa != LineEntry.getIsa()) {
Isa = LineEntry.getIsa();
MCOS->EmitIntValue(dwarf::DW_LNS_set_isa, 1);
MCOS->EmitULEB128IntValue(Isa);
MCOS->emitULEB128IntValue(Isa);
}
if ((LineEntry.getFlags() ^ Flags) & DWARF2_FLAG_IS_STMT) {
Flags = LineEntry.getFlags();
@ -202,7 +202,7 @@ EmitDwarfLineTable(MCObjectStreamer *MCOS, MCSection *Section,
// line numbers and the increment of the address from the previous Label
// and the current Label.
const MCAsmInfo *asmInfo = MCOS->getContext().getAsmInfo();
MCOS->EmitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label,
MCOS->emitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label,
asmInfo->getCodePointerSize());
Discriminator = 0;
@ -222,7 +222,7 @@ EmitDwarfLineTable(MCObjectStreamer *MCOS, MCSection *Section,
MCOS->SwitchSection(Ctx.getObjectFileInfo()->getDwarfLineSection());
const MCAsmInfo *AsmInfo = Ctx.getAsmInfo();
MCOS->EmitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, SectionEnd,
MCOS->emitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, SectionEnd,
AsmInfo->getCodePointerSize());
}
@ -342,7 +342,7 @@ void MCDwarfLineTableHeader::emitV2FileDirTables(MCStreamer *MCOS) const {
assert(!MCDwarfFiles[i].Name.empty());
MCOS->EmitBytes(MCDwarfFiles[i].Name); // FileName and...
MCOS->EmitBytes(StringRef("\0", 1)); // its null terminator.
MCOS->EmitULEB128IntValue(MCDwarfFiles[i].DirIndex); // Directory number.
MCOS->emitULEB128IntValue(MCDwarfFiles[i].DirIndex); // Directory number.
MCOS->EmitIntValue(0, 1); // Last modification timestamp (always 0).
MCOS->EmitIntValue(0, 1); // File size (always 0).
}
@ -359,7 +359,7 @@ static void emitOneV5FileEntry(MCStreamer *MCOS, const MCDwarfFile &DwarfFile,
MCOS->EmitBytes(DwarfFile.Name); // FileName and...
MCOS->EmitBytes(StringRef("\0", 1)); // its null terminator.
}
MCOS->EmitULEB128IntValue(DwarfFile.DirIndex); // Directory number.
MCOS->emitULEB128IntValue(DwarfFile.DirIndex); // Directory number.
if (EmitMD5) {
const MD5::MD5Result &Cksum = *DwarfFile.Checksum;
MCOS->EmitBinaryData(
@ -383,10 +383,10 @@ void MCDwarfLineTableHeader::emitV5FileDirTables(
// non-split object, these are references to .debug_line_str; in a split
// object, they are inline strings.
MCOS->EmitIntValue(1, 1);
MCOS->EmitULEB128IntValue(dwarf::DW_LNCT_path);
MCOS->EmitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp
MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path);
MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp
: dwarf::DW_FORM_string);
MCOS->EmitULEB128IntValue(MCDwarfDirs.size() + 1);
MCOS->emitULEB128IntValue(MCDwarfDirs.size() + 1);
// Try not to emit an empty compilation directory.
const StringRef CompDir = CompilationDir.empty()
? MCOS->getContext().getCompilationDir()
@ -415,25 +415,25 @@ void MCDwarfLineTableHeader::emitV5FileDirTables(
if (HasSource)
Entries += 1;
MCOS->EmitIntValue(Entries, 1);
MCOS->EmitULEB128IntValue(dwarf::DW_LNCT_path);
MCOS->EmitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp
MCOS->emitULEB128IntValue(dwarf::DW_LNCT_path);
MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp
: dwarf::DW_FORM_string);
MCOS->EmitULEB128IntValue(dwarf::DW_LNCT_directory_index);
MCOS->EmitULEB128IntValue(dwarf::DW_FORM_udata);
MCOS->emitULEB128IntValue(dwarf::DW_LNCT_directory_index);
MCOS->emitULEB128IntValue(dwarf::DW_FORM_udata);
if (HasAllMD5) {
MCOS->EmitULEB128IntValue(dwarf::DW_LNCT_MD5);
MCOS->EmitULEB128IntValue(dwarf::DW_FORM_data16);
MCOS->emitULEB128IntValue(dwarf::DW_LNCT_MD5);
MCOS->emitULEB128IntValue(dwarf::DW_FORM_data16);
}
if (HasSource) {
MCOS->EmitULEB128IntValue(dwarf::DW_LNCT_LLVM_source);
MCOS->EmitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp
MCOS->emitULEB128IntValue(dwarf::DW_LNCT_LLVM_source);
MCOS->emitULEB128IntValue(LineStr ? dwarf::DW_FORM_line_strp
: dwarf::DW_FORM_string);
}
// Then the counted list of files. The root file is file #0, then emit the
// files as provide by .file directives.
// MCDwarfFiles has an unused element [0] so use size() not size()+1.
// But sometimes MCDwarfFiles is empty, in which case we still emit one file.
MCOS->EmitULEB128IntValue(MCDwarfFiles.empty() ? 1 : MCDwarfFiles.size());
MCOS->emitULEB128IntValue(MCDwarfFiles.empty() ? 1 : MCDwarfFiles.size());
// To accommodate assembler source written for DWARF v4 but trying to emit
// v5: If we didn't see a root file explicitly, replicate file #1.
assert((!RootFile.Name.empty() || MCDwarfFiles.size() >= 1) &&
@ -527,7 +527,7 @@ void MCDwarfLineTable::EmitCU(MCObjectStreamer *MCOS,
// Put out the line tables.
for (const auto &LineSec : MCLineSections.getMCLineEntries())
EmitDwarfLineTable(MCOS, LineSec.first, LineSec.second);
emitDwarfLineTable(MCOS, LineSec.first, LineSec.second);
// 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).
@ -790,8 +790,8 @@ bool MCDwarfLineAddr::FixedEncode(MCContext &Context,
// Utility function to write a tuple for .debug_abbrev.
static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) {
MCOS->EmitULEB128IntValue(Name);
MCOS->EmitULEB128IntValue(Form);
MCOS->emitULEB128IntValue(Name);
MCOS->emitULEB128IntValue(Form);
}
// When generating dwarf for assembly source files this emits
@ -801,8 +801,8 @@ static void EmitGenDwarfAbbrev(MCStreamer *MCOS) {
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection());
// DW_TAG_compile_unit DIE abbrev (1).
MCOS->EmitULEB128IntValue(1);
MCOS->EmitULEB128IntValue(dwarf::DW_TAG_compile_unit);
MCOS->emitULEB128IntValue(1);
MCOS->emitULEB128IntValue(dwarf::DW_TAG_compile_unit);
MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1);
EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, context.getDwarfVersion() >= 4
? dwarf::DW_FORM_sec_offset
@ -827,8 +827,8 @@ static void EmitGenDwarfAbbrev(MCStreamer *MCOS) {
EmitAbbrev(MCOS, 0, 0);
// DW_TAG_label DIE abbrev (2).
MCOS->EmitULEB128IntValue(2);
MCOS->EmitULEB128IntValue(dwarf::DW_TAG_label);
MCOS->emitULEB128IntValue(2);
MCOS->emitULEB128IntValue(dwarf::DW_TAG_label);
MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1);
EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string);
EmitAbbrev(MCOS, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data4);
@ -838,8 +838,8 @@ static void EmitGenDwarfAbbrev(MCStreamer *MCOS) {
EmitAbbrev(MCOS, 0, 0);
// DW_TAG_unspecified_parameters DIE abbrev (3).
MCOS->EmitULEB128IntValue(3);
MCOS->EmitULEB128IntValue(dwarf::DW_TAG_unspecified_parameters);
MCOS->emitULEB128IntValue(3);
MCOS->emitULEB128IntValue(dwarf::DW_TAG_unspecified_parameters);
MCOS->EmitIntValue(dwarf::DW_CHILDREN_no, 1);
EmitAbbrev(MCOS, 0, 0);
@ -967,7 +967,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
// Second part: the compile_unit DIE.
// The DW_TAG_compile_unit DIE abbrev (1).
MCOS->EmitULEB128IntValue(1);
MCOS->emitULEB128IntValue(1);
// 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.
@ -1059,7 +1059,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
MCOS->getContext().getMCGenDwarfLabelEntries();
for (const auto &Entry : Entries) {
// The DW_TAG_label DIE abbrev (2).
MCOS->EmitULEB128IntValue(2);
MCOS->emitULEB128IntValue(2);
// AT_name, of the label without any leading underbar.
MCOS->EmitBytes(Entry.getName());
@ -1080,7 +1080,7 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
MCOS->EmitIntValue(0, 1);
// The DW_TAG_unspecified_parameters DIE abbrev (3).
MCOS->EmitULEB128IntValue(3);
MCOS->emitULEB128IntValue(3);
// Add the NULL DIE terminating the DW_TAG_unspecified_parameters DIE's.
MCOS->EmitIntValue(0, 1);
@ -1339,8 +1339,8 @@ void FrameEmitterImpl::EmitCFIInstruction(const MCCFIInstruction &Instr) {
Reg2 = MRI->getDwarfRegNumFromDwarfEHRegNum(Reg2);
}
Streamer.EmitIntValue(dwarf::DW_CFA_register, 1);
Streamer.EmitULEB128IntValue(Reg1);
Streamer.EmitULEB128IntValue(Reg2);
Streamer.emitULEB128IntValue(Reg1);
Streamer.emitULEB128IntValue(Reg2);
return;
}
case MCCFIInstruction::OpWindowSave:
@ -1354,7 +1354,7 @@ void FrameEmitterImpl::EmitCFIInstruction(const MCCFIInstruction &Instr) {
case MCCFIInstruction::OpUndefined: {
unsigned Reg = Instr.getRegister();
Streamer.EmitIntValue(dwarf::DW_CFA_undefined, 1);
Streamer.EmitULEB128IntValue(Reg);
Streamer.emitULEB128IntValue(Reg);
return;
}
case MCCFIInstruction::OpAdjustCfaOffset:
@ -1369,7 +1369,7 @@ void FrameEmitterImpl::EmitCFIInstruction(const MCCFIInstruction &Instr) {
else
CFAOffset = -Instr.getOffset();
Streamer.EmitULEB128IntValue(CFAOffset);
Streamer.emitULEB128IntValue(CFAOffset);
return;
}
@ -1378,9 +1378,9 @@ void FrameEmitterImpl::EmitCFIInstruction(const MCCFIInstruction &Instr) {
if (!IsEH)
Reg = MRI->getDwarfRegNumFromDwarfEHRegNum(Reg);
Streamer.EmitIntValue(dwarf::DW_CFA_def_cfa, 1);
Streamer.EmitULEB128IntValue(Reg);
Streamer.emitULEB128IntValue(Reg);
CFAOffset = -Instr.getOffset();
Streamer.EmitULEB128IntValue(CFAOffset);
Streamer.emitULEB128IntValue(CFAOffset);
return;
}
@ -1389,7 +1389,7 @@ void FrameEmitterImpl::EmitCFIInstruction(const MCCFIInstruction &Instr) {
if (!IsEH)
Reg = MRI->getDwarfRegNumFromDwarfEHRegNum(Reg);
Streamer.EmitIntValue(dwarf::DW_CFA_def_cfa_register, 1);
Streamer.EmitULEB128IntValue(Reg);
Streamer.emitULEB128IntValue(Reg);
return;
}
@ -1409,15 +1409,15 @@ void FrameEmitterImpl::EmitCFIInstruction(const MCCFIInstruction &Instr) {
if (Offset < 0) {
Streamer.EmitIntValue(dwarf::DW_CFA_offset_extended_sf, 1);
Streamer.EmitULEB128IntValue(Reg);
Streamer.EmitSLEB128IntValue(Offset);
Streamer.emitULEB128IntValue(Reg);
Streamer.emitSLEB128IntValue(Offset);
} else if (Reg < 64) {
Streamer.EmitIntValue(dwarf::DW_CFA_offset + Reg, 1);
Streamer.EmitULEB128IntValue(Offset);
Streamer.emitULEB128IntValue(Offset);
} else {
Streamer.EmitIntValue(dwarf::DW_CFA_offset_extended, 1);
Streamer.EmitULEB128IntValue(Reg);
Streamer.EmitULEB128IntValue(Offset);
Streamer.emitULEB128IntValue(Reg);
Streamer.emitULEB128IntValue(Offset);
}
return;
}
@ -1430,7 +1430,7 @@ void FrameEmitterImpl::EmitCFIInstruction(const MCCFIInstruction &Instr) {
case MCCFIInstruction::OpSameValue: {
unsigned Reg = Instr.getRegister();
Streamer.EmitIntValue(dwarf::DW_CFA_same_value, 1);
Streamer.EmitULEB128IntValue(Reg);
Streamer.emitULEB128IntValue(Reg);
return;
}
case MCCFIInstruction::OpRestore: {
@ -1441,13 +1441,13 @@ void FrameEmitterImpl::EmitCFIInstruction(const MCCFIInstruction &Instr) {
Streamer.EmitIntValue(dwarf::DW_CFA_restore | Reg, 1);
} else {
Streamer.EmitIntValue(dwarf::DW_CFA_restore_extended, 1);
Streamer.EmitULEB128IntValue(Reg);
Streamer.emitULEB128IntValue(Reg);
}
return;
}
case MCCFIInstruction::OpGnuArgsSize:
Streamer.EmitIntValue(dwarf::DW_CFA_GNU_args_size, 1);
Streamer.EmitULEB128IntValue(Instr.getOffset());
Streamer.emitULEB128IntValue(Instr.getOffset());
return;
case MCCFIInstruction::OpEscape:
@ -1469,7 +1469,7 @@ void FrameEmitterImpl::EmitCFIInstructions(ArrayRef<MCCFIInstruction> Instrs,
if (BaseLabel && Label) {
MCSymbol *ThisSym = Label;
if (ThisSym != BaseLabel) {
Streamer.EmitDwarfAdvanceFrameAddr(BaseLabel, ThisSym);
Streamer.emitDwarfAdvanceFrameAddr(BaseLabel, ThisSym);
BaseLabel = ThisSym;
}
}
@ -1605,10 +1605,10 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(const MCDwarfFrameInfo &Frame) {
}
// Code Alignment Factor
Streamer.EmitULEB128IntValue(context.getAsmInfo()->getMinInstAlignment());
Streamer.emitULEB128IntValue(context.getAsmInfo()->getMinInstAlignment());
// Data Alignment Factor
Streamer.EmitSLEB128IntValue(getDataAlignmentFactor(Streamer));
Streamer.emitSLEB128IntValue(getDataAlignmentFactor(Streamer));
// Return Address Register
unsigned RAReg = Frame.RAReg;
@ -1620,7 +1620,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(const MCDwarfFrameInfo &Frame) {
"DWARF 2 encodes return_address_register in one byte");
Streamer.EmitIntValue(RAReg, 1);
} else {
Streamer.EmitULEB128IntValue(RAReg);
Streamer.emitULEB128IntValue(RAReg);
}
// Augmentation Data Length (optional)
@ -1638,7 +1638,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(const MCDwarfFrameInfo &Frame) {
// Encoding of the FDE pointers
augmentationLength += 1;
Streamer.EmitULEB128IntValue(augmentationLength);
Streamer.emitULEB128IntValue(augmentationLength);
// Augmentation Data (optional)
if (Frame.Personality) {
@ -1723,7 +1723,7 @@ void FrameEmitterImpl::EmitFDE(const MCSymbol &cieStart,
if (frame.Lsda)
augmentationLength += getSizeForEncoding(Streamer, frame.LsdaEncoding);
Streamer.EmitULEB128IntValue(augmentationLength);
Streamer.emitULEB128IntValue(augmentationLength);
// Augmentation Data
if (frame.Lsda)

View File

@ -106,10 +106,10 @@ void MCELFStreamer::EmitLabel(MCSymbol *S, SMLoc Loc) {
Symbol->setType(ELF::STT_TLS);
}
void MCELFStreamer::EmitLabelAtPos(MCSymbol *S, SMLoc Loc, MCFragment *F,
void MCELFStreamer::emitLabelAtPos(MCSymbol *S, SMLoc Loc, MCFragment *F,
uint64_t Offset) {
auto *Symbol = cast<MCSymbolELF>(S);
MCObjectStreamer::EmitLabelAtPos(Symbol, Loc, F, Offset);
MCObjectStreamer::emitLabelAtPos(Symbol, Loc, F, Offset);
const MCSectionELF &Section =
static_cast<const MCSectionELF &>(*getCurrentSectionOnly());

View File

@ -154,7 +154,7 @@ void MCObjectStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi,
void MCObjectStreamer::emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi,
const MCSymbol *Lo) {
if (Optional<uint64_t> Diff = absoluteSymbolDiff(getAssembler(), Hi, Lo)) {
EmitULEB128IntValue(*Diff);
emitULEB128IntValue(*Diff);
return;
}
MCStreamer::emitAbsoluteSymbolDiffAsULEB128(Hi, Lo);
@ -291,7 +291,7 @@ void MCObjectStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
// Emit a label at a previously emitted fragment/offset position. This must be
// within the currently-active section.
void MCObjectStreamer::EmitLabelAtPos(MCSymbol *Symbol, SMLoc Loc,
void MCObjectStreamer::emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc,
MCFragment *F, uint64_t Offset) {
assert(F->getParent() == getCurrentSectionOnly());
@ -309,19 +309,19 @@ void MCObjectStreamer::EmitLabelAtPos(MCSymbol *Symbol, SMLoc Loc,
}
}
void MCObjectStreamer::EmitULEB128Value(const MCExpr *Value) {
void MCObjectStreamer::emitULEB128Value(const MCExpr *Value) {
int64_t IntValue;
if (Value->evaluateAsAbsolute(IntValue, getAssemblerPtr())) {
EmitULEB128IntValue(IntValue);
emitULEB128IntValue(IntValue);
return;
}
insert(new MCLEBFragment(*Value, false));
}
void MCObjectStreamer::EmitSLEB128Value(const MCExpr *Value) {
void MCObjectStreamer::emitSLEB128Value(const MCExpr *Value) {
int64_t IntValue;
if (Value->evaluateAsAbsolute(IntValue, getAssemblerPtr())) {
EmitSLEB128IntValue(IntValue);
emitSLEB128IntValue(IntValue);
return;
}
insert(new MCLEBFragment(*Value, true));
@ -443,7 +443,7 @@ void MCObjectStreamer::EmitBundleUnlock() {
llvm_unreachable(BundlingNotImplementedMsg);
}
void MCObjectStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
void MCObjectStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line,
unsigned Column, unsigned Flags,
unsigned Isa,
unsigned Discriminator,
@ -452,8 +452,8 @@ void MCObjectStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
// first one gets a line entry.
MCDwarfLineEntry::Make(this, getCurrentSectionOnly());
this->MCStreamer::EmitDwarfLocDirective(FileNo, Line, Column, Flags,
Isa, Discriminator, FileName);
this->MCStreamer::emitDwarfLocDirective(FileNo, Line, Column, Flags, Isa,
Discriminator, FileName);
}
static const MCExpr *buildSymbolDiff(MCObjectStreamer &OS, const MCSymbol *A,
@ -473,7 +473,7 @@ static void emitDwarfSetLineAddr(MCObjectStreamer &OS,
int PointerSize) {
// emit the sequence to set the address
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.EmitSymbolValue(Label, PointerSize);
@ -481,7 +481,7 @@ static void emitDwarfSetLineAddr(MCObjectStreamer &OS,
MCDwarfLineAddr::Emit(&OS, Params, LineDelta, 0);
}
void MCObjectStreamer::EmitDwarfAdvanceLineAddr(int64_t LineDelta,
void MCObjectStreamer::emitDwarfAdvanceLineAddr(int64_t LineDelta,
const MCSymbol *LastLabel,
const MCSymbol *Label,
unsigned PointerSize) {
@ -500,7 +500,7 @@ void MCObjectStreamer::EmitDwarfAdvanceLineAddr(int64_t LineDelta,
insert(new MCDwarfLineAddrFragment(LineDelta, *AddrDelta));
}
void MCObjectStreamer::EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
void MCObjectStreamer::emitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
const MCSymbol *Label) {
const MCExpr *AddrDelta = buildSymbolDiff(*this, Label, LastLabel);
int64_t Res;

View File

@ -875,7 +875,7 @@ bool AsmParser::enabledGenDwarfForAssembly() {
/*Cksum=*/None, /*Source=*/None);
const MCDwarfFile &RootFile =
getContext().getMCDwarfLineTable(/*CUID=*/0).getRootFile();
getContext().setGenDwarfFileNumber(getStreamer().EmitDwarfFileDirective(
getContext().setGenDwarfFileNumber(getStreamer().emitDwarfFileDirective(
/*CUID=*/0, getContext().getCompilationDir(), RootFile.Name,
RootFile.Checksum, RootFile.Source));
}
@ -2249,7 +2249,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
// current Dwarf File is for the CppHashFilename if not then emit the
// Dwarf File table for it and adjust the line number for the .loc.
if (!CppHashInfo.Filename.empty()) {
unsigned FileNumber = getStreamer().EmitDwarfFileDirective(
unsigned FileNumber = getStreamer().emitDwarfFileDirective(
0, StringRef(), CppHashInfo.Filename);
getContext().setGenDwarfFileNumber(FileNumber);
@ -2258,7 +2258,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
Line = CppHashInfo.LineNumber - 1 + (Line - CppHashLocLineNo);
}
getStreamer().EmitDwarfLocDirective(
getStreamer().emitDwarfLocDirective(
getContext().getGenDwarfFileNumber(), Line, 0,
DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0, 0, 0,
StringRef());
@ -3573,7 +3573,7 @@ bool AsmParser::parseDirectiveLoc() {
if (parseMany(parseLocOp, false /*hasComma*/))
return true;
getStreamer().EmitDwarfLocDirective(FileNumber, LineNumber, ColumnPos, Flags,
getStreamer().emitDwarfLocDirective(FileNumber, LineNumber, ColumnPos, Flags,
Isa, Discriminator, StringRef());
return false;
@ -4831,9 +4831,9 @@ bool AsmParser::parseDirectiveLEB128(bool Signed) {
if (parseExpression(Value))
return true;
if (Signed)
getStreamer().EmitSLEB128Value(Value);
getStreamer().emitSLEB128Value(Value);
else
getStreamer().EmitULEB128Value(Value);
getStreamer().emitULEB128Value(Value);
return false;
};

View File

@ -143,7 +143,7 @@ void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size) {
/// EmitULEB128IntValue - Special case of EmitULEB128Value that avoids the
/// client having to pass in a MCExpr for constant integers.
void MCStreamer::EmitULEB128IntValue(uint64_t Value, unsigned PadTo) {
void MCStreamer::emitULEB128IntValue(uint64_t Value, unsigned PadTo) {
SmallString<128> Tmp;
raw_svector_ostream OSE(Tmp);
encodeULEB128(Value, OSE, PadTo);
@ -152,7 +152,7 @@ void MCStreamer::EmitULEB128IntValue(uint64_t Value, unsigned PadTo) {
/// EmitSLEB128IntValue - Special case of EmitSLEB128Value that avoids the
/// client having to pass in a MCExpr for constant integers.
void MCStreamer::EmitSLEB128IntValue(int64_t Value) {
void MCStreamer::emitSLEB128IntValue(int64_t Value) {
SmallString<128> Tmp;
raw_svector_ostream OSE(Tmp);
encodeSLEB128(Value, OSE);
@ -235,10 +235,9 @@ void MCStreamer::EmitCFIBKeyFrame() {
CurFrame->IsBKeyFrame = true;
}
void MCStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
void MCStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line,
unsigned Column, unsigned Flags,
unsigned Isa,
unsigned Discriminator,
unsigned Isa, unsigned Discriminator,
StringRef FileName) {
getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa,
Discriminator);
@ -1045,7 +1044,7 @@ void MCStreamer::emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi,
MCBinaryExpr::createSub(MCSymbolRefExpr::create(Hi, Context),
MCSymbolRefExpr::create(Lo, Context), Context);
EmitULEB128Value(Diff);
emitULEB128Value(Diff);
}
void MCStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {}
@ -1083,8 +1082,8 @@ void MCStreamer::EmitBinaryData(StringRef Data) { EmitBytes(Data); }
void MCStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) {
visitUsedExpr(*Value);
}
void MCStreamer::EmitULEB128Value(const MCExpr *Value) {}
void MCStreamer::EmitSLEB128Value(const MCExpr *Value) {}
void MCStreamer::emitULEB128Value(const MCExpr *Value) {}
void MCStreamer::emitSLEB128Value(const MCExpr *Value) {}
void MCStreamer::emitFill(const MCExpr &NumBytes, uint64_t Value, SMLoc Loc) {}
void MCStreamer::emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
SMLoc Loc) {}

View File

@ -303,8 +303,8 @@ void AMDGPUAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
if (!Align)
Align = 4;
EmitVisibility(GVSym, GV->getVisibility(), !GV->isDeclaration());
EmitLinkage(GV, GVSym);
emitVisibility(GVSym, GV->getVisibility(), !GV->isDeclaration());
emitLinkage(GV, GVSym);
if (auto TS = getTargetStreamer())
TS->emitAMDGPULDS(GVSym, Size, Align);
return;

View File

@ -647,7 +647,7 @@ private:
uint64_t Offset) {
auto *Symbol = cast<MCSymbolELF>(getContext().getOrCreateSymbol(
Name + "." + Twine(MappingSymbolCounter++)));
EmitLabelAtPos(Symbol, Loc, F, Offset);
emitLabelAtPos(Symbol, Loc, F, Offset);
Symbol->setType(ELF::STT_NOTYPE);
Symbol->setBinding(ELF::STB_LOCAL);
Symbol->setExternal(false);
@ -1101,18 +1101,18 @@ void ARMTargetELFStreamer::finishAttributeSection() {
// emit each field as its type (ULEB or String)
for (size_t i = 0; i < Contents.size(); ++i) {
AttributeItem item = Contents[i];
Streamer.EmitULEB128IntValue(item.Tag);
Streamer.emitULEB128IntValue(item.Tag);
switch (item.Type) {
default: llvm_unreachable("Invalid attribute type");
case AttributeItem::NumericAttribute:
Streamer.EmitULEB128IntValue(item.IntValue);
Streamer.emitULEB128IntValue(item.IntValue);
break;
case AttributeItem::TextAttribute:
Streamer.EmitBytes(item.StringValue);
Streamer.EmitIntValue(0, 1); // '\0'
break;
case AttributeItem::NumericAndTextAttributes:
Streamer.EmitULEB128IntValue(item.IntValue);
Streamer.emitULEB128IntValue(item.IntValue);
Streamer.EmitBytes(item.StringValue);
Streamer.EmitIntValue(0, 1); // '\0'
break;

View File

@ -360,7 +360,7 @@ void BTFKindDataSec::emitType(MCStreamer &OS) {
for (const auto &V : Vars) {
OS.EmitIntValue(std::get<0>(V), 4);
Asm->EmitLabelReference(std::get<1>(V), 4);
Asm->emitLabelReference(std::get<1>(V), 4);
OS.EmitIntValue(std::get<2>(V), 4);
}
}
@ -802,7 +802,7 @@ void BTFDebug::emitBTFExtSection() {
OS.EmitIntValue(FuncSec.first, 4);
OS.EmitIntValue(FuncSec.second.size(), 4);
for (const auto &FuncInfo : FuncSec.second) {
Asm->EmitLabelReference(FuncInfo.Label, 4);
Asm->emitLabelReference(FuncInfo.Label, 4);
OS.EmitIntValue(FuncInfo.TypeId, 4);
}
}
@ -816,7 +816,7 @@ void BTFDebug::emitBTFExtSection() {
OS.EmitIntValue(LineSec.first, 4);
OS.EmitIntValue(LineSec.second.size(), 4);
for (const auto &LineInfo : LineSec.second) {
Asm->EmitLabelReference(LineInfo.Label, 4);
Asm->emitLabelReference(LineInfo.Label, 4);
OS.EmitIntValue(LineInfo.FileNameOff, 4);
OS.EmitIntValue(LineInfo.LineOff, 4);
OS.AddComment("Line " + std::to_string(LineInfo.LineNum) + " Col " +
@ -835,7 +835,7 @@ void BTFDebug::emitBTFExtSection() {
OS.EmitIntValue(FieldRelocSec.first, 4);
OS.EmitIntValue(FieldRelocSec.second.size(), 4);
for (const auto &FieldRelocInfo : FieldRelocSec.second) {
Asm->EmitLabelReference(FieldRelocInfo.Label, 4);
Asm->emitLabelReference(FieldRelocInfo.Label, 4);
OS.EmitIntValue(FieldRelocInfo.TypeID, 4);
OS.EmitIntValue(FieldRelocInfo.OffsetNameOff, 4);
OS.EmitIntValue(FieldRelocInfo.RelocKind, 4);

View File

@ -1255,7 +1255,7 @@ void MipsAsmPrinter::PrintDebugValueComment(const MachineInstr *MI,
// Emit .dtprelword or .dtpreldword directive
// and value for debug thread local expression.
void MipsAsmPrinter::EmitDebugValue(const MCExpr *Value, unsigned Size) const {
void MipsAsmPrinter::emitDebugValue(const MCExpr *Value, unsigned Size) const {
if (auto *MipsExpr = dyn_cast<MipsMCExpr>(Value)) {
if (MipsExpr && MipsExpr->getKind() == MipsMCExpr::MEK_DTPREL) {
switch (Size) {
@ -1271,7 +1271,7 @@ void MipsAsmPrinter::EmitDebugValue(const MCExpr *Value, unsigned Size) const {
return;
}
}
AsmPrinter::EmitDebugValue(Value, Size);
AsmPrinter::emitDebugValue(Value, Size);
}
// Align all targets of indirect branches on bundle size. Used only if target

View File

@ -157,7 +157,7 @@ public:
void emitStartOfAsmFile(Module &M) override;
void emitEndOfAsmFile(Module &M) override;
void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS);
void EmitDebugValue(const MCExpr *Value, unsigned Size) const override;
void emitDebugValue(const MCExpr *Value, unsigned Size) const override;
};
} // end namespace llvm

View File

@ -1631,7 +1631,7 @@ void PPCAIXAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
}
MCSymbol *EmittedInitSym = GVSym;
EmitLinkage(GV, EmittedInitSym);
emitLinkage(GV, EmittedInitSym);
EmitAlignment(getGVAlignment(GV, DL), GV);
OutStreamer->EmitLabel(EmittedInitSym);
EmitGlobalConstant(GV->getParent()->getDataLayout(), GV->getInitializer());

View File

@ -113,9 +113,9 @@ void WebAssemblyTargetWasmStreamer::emitLocal(ArrayRef<wasm::ValType> Types) {
++Grouped.back().second;
}
Streamer.EmitULEB128IntValue(Grouped.size());
Streamer.emitULEB128IntValue(Grouped.size());
for (auto Pair : Grouped) {
Streamer.EmitULEB128IntValue(Pair.second);
Streamer.emitULEB128IntValue(Pair.second);
emitValueType(Pair.first);
}
}

View File

@ -208,18 +208,18 @@ void WebAssemblyAsmPrinter::EmitProducerInfo(Module &M) {
".custom_section.producers", SectionKind::getMetadata());
OutStreamer->PushSection();
OutStreamer->SwitchSection(Producers);
OutStreamer->EmitULEB128IntValue(FieldCount);
OutStreamer->emitULEB128IntValue(FieldCount);
for (auto &Producers : {std::make_pair("language", &Languages),
std::make_pair("processed-by", &Tools)}) {
if (Producers.second->empty())
continue;
OutStreamer->EmitULEB128IntValue(strlen(Producers.first));
OutStreamer->emitULEB128IntValue(strlen(Producers.first));
OutStreamer->EmitBytes(Producers.first);
OutStreamer->EmitULEB128IntValue(Producers.second->size());
OutStreamer->emitULEB128IntValue(Producers.second->size());
for (auto &Producer : *Producers.second) {
OutStreamer->EmitULEB128IntValue(Producer.first.size());
OutStreamer->emitULEB128IntValue(Producer.first.size());
OutStreamer->EmitBytes(Producer.first);
OutStreamer->EmitULEB128IntValue(Producer.second.size());
OutStreamer->emitULEB128IntValue(Producer.second.size());
OutStreamer->EmitBytes(Producer.second);
}
}
@ -267,10 +267,10 @@ void WebAssemblyAsmPrinter::EmitTargetFeatures(Module &M) {
OutStreamer->PushSection();
OutStreamer->SwitchSection(FeaturesSection);
OutStreamer->EmitULEB128IntValue(EmittedFeatures.size());
OutStreamer->emitULEB128IntValue(EmittedFeatures.size());
for (auto &F : EmittedFeatures) {
OutStreamer->EmitIntValue(F.Prefix, 1);
OutStreamer->EmitULEB128IntValue(F.Name.size());
OutStreamer->emitULEB128IntValue(F.Name.size());
OutStreamer->EmitBytes(F.Name);
}

View File

@ -382,7 +382,7 @@ void DwarfStreamer::emitUnitRangesEntries(CompileUnit &Unit,
unsigned TupleSize = AddressSize * 2;
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->emitInt16(dwarf::DW_ARANGES_VERSION); // Version number
Asm->emitInt32(Unit.getStartOffset()); // Corresponding unit's offset
@ -505,7 +505,7 @@ void DwarfStreamer::emitLineTableForUnit(MCDwarfLineTableParams Params,
// The first 4 bytes is the total length of the information for this
// compilation unit (not including these 4 bytes for the length).
Asm->EmitLabelDifference(LineEndSym, LineStartSym, 4);
Asm->emitLabelDifference(LineEndSym, LineStartSym, 4);
Asm->OutStreamer->EmitLabel(LineStartSym);
// Copy Prologue.
MS->EmitBytes(PrologueBytes);
@ -541,7 +541,7 @@ void DwarfStreamer::emitLineTableForUnit(MCDwarfLineTableParams Params,
int64_t AddressDelta;
if (Address == -1ULL) {
MS->EmitIntValue(dwarf::DW_LNS_extended_op, 1);
MS->EmitULEB128IntValue(PointerSize + 1);
MS->emitULEB128IntValue(PointerSize + 1);
MS->EmitIntValue(dwarf::DW_LNE_set_address, 1);
MS->EmitIntValue(Row.Address.Address, PointerSize);
LineSectionSize += 2 + PointerSize + getULEB128Size(PointerSize + 1);
@ -558,13 +558,13 @@ void DwarfStreamer::emitLineTableForUnit(MCDwarfLineTableParams Params,
if (FileNum != Row.File) {
FileNum = Row.File;
MS->EmitIntValue(dwarf::DW_LNS_set_file, 1);
MS->EmitULEB128IntValue(FileNum);
MS->emitULEB128IntValue(FileNum);
LineSectionSize += 1 + getULEB128Size(FileNum);
}
if (Column != Row.Column) {
Column = Row.Column;
MS->EmitIntValue(dwarf::DW_LNS_set_column, 1);
MS->EmitULEB128IntValue(Column);
MS->emitULEB128IntValue(Column);
LineSectionSize += 1 + getULEB128Size(Column);
}
@ -574,7 +574,7 @@ void DwarfStreamer::emitLineTableForUnit(MCDwarfLineTableParams Params,
if (Isa != Row.Isa) {
Isa = Row.Isa;
MS->EmitIntValue(dwarf::DW_LNS_set_isa, 1);
MS->EmitULEB128IntValue(Isa);
MS->emitULEB128IntValue(Isa);
LineSectionSize += 1 + getULEB128Size(Isa);
}
if (IsStatement != Row.IsStmt) {
@ -609,12 +609,12 @@ void DwarfStreamer::emitLineTableForUnit(MCDwarfLineTableParams Params,
} else {
if (LineDelta) {
MS->EmitIntValue(dwarf::DW_LNS_advance_line, 1);
MS->EmitSLEB128IntValue(LineDelta);
MS->emitSLEB128IntValue(LineDelta);
LineSectionSize += 1 + getSLEB128Size(LineDelta);
}
if (AddressDelta) {
MS->EmitIntValue(dwarf::DW_LNS_advance_pc, 1);
MS->EmitULEB128IntValue(AddressDelta);
MS->emitULEB128IntValue(AddressDelta);
LineSectionSize += 1 + getULEB128Size(AddressDelta);
}
MCDwarfLineAddr::Encode(*MC, Params, std::numeric_limits<int64_t>::max(),
@ -660,14 +660,14 @@ void DwarfStreamer::translateLineTable(DataExtractor Data, uint64_t Offset) {
return;
}
Asm->EmitLabelDifference(EndLabel, BeginLabel, 4);
Asm->emitLabelDifference(EndLabel, BeginLabel, 4);
Asm->OutStreamer->EmitLabel(BeginLabel);
Asm->emitInt16(Version);
LineSectionSize += 6;
MCSymbol *HeaderBeginLabel = MC->createTempSymbol();
MCSymbol *HeaderEndLabel = MC->createTempSymbol();
Asm->EmitLabelDifference(HeaderEndLabel, HeaderBeginLabel, 4);
Asm->emitLabelDifference(HeaderEndLabel, HeaderBeginLabel, 4);
Asm->OutStreamer->EmitLabel(HeaderBeginLabel);
Offset += 4;
LineSectionSize += 4;
@ -703,9 +703,9 @@ void DwarfStreamer::translateLineTable(DataExtractor Data, uint64_t Offset) {
LineSectionSize += Translated.size() + 1;
uint64_t OffsetBeforeLEBs = Offset;
Asm->EmitULEB128(Data.getULEB128(&Offset));
Asm->EmitULEB128(Data.getULEB128(&Offset));
Asm->EmitULEB128(Data.getULEB128(&Offset));
Asm->emitULEB128(Data.getULEB128(&Offset));
Asm->emitULEB128(Data.getULEB128(&Offset));
Asm->emitULEB128(Data.getULEB128(&Offset));
LineSectionSize += Offset - OffsetBeforeLEBs;
}
Asm->emitInt8(0);
@ -761,7 +761,7 @@ void DwarfStreamer::emitPubSectionForUnit(
if (!HeaderEmitted) {
// Emit the header.
Asm->EmitLabelDifference(EndLabel, BeginLabel, 4); // Length
Asm->emitLabelDifference(EndLabel, BeginLabel, 4); // Length
Asm->OutStreamer->EmitLabel(BeginLabel);
Asm->emitInt16(dwarf::DW_PUBNAMES_VERSION); // Version
Asm->emitInt32(Unit.getStartOffset()); // Unit offset

View File

@ -249,10 +249,10 @@ void dwarfgen::LineTable::writeData(ArrayRef<ValueAndLength> Data,
Asm.OutStreamer->EmitIntValue(Entry.Value, Entry.Length);
continue;
case ULEB:
Asm.EmitULEB128(Entry.Value);
Asm.emitULEB128(Entry.Value);
continue;
case SLEB:
Asm.EmitSLEB128(Entry.Value);
Asm.emitSLEB128(Entry.Value);
continue;
}
llvm_unreachable("unsupported ValueAndLength Length value");
@ -264,9 +264,9 @@ MCSymbol *dwarfgen::LineTable::writeDefaultPrologue(AsmPrinter &Asm) const {
MCSymbol *UnitEnd = Asm.createTempSymbol("line_unit_end");
if (Format == DwarfFormat::DWARF64) {
Asm.emitInt32((int)dwarf::DW_LENGTH_DWARF64);
Asm.EmitLabelDifference(UnitEnd, UnitStart, 8);
Asm.emitLabelDifference(UnitEnd, UnitStart, 8);
} else {
Asm.EmitLabelDifference(UnitEnd, UnitStart, 4);
Asm.emitLabelDifference(UnitEnd, UnitStart, 4);
}
Asm.OutStreamer->EmitLabel(UnitStart);
Asm.emitInt16(Version);
@ -277,7 +277,7 @@ MCSymbol *dwarfgen::LineTable::writeDefaultPrologue(AsmPrinter &Asm) const {
MCSymbol *PrologueStart = Asm.createTempSymbol("line_prologue_start");
MCSymbol *PrologueEnd = Asm.createTempSymbol("line_prologue_end");
Asm.EmitLabelDifference(PrologueEnd, PrologueStart,
Asm.emitLabelDifference(PrologueEnd, PrologueStart,
Format == DwarfFormat::DWARF64 ? 8 : 4);
Asm.OutStreamer->EmitLabel(PrologueStart);
@ -323,9 +323,9 @@ static void writeV2IncludeAndFileTable(const DWARFDebugLine::Prologue &Prologue,
for (auto File : Prologue.FileNames) {
assert(File.Name.getAsCString() && "expected a string form for file name");
writeCString(*File.Name.getAsCString(), Asm);
Asm.EmitULEB128(File.DirIdx);
Asm.EmitULEB128(File.ModTime);
Asm.EmitULEB128(File.Length);
Asm.emitULEB128(File.DirIdx);
Asm.emitULEB128(File.ModTime);
Asm.emitULEB128(File.Length);
}
Asm.emitInt8(0);
}
@ -335,20 +335,20 @@ static void writeV5IncludeAndFileTable(const DWARFDebugLine::Prologue &Prologue,
Asm.emitInt8(1); // directory_entry_format_count.
// TODO: Add support for other content descriptions - we currently only
// support a single DW_LNCT_path/DW_FORM_string.
Asm.EmitULEB128(DW_LNCT_path);
Asm.EmitULEB128(DW_FORM_string);
Asm.EmitULEB128(Prologue.IncludeDirectories.size());
Asm.emitULEB128(DW_LNCT_path);
Asm.emitULEB128(DW_FORM_string);
Asm.emitULEB128(Prologue.IncludeDirectories.size());
for (auto Include : Prologue.IncludeDirectories) {
assert(Include.getAsCString() && "expected a string form for include dir");
writeCString(*Include.getAsCString(), Asm);
}
Asm.emitInt8(2); // file_name_entry_format_count.
Asm.EmitULEB128(DW_LNCT_path);
Asm.EmitULEB128(DW_FORM_string);
Asm.EmitULEB128(DW_LNCT_directory_index);
Asm.EmitULEB128(DW_FORM_data1);
Asm.EmitULEB128(Prologue.FileNames.size());
Asm.emitULEB128(DW_LNCT_path);
Asm.emitULEB128(DW_FORM_string);
Asm.emitULEB128(DW_LNCT_directory_index);
Asm.emitULEB128(DW_FORM_data1);
Asm.emitULEB128(Prologue.FileNames.size());
for (auto File : Prologue.FileNames) {
assert(File.Name.getAsCString() && "expected a string form for file name");
writeCString(*File.Name.getAsCString(), Asm);