Style update. NFC.

Rename 3 functions to start with lowercase letters. Don't repeat the
name in the comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328848 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2018-03-29 23:32:54 +00:00
parent 980826ee1c
commit 9f3889b501
13 changed files with 100 additions and 100 deletions

View File

@ -444,13 +444,13 @@ public:
void printOffset(int64_t Offset, raw_ostream &OS) const; void printOffset(int64_t Offset, raw_ostream &OS) const;
/// Emit a byte directive and value. /// Emit a byte directive and value.
void EmitInt8(int Value) const; void emitInt8(int Value) const;
/// Emit a short directive and value. /// Emit a short directive and value.
void EmitInt16(int Value) const; void emitInt16(int Value) const;
/// Emit a long directive and value. /// Emit a long directive and value.
void EmitInt32(int Value) const; void emitInt32(int Value) const;
/// Emit something like ".long Hi-Lo" where the size in bytes of the directive /// 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 /// is specified by Size and Hi/Lo specify the labels. This implicitly uses

View File

@ -187,7 +187,7 @@ void AccelTableEmitter::emitHashes() const {
if (SkipIdenticalHashes && PrevHash == HashValue) if (SkipIdenticalHashes && PrevHash == HashValue)
continue; continue;
Asm->OutStreamer->AddComment("Hash in Bucket " + Twine(BucketIdx)); Asm->OutStreamer->AddComment("Hash in Bucket " + Twine(BucketIdx));
Asm->EmitInt32(HashValue); Asm->emitInt32(HashValue);
PrevHash = HashValue; PrevHash = HashValue;
} }
BucketIdx++; BucketIdx++;
@ -211,30 +211,30 @@ void AccelTableEmitter::emitOffsets(const MCSymbol *Base) const {
void AppleAccelTableEmitter::Header::emit(AsmPrinter *Asm) const { void AppleAccelTableEmitter::Header::emit(AsmPrinter *Asm) const {
Asm->OutStreamer->AddComment("Header Magic"); Asm->OutStreamer->AddComment("Header Magic");
Asm->EmitInt32(Magic); Asm->emitInt32(Magic);
Asm->OutStreamer->AddComment("Header Version"); Asm->OutStreamer->AddComment("Header Version");
Asm->EmitInt16(Version); Asm->emitInt16(Version);
Asm->OutStreamer->AddComment("Header Hash Function"); Asm->OutStreamer->AddComment("Header Hash Function");
Asm->EmitInt16(HashFunction); Asm->emitInt16(HashFunction);
Asm->OutStreamer->AddComment("Header Bucket Count"); Asm->OutStreamer->AddComment("Header Bucket Count");
Asm->EmitInt32(BucketCount); Asm->emitInt32(BucketCount);
Asm->OutStreamer->AddComment("Header Hash Count"); Asm->OutStreamer->AddComment("Header Hash Count");
Asm->EmitInt32(HashCount); Asm->emitInt32(HashCount);
Asm->OutStreamer->AddComment("Header Data Length"); Asm->OutStreamer->AddComment("Header Data Length");
Asm->EmitInt32(HeaderDataLength); Asm->emitInt32(HeaderDataLength);
} }
void AppleAccelTableEmitter::HeaderData::emit(AsmPrinter *Asm) const { void AppleAccelTableEmitter::HeaderData::emit(AsmPrinter *Asm) const {
Asm->OutStreamer->AddComment("HeaderData Die Offset Base"); Asm->OutStreamer->AddComment("HeaderData Die Offset Base");
Asm->EmitInt32(DieOffsetBase); Asm->emitInt32(DieOffsetBase);
Asm->OutStreamer->AddComment("HeaderData Atom Count"); Asm->OutStreamer->AddComment("HeaderData Atom Count");
Asm->EmitInt32(Atoms.size()); Asm->emitInt32(Atoms.size());
for (const Atom &A : Atoms) { for (const Atom &A : Atoms) {
Asm->OutStreamer->AddComment(dwarf::AtomTypeString(A.Type)); Asm->OutStreamer->AddComment(dwarf::AtomTypeString(A.Type));
Asm->EmitInt16(A.Type); Asm->emitInt16(A.Type);
Asm->OutStreamer->AddComment(dwarf::FormEncodingString(A.Form)); Asm->OutStreamer->AddComment(dwarf::FormEncodingString(A.Form));
Asm->EmitInt16(A.Form); Asm->emitInt16(A.Form);
} }
} }
@ -244,9 +244,9 @@ void AppleAccelTableEmitter::emitBuckets() const {
for (size_t i = 0, e = Buckets.size(); i < e; ++i) { for (size_t i = 0, e = Buckets.size(); i < e; ++i) {
Asm->OutStreamer->AddComment("Bucket " + Twine(i)); Asm->OutStreamer->AddComment("Bucket " + Twine(i));
if (!Buckets[i].empty()) if (!Buckets[i].empty())
Asm->EmitInt32(index); Asm->emitInt32(index);
else else
Asm->EmitInt32(std::numeric_limits<uint32_t>::max()); Asm->emitInt32(std::numeric_limits<uint32_t>::max());
// Buckets point in the list of hashes, not to the data. Do not increment // Buckets point in the list of hashes, not to the data. Do not increment
// the index multiple times in case of hash collisions. // the index multiple times in case of hash collisions.
uint64_t PrevHash = std::numeric_limits<uint64_t>::max(); uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
@ -268,20 +268,20 @@ void AppleAccelTableEmitter::emitData() const {
// current one. // current one.
if (PrevHash != std::numeric_limits<uint64_t>::max() && if (PrevHash != std::numeric_limits<uint64_t>::max() &&
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");
Asm->EmitInt32(Hash->Values.size()); Asm->emitInt32(Hash->Values.size());
for (const auto *V : Hash->Values) for (const auto *V : Hash->Values)
static_cast<const AppleAccelTableData *>(V)->emit(Asm); static_cast<const AppleAccelTableData *>(V)->emit(Asm);
PrevHash = Hash->HashValue; PrevHash = Hash->HashValue;
} }
// Emit the final end marker for the bucket. // Emit the final end marker for the bucket.
if (!Buckets[i].empty()) if (!Buckets[i].empty())
Asm->EmitInt32(0); Asm->emitInt32(0);
} }
} }
@ -302,25 +302,25 @@ void llvm::emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
} }
void AppleAccelTableOffsetData::emit(AsmPrinter *Asm) const { void AppleAccelTableOffsetData::emit(AsmPrinter *Asm) const {
Asm->EmitInt32(Die->getDebugSectionOffset()); Asm->emitInt32(Die->getDebugSectionOffset());
} }
void AppleAccelTableTypeData::emit(AsmPrinter *Asm) const { void AppleAccelTableTypeData::emit(AsmPrinter *Asm) const {
Asm->EmitInt32(Die->getDebugSectionOffset()); Asm->emitInt32(Die->getDebugSectionOffset());
Asm->EmitInt16(Die->getTag()); Asm->emitInt16(Die->getTag());
Asm->EmitInt8(0); Asm->emitInt8(0);
} }
void AppleAccelTableStaticOffsetData::emit(AsmPrinter *Asm) const { void AppleAccelTableStaticOffsetData::emit(AsmPrinter *Asm) const {
Asm->EmitInt32(Offset); Asm->emitInt32(Offset);
} }
void AppleAccelTableStaticTypeData::emit(AsmPrinter *Asm) const { void AppleAccelTableStaticTypeData::emit(AsmPrinter *Asm) const {
Asm->EmitInt32(Offset); Asm->emitInt32(Offset);
Asm->EmitInt16(Tag); Asm->emitInt16(Tag);
Asm->EmitInt8(ObjCClassIsImplementation ? dwarf::DW_FLAG_type_implementation Asm->emitInt8(ObjCClassIsImplementation ? dwarf::DW_FLAG_type_implementation
: 0); : 0);
Asm->EmitInt32(QualifiedNameHash); Asm->emitInt32(QualifiedNameHash);
} }
#ifndef _MSC_VER #ifndef _MSC_VER

View File

@ -1902,19 +1902,19 @@ void AsmPrinter::EmitModuleIdents(Module &M) {
// Emission and print routines // Emission and print routines
// //
/// EmitInt8 - Emit a byte directive and value. /// Emit a byte directive and value.
/// ///
void AsmPrinter::EmitInt8(int Value) const { void AsmPrinter::emitInt8(int Value) const {
OutStreamer->EmitIntValue(Value, 1); OutStreamer->EmitIntValue(Value, 1);
} }
/// EmitInt16 - Emit a short directive and value. /// Emit a short directive and value.
void AsmPrinter::EmitInt16(int Value) const { void AsmPrinter::emitInt16(int Value) const {
OutStreamer->EmitIntValue(Value, 2); OutStreamer->EmitIntValue(Value, 2);
} }
/// EmitInt32 - Emit a long directive and value. /// Emit a long directive and value.
void AsmPrinter::EmitInt32(int Value) const { void AsmPrinter::emitInt32(int Value) const {
OutStreamer->EmitIntValue(Value, 4); OutStreamer->EmitIntValue(Value, 4);
} }

View File

@ -176,7 +176,7 @@ void AsmPrinter::emitDwarfStringOffset(DwarfStringPoolEntry S) const {
} }
// Just emit the offset directly; no need for symbol math. // Just emit the offset directly; no need for symbol math.
EmitInt32(S.Offset); emitInt32(S.Offset);
} }
void AsmPrinter::EmitDwarfOffset(const MCSymbol *Label, uint64_t Offset) const { void AsmPrinter::EmitDwarfOffset(const MCSymbol *Label, uint64_t Offset) const {
@ -258,7 +258,7 @@ void AsmPrinter::emitDwarfDIE(const DIE &Die) const {
emitDwarfDIE(Child); emitDwarfDIE(Child);
OutStreamer->AddComment("End Of Children Mark"); OutStreamer->AddComment("End Of Children Mark");
EmitInt8(0); emitInt8(0);
} }
} }

View File

@ -43,7 +43,7 @@ public:
APByteStreamer(AsmPrinter &Asm) : AP(Asm) {} APByteStreamer(AsmPrinter &Asm) : AP(Asm) {}
void EmitInt8(uint8_t Byte, const Twine &Comment) override { void EmitInt8(uint8_t Byte, const Twine &Comment) override {
AP.OutStreamer->AddComment(Comment); AP.OutStreamer->AddComment(Comment);
AP.EmitInt8(Byte); 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.OutStreamer->AddComment(Comment);

View File

@ -584,8 +584,8 @@ void DIEString::print(raw_ostream &O) const {
void DIEInlineString::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const { void DIEInlineString::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
if (Form == dwarf::DW_FORM_string) { if (Form == dwarf::DW_FORM_string) {
for (char ch : S) for (char ch : S)
AP->EmitInt8(ch); AP->emitInt8(ch);
AP->EmitInt8(0); AP->emitInt8(0);
return; return;
} }
llvm_unreachable("Expected valid string form"); llvm_unreachable("Expected valid string form");
@ -691,9 +691,9 @@ unsigned DIELoc::ComputeSize(const AsmPrinter *AP) const {
void DIELoc::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const { void DIELoc::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const {
switch (Form) { switch (Form) {
default: llvm_unreachable("Improper form for block"); default: llvm_unreachable("Improper form for block");
case dwarf::DW_FORM_block1: Asm->EmitInt8(Size); break; case dwarf::DW_FORM_block1: Asm->emitInt8(Size); break;
case dwarf::DW_FORM_block2: Asm->EmitInt16(Size); break; case dwarf::DW_FORM_block2: Asm->emitInt16(Size); break;
case dwarf::DW_FORM_block4: Asm->EmitInt32(Size); break; case dwarf::DW_FORM_block4: Asm->emitInt32(Size); break;
case dwarf::DW_FORM_block: case dwarf::DW_FORM_block:
case dwarf::DW_FORM_exprloc: case dwarf::DW_FORM_exprloc:
Asm->EmitULEB128(Size); break; Asm->EmitULEB128(Size); break;
@ -742,9 +742,9 @@ unsigned DIEBlock::ComputeSize(const AsmPrinter *AP) const {
void DIEBlock::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const { void DIEBlock::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const {
switch (Form) { switch (Form) {
default: llvm_unreachable("Improper form for block"); default: llvm_unreachable("Improper form for block");
case dwarf::DW_FORM_block1: Asm->EmitInt8(Size); break; case dwarf::DW_FORM_block1: Asm->emitInt8(Size); break;
case dwarf::DW_FORM_block2: Asm->EmitInt16(Size); break; case dwarf::DW_FORM_block2: Asm->emitInt16(Size); break;
case dwarf::DW_FORM_block4: Asm->EmitInt32(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_data16: break; case dwarf::DW_FORM_data16: break;
} }

View File

@ -1593,13 +1593,13 @@ void DwarfDebug::emitDebugPubSection(bool GnuStyle, StringRef Name,
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);
Asm->OutStreamer->AddComment("Offset of Compilation Unit Info"); Asm->OutStreamer->AddComment("Offset of Compilation Unit Info");
emitSectionReference(*TheU); emitSectionReference(*TheU);
Asm->OutStreamer->AddComment("Compilation Unit Length"); Asm->OutStreamer->AddComment("Compilation Unit Length");
Asm->EmitInt32(TheU->getLength()); Asm->emitInt32(TheU->getLength());
// Emit the pubnames for this compilation unit. // Emit the pubnames for this compilation unit.
for (const auto &GI : Globals) { for (const auto &GI : Globals) {
@ -1607,14 +1607,14 @@ void DwarfDebug::emitDebugPubSection(bool GnuStyle, StringRef Name,
const DIE *Entity = GI.second; const DIE *Entity = GI.second;
Asm->OutStreamer->AddComment("DIE offset"); Asm->OutStreamer->AddComment("DIE offset");
Asm->EmitInt32(Entity->getOffset()); Asm->emitInt32(Entity->getOffset());
if (GnuStyle) { if (GnuStyle) {
dwarf::PubIndexEntryDescriptor Desc = computeIndexValue(TheU, Entity); dwarf::PubIndexEntryDescriptor Desc = computeIndexValue(TheU, Entity);
Asm->OutStreamer->AddComment( Asm->OutStreamer->AddComment(
Twine("Kind: ") + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " + Twine("Kind: ") + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " +
dwarf::GDBIndexEntryLinkageString(Desc.Linkage)); dwarf::GDBIndexEntryLinkageString(Desc.Linkage));
Asm->EmitInt8(Desc.toBits()); Asm->emitInt8(Desc.toBits());
} }
Asm->OutStreamer->AddComment("External Name"); Asm->OutStreamer->AddComment("External Name");
@ -1622,7 +1622,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);
} }
@ -1705,7 +1705,7 @@ void DebugLocEntry::finalize(const AsmPrinter &AP,
void DwarfDebug::emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry) { void DwarfDebug::emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry) {
// Emit the size. // Emit the size.
Asm->OutStreamer->AddComment("Loc expr size"); Asm->OutStreamer->AddComment("Loc expr size");
Asm->EmitInt16(DebugLocs.getBytes(Entry).size()); Asm->emitInt16(DebugLocs.getBytes(Entry).size());
// Emit the entry. // Emit the entry.
APByteStreamer Streamer(*Asm); APByteStreamer Streamer(*Asm);
@ -1753,14 +1753,14 @@ void DwarfDebug::emitDebugLocDWO() {
// rather than two. We could get fancier and try to, say, reuse an // rather than two. We could get fancier and try to, say, reuse an
// address we know we've emitted elsewhere (the start of the function? // address we know we've emitted elsewhere (the start of the function?
// The start of the CU or CU subrange that encloses this range?) // The start of the CU or CU subrange that encloses this range?)
Asm->EmitInt8(dwarf::DW_LLE_startx_length); Asm->emitInt8(dwarf::DW_LLE_startx_length);
unsigned idx = AddrPool.getIndex(Entry.BeginSym); unsigned idx = AddrPool.getIndex(Entry.BeginSym);
Asm->EmitULEB128(idx); Asm->EmitULEB128(idx);
Asm->EmitLabelDifference(Entry.EndSym, Entry.BeginSym, 4); Asm->EmitLabelDifference(Entry.EndSym, Entry.BeginSym, 4);
emitDebugLocEntryLocation(Entry); emitDebugLocEntryLocation(Entry);
} }
Asm->EmitInt8(dwarf::DW_LLE_end_of_list); Asm->emitInt8(dwarf::DW_LLE_end_of_list);
} }
} }
@ -1891,15 +1891,15 @@ void DwarfDebug::emitDebugARanges() {
// For each compile unit, write the list of spans it covers. // For each compile unit, write the list of spans it covers.
Asm->OutStreamer->AddComment("Length of ARange Set"); Asm->OutStreamer->AddComment("Length of ARange Set");
Asm->EmitInt32(ContentSize); Asm->emitInt32(ContentSize);
Asm->OutStreamer->AddComment("DWARF Arange version number"); Asm->OutStreamer->AddComment("DWARF Arange version number");
Asm->EmitInt16(dwarf::DW_ARANGES_VERSION); Asm->emitInt16(dwarf::DW_ARANGES_VERSION);
Asm->OutStreamer->AddComment("Offset Into Debug Info Section"); Asm->OutStreamer->AddComment("Offset Into Debug Info Section");
emitSectionReference(*CU); emitSectionReference(*CU);
Asm->OutStreamer->AddComment("Address Size (in bytes)"); Asm->OutStreamer->AddComment("Address Size (in bytes)");
Asm->EmitInt8(PtrSize); Asm->emitInt8(PtrSize);
Asm->OutStreamer->AddComment("Segment Size (in bytes)"); Asm->OutStreamer->AddComment("Segment Size (in bytes)");
Asm->EmitInt8(0); Asm->emitInt8(0);
Asm->OutStreamer->emitFill(Padding, 0xff); Asm->OutStreamer->emitFill(Padding, 0xff);
@ -2032,10 +2032,10 @@ void DwarfDebug::emitMacro(DIMacro &M) {
Asm->OutStreamer->EmitBytes(Name); Asm->OutStreamer->EmitBytes(Name);
if (!Value.empty()) { if (!Value.empty()) {
// There should be one space between macro name and macro value. // There should be one space between macro name and macro value.
Asm->EmitInt8(' '); Asm->emitInt8(' ');
Asm->OutStreamer->EmitBytes(Value); Asm->OutStreamer->EmitBytes(Value);
} }
Asm->EmitInt8('\0'); Asm->emitInt8('\0');
} }
void DwarfDebug::emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U) { void DwarfDebug::emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U) {
@ -2068,7 +2068,7 @@ void DwarfDebug::emitDebugMacinfo() {
} }
} }
Asm->OutStreamer->AddComment("End Of Macro List Mark"); Asm->OutStreamer->AddComment("End Of Macro List Mark");
Asm->EmitInt8(0); Asm->emitInt8(0);
} }
// DWARF5 Experimental Separate Dwarf emitters. // DWARF5 Experimental Separate Dwarf emitters.

View File

@ -38,9 +38,9 @@ void DwarfFile::emitStringOffsetsTableHeader(MCSection *Section) {
// table. The header consists of an entry with the contribution's // table. The header consists of an entry with the contribution's
// size (not including the size of the header), the DWARF version and // size (not including the size of the header), the DWARF version and
// 2 bytes of padding. // 2 bytes of padding.
Asm->EmitInt32(StrPool.size() * EntrySize); Asm->emitInt32(StrPool.size() * EntrySize);
Asm->EmitInt16(Asm->getDwarfVersion()); Asm->emitInt16(Asm->getDwarfVersion());
Asm->EmitInt16(0); Asm->emitInt16(0);
// Define the symbol that marks the start of the contribution. It is // Define the symbol that marks the start of the contribution. It is
// 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.

View File

@ -1662,18 +1662,18 @@ DIE *DwarfUnit::getOrCreateStaticMemberDIE(const DIDerivedType *DT) {
void DwarfUnit::emitCommonHeader(bool UseOffsets, dwarf::UnitType UT) { void DwarfUnit::emitCommonHeader(bool UseOffsets, dwarf::UnitType UT) {
// Emit size of content not including length itself // Emit size of content not including length itself
Asm->OutStreamer->AddComment("Length of Unit"); Asm->OutStreamer->AddComment("Length of Unit");
Asm->EmitInt32(getHeaderSize() + getUnitDie().getSize()); Asm->emitInt32(getHeaderSize() + getUnitDie().getSize());
Asm->OutStreamer->AddComment("DWARF version number"); Asm->OutStreamer->AddComment("DWARF version number");
unsigned Version = DD->getDwarfVersion(); unsigned Version = DD->getDwarfVersion();
Asm->EmitInt16(Version); Asm->emitInt16(Version);
// DWARF v5 reorders the address size and adds a unit type. // DWARF v5 reorders the address size and adds a unit type.
if (Version >= 5) { if (Version >= 5) {
Asm->OutStreamer->AddComment("DWARF Unit Type"); Asm->OutStreamer->AddComment("DWARF Unit Type");
Asm->EmitInt8(UT); Asm->emitInt8(UT);
Asm->OutStreamer->AddComment("Address Size (in bytes)"); Asm->OutStreamer->AddComment("Address Size (in bytes)");
Asm->EmitInt8(Asm->MAI->getCodePointerSize()); Asm->emitInt8(Asm->MAI->getCodePointerSize());
} }
// We share one abbreviations table across all units so it's always at the // We share one abbreviations table across all units so it's always at the
@ -1682,14 +1682,14 @@ void DwarfUnit::emitCommonHeader(bool UseOffsets, dwarf::UnitType UT) {
Asm->OutStreamer->AddComment("Offset Into Abbrev. Section"); Asm->OutStreamer->AddComment("Offset Into Abbrev. Section");
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
if (UseOffsets) if (UseOffsets)
Asm->EmitInt32(0); Asm->emitInt32(0);
else else
Asm->emitDwarfSymbolReference( Asm->emitDwarfSymbolReference(
TLOF.getDwarfAbbrevSection()->getBeginSymbol(), false); TLOF.getDwarfAbbrevSection()->getBeginSymbol(), false);
if (Version <= 4) { if (Version <= 4) {
Asm->OutStreamer->AddComment("Address Size (in bytes)"); Asm->OutStreamer->AddComment("Address Size (in bytes)");
Asm->EmitInt8(Asm->MAI->getCodePointerSize()); Asm->emitInt8(Asm->MAI->getCodePointerSize());
} }
} }

View File

@ -77,7 +77,7 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
// Emit PointCount. // Emit PointCount.
OS.AddComment("safe point count"); OS.AddComment("safe point count");
AP.EmitInt16(MD.size()); AP.emitInt16(MD.size());
// And each safe point... // And each safe point...
for (GCFunctionInfo::iterator PI = MD.begin(), PE = MD.end(); PI != PE; for (GCFunctionInfo::iterator PI = MD.begin(), PE = MD.end(); PI != PE;
@ -94,7 +94,7 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
// Emit the stack frame size. // Emit the stack frame size.
OS.AddComment("stack frame size (in words)"); OS.AddComment("stack frame size (in words)");
AP.EmitInt16(MD.getFrameSize() / IntPtrSize); AP.emitInt16(MD.getFrameSize() / IntPtrSize);
// Emit stack arity, i.e. the number of stacked arguments. // Emit stack arity, i.e. the number of stacked arguments.
unsigned RegisteredArgs = IntPtrSize == 4 ? 5 : 6; unsigned RegisteredArgs = IntPtrSize == 4 ? 5 : 6;
@ -102,11 +102,11 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
? MD.getFunction().arg_size() - RegisteredArgs ? MD.getFunction().arg_size() - RegisteredArgs
: 0; : 0;
OS.AddComment("stack arity"); OS.AddComment("stack arity");
AP.EmitInt16(StackArity); AP.emitInt16(StackArity);
// Emit the number of live roots in the function. // Emit the number of live roots in the function.
OS.AddComment("live root count"); OS.AddComment("live root count");
AP.EmitInt16(MD.live_size(PI)); AP.emitInt16(MD.live_size(PI));
// And for each live root... // And for each live root...
for (GCFunctionInfo::live_iterator LI = MD.live_begin(PI), for (GCFunctionInfo::live_iterator LI = MD.live_begin(PI),
@ -114,7 +114,7 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
LI != LE; ++LI) { LI != LE; ++LI) {
// Emit live root's offset within the stack frame. // Emit live root's offset within the stack frame.
OS.AddComment("stack index (offset / wordsize)"); OS.AddComment("stack index (offset / wordsize)");
AP.EmitInt16(LI->StackOffset / IntPtrSize); AP.emitInt16(LI->StackOffset / IntPtrSize);
} }
} }
} }

View File

@ -129,7 +129,7 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
// Very rude! // Very rude!
report_fatal_error(" Too much descriptor for ocaml GC"); report_fatal_error(" Too much descriptor for ocaml GC");
} }
AP.EmitInt16(NumDescriptors); AP.emitInt16(NumDescriptors);
AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3); AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3);
for (GCModuleInfo::FuncInfoVec::iterator I = Info.funcinfo_begin(), for (GCModuleInfo::FuncInfoVec::iterator I = Info.funcinfo_begin(),
@ -166,8 +166,8 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
} }
AP.OutStreamer->EmitSymbolValue(J->Label, IntPtrSize); AP.OutStreamer->EmitSymbolValue(J->Label, IntPtrSize);
AP.EmitInt16(FrameSize); AP.emitInt16(FrameSize);
AP.EmitInt16(LiveCount); AP.emitInt16(LiveCount);
for (GCFunctionInfo::live_iterator K = FI.live_begin(J), for (GCFunctionInfo::live_iterator K = FI.live_begin(J),
KE = FI.live_end(J); KE = FI.live_end(J);
@ -178,7 +178,7 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
"GC root stack offset is outside of fixed stack frame and out " "GC root stack offset is outside of fixed stack frame and out "
"of range for ocaml GC!"); "of range for ocaml GC!");
} }
AP.EmitInt16(K->StackOffset); AP.emitInt16(K->StackOffset);
} }
AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3); AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3);

View File

@ -933,12 +933,12 @@ void DwarfStreamer::emitCompileUnitHeader(CompileUnit &Unit) {
// 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
// account for the length field. // account for the length field.
Asm->EmitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset() - 4); Asm->emitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset() - 4);
Asm->EmitInt16(Version); Asm->emitInt16(Version);
// We share one abbreviations table across all units so it's always at the // We share one abbreviations table across all units so it's always at the
// start of the section. // start of the section.
Asm->EmitInt32(0); Asm->emitInt32(0);
Asm->EmitInt8(Unit.getOrigUnit().getAddressByteSize()); Asm->emitInt8(Unit.getOrigUnit().getAddressByteSize());
} }
/// Emit the \p Abbrevs array as the shared abbreviation table /// Emit the \p Abbrevs array as the shared abbreviation table
@ -967,7 +967,7 @@ void DwarfStreamer::emitStrings(const NonRelocatableStringpool &Pool) {
// Emit the string itself. // Emit the string itself.
Asm->OutStreamer->EmitBytes(Entry.getString()); Asm->OutStreamer->EmitBytes(Entry.getString());
// Emit a null terminator. // Emit a null terminator.
Asm->EmitInt8(0); Asm->emitInt8(0);
} }
} }
@ -1089,10 +1089,10 @@ void DwarfStreamer::emitUnitRangesEntries(CompileUnit &Unit,
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
Asm->EmitInt8(0); // Segment size Asm->emitInt8(0); // Segment size
Asm->OutStreamer->emitFill(Padding, 0x0); Asm->OutStreamer->emitFill(Padding, 0x0);
@ -1375,22 +1375,22 @@ void DwarfStreamer::emitPubSectionForUnit(
// 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
HeaderEmitted = true; HeaderEmitted = true;
} }
Asm->EmitInt32(Name.Die->getOffset()); Asm->emitInt32(Name.Die->getOffset());
// Emit the string itself. // Emit the string itself.
Asm->OutStreamer->EmitBytes(Name.Name.getString()); Asm->OutStreamer->EmitBytes(Name.Name.getString());
// Emit a null terminator. // Emit a null terminator.
Asm->EmitInt8(0); Asm->emitInt8(0);
} }
if (!HeaderEmitted) if (!HeaderEmitted)
return; return;
Asm->EmitInt32(0); // End marker. Asm->emitInt32(0); // End marker.
Asm->OutStreamer->EmitLabel(EndLabel); Asm->OutStreamer->EmitLabel(EndLabel);
} }

View File

@ -231,15 +231,15 @@ StringRef dwarfgen::Generator::generate() {
auto Length = CU->getLength(); auto Length = CU->getLength();
MC->setDwarfVersion(Version); MC->setDwarfVersion(Version);
assert(Length != -1U); assert(Length != -1U);
Asm->EmitInt32(Length); Asm->emitInt32(Length);
Asm->EmitInt16(Version); Asm->emitInt16(Version);
if (Version <= 4) { if (Version <= 4) {
Asm->EmitInt32(0); Asm->emitInt32(0);
Asm->EmitInt8(CU->getAddressSize()); Asm->emitInt8(CU->getAddressSize());
} else { } else {
Asm->EmitInt8(dwarf::DW_UT_compile); Asm->emitInt8(dwarf::DW_UT_compile);
Asm->EmitInt8(CU->getAddressSize()); Asm->emitInt8(CU->getAddressSize());
Asm->EmitInt32(0); Asm->emitInt32(0);
} }
Asm->emitDwarfDIE(*CU->getUnitDIE().Die); Asm->emitDwarfDIE(*CU->getUnitDIE().Die);
} }