mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-16 00:38:58 +00:00
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:
parent
980826ee1c
commit
9f3889b501
@ -444,13 +444,13 @@ public:
|
||||
void printOffset(int64_t Offset, raw_ostream &OS) const;
|
||||
|
||||
/// Emit a byte directive and value.
|
||||
void EmitInt8(int Value) const;
|
||||
void emitInt8(int Value) const;
|
||||
|
||||
/// Emit a short directive and value.
|
||||
void EmitInt16(int Value) const;
|
||||
void emitInt16(int Value) const;
|
||||
|
||||
/// 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
|
||||
/// is specified by Size and Hi/Lo specify the labels. This implicitly uses
|
||||
|
@ -187,7 +187,7 @@ void AccelTableEmitter::emitHashes() const {
|
||||
if (SkipIdenticalHashes && PrevHash == HashValue)
|
||||
continue;
|
||||
Asm->OutStreamer->AddComment("Hash in Bucket " + Twine(BucketIdx));
|
||||
Asm->EmitInt32(HashValue);
|
||||
Asm->emitInt32(HashValue);
|
||||
PrevHash = HashValue;
|
||||
}
|
||||
BucketIdx++;
|
||||
@ -211,30 +211,30 @@ void AccelTableEmitter::emitOffsets(const MCSymbol *Base) const {
|
||||
|
||||
void AppleAccelTableEmitter::Header::emit(AsmPrinter *Asm) const {
|
||||
Asm->OutStreamer->AddComment("Header Magic");
|
||||
Asm->EmitInt32(Magic);
|
||||
Asm->emitInt32(Magic);
|
||||
Asm->OutStreamer->AddComment("Header Version");
|
||||
Asm->EmitInt16(Version);
|
||||
Asm->emitInt16(Version);
|
||||
Asm->OutStreamer->AddComment("Header Hash Function");
|
||||
Asm->EmitInt16(HashFunction);
|
||||
Asm->emitInt16(HashFunction);
|
||||
Asm->OutStreamer->AddComment("Header Bucket Count");
|
||||
Asm->EmitInt32(BucketCount);
|
||||
Asm->emitInt32(BucketCount);
|
||||
Asm->OutStreamer->AddComment("Header Hash Count");
|
||||
Asm->EmitInt32(HashCount);
|
||||
Asm->emitInt32(HashCount);
|
||||
Asm->OutStreamer->AddComment("Header Data Length");
|
||||
Asm->EmitInt32(HeaderDataLength);
|
||||
Asm->emitInt32(HeaderDataLength);
|
||||
}
|
||||
|
||||
void AppleAccelTableEmitter::HeaderData::emit(AsmPrinter *Asm) const {
|
||||
Asm->OutStreamer->AddComment("HeaderData Die Offset Base");
|
||||
Asm->EmitInt32(DieOffsetBase);
|
||||
Asm->emitInt32(DieOffsetBase);
|
||||
Asm->OutStreamer->AddComment("HeaderData Atom Count");
|
||||
Asm->EmitInt32(Atoms.size());
|
||||
Asm->emitInt32(Atoms.size());
|
||||
|
||||
for (const Atom &A : Atoms) {
|
||||
Asm->OutStreamer->AddComment(dwarf::AtomTypeString(A.Type));
|
||||
Asm->EmitInt16(A.Type);
|
||||
Asm->emitInt16(A.Type);
|
||||
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) {
|
||||
Asm->OutStreamer->AddComment("Bucket " + Twine(i));
|
||||
if (!Buckets[i].empty())
|
||||
Asm->EmitInt32(index);
|
||||
Asm->emitInt32(index);
|
||||
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
|
||||
// the index multiple times in case of hash collisions.
|
||||
uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
|
||||
@ -268,20 +268,20 @@ void AppleAccelTableEmitter::emitData() const {
|
||||
// current one.
|
||||
if (PrevHash != std::numeric_limits<uint64_t>::max() &&
|
||||
PrevHash != Hash->HashValue)
|
||||
Asm->EmitInt32(0);
|
||||
Asm->emitInt32(0);
|
||||
// Remember to emit the label for our offset.
|
||||
Asm->OutStreamer->EmitLabel(Hash->Sym);
|
||||
Asm->OutStreamer->AddComment(Hash->Name.getString());
|
||||
Asm->emitDwarfStringOffset(Hash->Name);
|
||||
Asm->OutStreamer->AddComment("Num DIEs");
|
||||
Asm->EmitInt32(Hash->Values.size());
|
||||
Asm->emitInt32(Hash->Values.size());
|
||||
for (const auto *V : Hash->Values)
|
||||
static_cast<const AppleAccelTableData *>(V)->emit(Asm);
|
||||
PrevHash = Hash->HashValue;
|
||||
}
|
||||
// Emit the final end marker for the bucket.
|
||||
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 {
|
||||
Asm->EmitInt32(Die->getDebugSectionOffset());
|
||||
Asm->emitInt32(Die->getDebugSectionOffset());
|
||||
}
|
||||
|
||||
void AppleAccelTableTypeData::emit(AsmPrinter *Asm) const {
|
||||
Asm->EmitInt32(Die->getDebugSectionOffset());
|
||||
Asm->EmitInt16(Die->getTag());
|
||||
Asm->EmitInt8(0);
|
||||
Asm->emitInt32(Die->getDebugSectionOffset());
|
||||
Asm->emitInt16(Die->getTag());
|
||||
Asm->emitInt8(0);
|
||||
}
|
||||
|
||||
void AppleAccelTableStaticOffsetData::emit(AsmPrinter *Asm) const {
|
||||
Asm->EmitInt32(Offset);
|
||||
Asm->emitInt32(Offset);
|
||||
}
|
||||
|
||||
void AppleAccelTableStaticTypeData::emit(AsmPrinter *Asm) const {
|
||||
Asm->EmitInt32(Offset);
|
||||
Asm->EmitInt16(Tag);
|
||||
Asm->EmitInt8(ObjCClassIsImplementation ? dwarf::DW_FLAG_type_implementation
|
||||
Asm->emitInt32(Offset);
|
||||
Asm->emitInt16(Tag);
|
||||
Asm->emitInt8(ObjCClassIsImplementation ? dwarf::DW_FLAG_type_implementation
|
||||
: 0);
|
||||
Asm->EmitInt32(QualifiedNameHash);
|
||||
Asm->emitInt32(QualifiedNameHash);
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
|
@ -1902,19 +1902,19 @@ void AsmPrinter::EmitModuleIdents(Module &M) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
/// EmitInt16 - Emit a short directive and value.
|
||||
void AsmPrinter::EmitInt16(int Value) const {
|
||||
/// Emit a short directive and value.
|
||||
void AsmPrinter::emitInt16(int Value) const {
|
||||
OutStreamer->EmitIntValue(Value, 2);
|
||||
}
|
||||
|
||||
/// EmitInt32 - Emit a long directive and value.
|
||||
void AsmPrinter::EmitInt32(int Value) const {
|
||||
/// Emit a long directive and value.
|
||||
void AsmPrinter::emitInt32(int Value) const {
|
||||
OutStreamer->EmitIntValue(Value, 4);
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ void AsmPrinter::emitDwarfStringOffset(DwarfStringPoolEntry S) const {
|
||||
}
|
||||
|
||||
// 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 {
|
||||
@ -258,7 +258,7 @@ void AsmPrinter::emitDwarfDIE(const DIE &Die) const {
|
||||
emitDwarfDIE(Child);
|
||||
|
||||
OutStreamer->AddComment("End Of Children Mark");
|
||||
EmitInt8(0);
|
||||
emitInt8(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
APByteStreamer(AsmPrinter &Asm) : AP(Asm) {}
|
||||
void EmitInt8(uint8_t Byte, const Twine &Comment) override {
|
||||
AP.OutStreamer->AddComment(Comment);
|
||||
AP.EmitInt8(Byte);
|
||||
AP.emitInt8(Byte);
|
||||
}
|
||||
void EmitSLEB128(uint64_t DWord, const Twine &Comment) override {
|
||||
AP.OutStreamer->AddComment(Comment);
|
||||
|
@ -584,8 +584,8 @@ void DIEString::print(raw_ostream &O) const {
|
||||
void DIEInlineString::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
|
||||
if (Form == dwarf::DW_FORM_string) {
|
||||
for (char ch : S)
|
||||
AP->EmitInt8(ch);
|
||||
AP->EmitInt8(0);
|
||||
AP->emitInt8(ch);
|
||||
AP->emitInt8(0);
|
||||
return;
|
||||
}
|
||||
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 {
|
||||
switch (Form) {
|
||||
default: llvm_unreachable("Improper form for block");
|
||||
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_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:
|
||||
case dwarf::DW_FORM_exprloc:
|
||||
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 {
|
||||
switch (Form) {
|
||||
default: llvm_unreachable("Improper form for block");
|
||||
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_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_data16: break;
|
||||
}
|
||||
|
@ -1593,13 +1593,13 @@ void DwarfDebug::emitDebugPubSection(bool GnuStyle, StringRef Name,
|
||||
Asm->OutStreamer->EmitLabel(BeginLabel);
|
||||
|
||||
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");
|
||||
emitSectionReference(*TheU);
|
||||
|
||||
Asm->OutStreamer->AddComment("Compilation Unit Length");
|
||||
Asm->EmitInt32(TheU->getLength());
|
||||
Asm->emitInt32(TheU->getLength());
|
||||
|
||||
// Emit the pubnames for this compilation unit.
|
||||
for (const auto &GI : Globals) {
|
||||
@ -1607,14 +1607,14 @@ void DwarfDebug::emitDebugPubSection(bool GnuStyle, StringRef Name,
|
||||
const DIE *Entity = GI.second;
|
||||
|
||||
Asm->OutStreamer->AddComment("DIE offset");
|
||||
Asm->EmitInt32(Entity->getOffset());
|
||||
Asm->emitInt32(Entity->getOffset());
|
||||
|
||||
if (GnuStyle) {
|
||||
dwarf::PubIndexEntryDescriptor Desc = computeIndexValue(TheU, Entity);
|
||||
Asm->OutStreamer->AddComment(
|
||||
Twine("Kind: ") + dwarf::GDBIndexEntryKindString(Desc.Kind) + ", " +
|
||||
dwarf::GDBIndexEntryLinkageString(Desc.Linkage));
|
||||
Asm->EmitInt8(Desc.toBits());
|
||||
Asm->emitInt8(Desc.toBits());
|
||||
}
|
||||
|
||||
Asm->OutStreamer->AddComment("External Name");
|
||||
@ -1622,7 +1622,7 @@ void DwarfDebug::emitDebugPubSection(bool GnuStyle, StringRef Name,
|
||||
}
|
||||
|
||||
Asm->OutStreamer->AddComment("End Mark");
|
||||
Asm->EmitInt32(0);
|
||||
Asm->emitInt32(0);
|
||||
Asm->OutStreamer->EmitLabel(EndLabel);
|
||||
}
|
||||
|
||||
@ -1705,7 +1705,7 @@ void DebugLocEntry::finalize(const AsmPrinter &AP,
|
||||
void DwarfDebug::emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry) {
|
||||
// Emit the size.
|
||||
Asm->OutStreamer->AddComment("Loc expr size");
|
||||
Asm->EmitInt16(DebugLocs.getBytes(Entry).size());
|
||||
Asm->emitInt16(DebugLocs.getBytes(Entry).size());
|
||||
|
||||
// Emit the entry.
|
||||
APByteStreamer Streamer(*Asm);
|
||||
@ -1753,14 +1753,14 @@ void DwarfDebug::emitDebugLocDWO() {
|
||||
// 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?
|
||||
// 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);
|
||||
Asm->EmitULEB128(idx);
|
||||
Asm->EmitLabelDifference(Entry.EndSym, Entry.BeginSym, 4);
|
||||
|
||||
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.
|
||||
Asm->OutStreamer->AddComment("Length of ARange Set");
|
||||
Asm->EmitInt32(ContentSize);
|
||||
Asm->emitInt32(ContentSize);
|
||||
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");
|
||||
emitSectionReference(*CU);
|
||||
Asm->OutStreamer->AddComment("Address Size (in bytes)");
|
||||
Asm->EmitInt8(PtrSize);
|
||||
Asm->emitInt8(PtrSize);
|
||||
Asm->OutStreamer->AddComment("Segment Size (in bytes)");
|
||||
Asm->EmitInt8(0);
|
||||
Asm->emitInt8(0);
|
||||
|
||||
Asm->OutStreamer->emitFill(Padding, 0xff);
|
||||
|
||||
@ -2032,10 +2032,10 @@ void DwarfDebug::emitMacro(DIMacro &M) {
|
||||
Asm->OutStreamer->EmitBytes(Name);
|
||||
if (!Value.empty()) {
|
||||
// There should be one space between macro name and macro value.
|
||||
Asm->EmitInt8(' ');
|
||||
Asm->emitInt8(' ');
|
||||
Asm->OutStreamer->EmitBytes(Value);
|
||||
}
|
||||
Asm->EmitInt8('\0');
|
||||
Asm->emitInt8('\0');
|
||||
}
|
||||
|
||||
void DwarfDebug::emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U) {
|
||||
@ -2068,7 +2068,7 @@ void DwarfDebug::emitDebugMacinfo() {
|
||||
}
|
||||
}
|
||||
Asm->OutStreamer->AddComment("End Of Macro List Mark");
|
||||
Asm->EmitInt8(0);
|
||||
Asm->emitInt8(0);
|
||||
}
|
||||
|
||||
// DWARF5 Experimental Separate Dwarf emitters.
|
||||
|
@ -38,9 +38,9 @@ void DwarfFile::emitStringOffsetsTableHeader(MCSection *Section) {
|
||||
// table. The header consists of an entry with the contribution's
|
||||
// size (not including the size of the header), the DWARF version and
|
||||
// 2 bytes of padding.
|
||||
Asm->EmitInt32(StrPool.size() * EntrySize);
|
||||
Asm->EmitInt16(Asm->getDwarfVersion());
|
||||
Asm->EmitInt16(0);
|
||||
Asm->emitInt32(StrPool.size() * EntrySize);
|
||||
Asm->emitInt16(Asm->getDwarfVersion());
|
||||
Asm->emitInt16(0);
|
||||
// Define the symbol that marks the start of the contribution. It is
|
||||
// referenced by most unit headers via DW_AT_str_offsets_base.
|
||||
// Split units do not use the attribute.
|
||||
|
@ -1662,18 +1662,18 @@ DIE *DwarfUnit::getOrCreateStaticMemberDIE(const DIDerivedType *DT) {
|
||||
void DwarfUnit::emitCommonHeader(bool UseOffsets, dwarf::UnitType UT) {
|
||||
// Emit size of content not including length itself
|
||||
Asm->OutStreamer->AddComment("Length of Unit");
|
||||
Asm->EmitInt32(getHeaderSize() + getUnitDie().getSize());
|
||||
Asm->emitInt32(getHeaderSize() + getUnitDie().getSize());
|
||||
|
||||
Asm->OutStreamer->AddComment("DWARF version number");
|
||||
unsigned Version = DD->getDwarfVersion();
|
||||
Asm->EmitInt16(Version);
|
||||
Asm->emitInt16(Version);
|
||||
|
||||
// DWARF v5 reorders the address size and adds a unit type.
|
||||
if (Version >= 5) {
|
||||
Asm->OutStreamer->AddComment("DWARF Unit Type");
|
||||
Asm->EmitInt8(UT);
|
||||
Asm->emitInt8(UT);
|
||||
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
|
||||
@ -1682,14 +1682,14 @@ void DwarfUnit::emitCommonHeader(bool UseOffsets, dwarf::UnitType UT) {
|
||||
Asm->OutStreamer->AddComment("Offset Into Abbrev. Section");
|
||||
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
||||
if (UseOffsets)
|
||||
Asm->EmitInt32(0);
|
||||
Asm->emitInt32(0);
|
||||
else
|
||||
Asm->emitDwarfSymbolReference(
|
||||
TLOF.getDwarfAbbrevSection()->getBeginSymbol(), false);
|
||||
|
||||
if (Version <= 4) {
|
||||
Asm->OutStreamer->AddComment("Address Size (in bytes)");
|
||||
Asm->EmitInt8(Asm->MAI->getCodePointerSize());
|
||||
Asm->emitInt8(Asm->MAI->getCodePointerSize());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
|
||||
|
||||
// Emit PointCount.
|
||||
OS.AddComment("safe point count");
|
||||
AP.EmitInt16(MD.size());
|
||||
AP.emitInt16(MD.size());
|
||||
|
||||
// And each safe point...
|
||||
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.
|
||||
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.
|
||||
unsigned RegisteredArgs = IntPtrSize == 4 ? 5 : 6;
|
||||
@ -102,11 +102,11 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
|
||||
? MD.getFunction().arg_size() - RegisteredArgs
|
||||
: 0;
|
||||
OS.AddComment("stack arity");
|
||||
AP.EmitInt16(StackArity);
|
||||
AP.emitInt16(StackArity);
|
||||
|
||||
// Emit the number of live roots in the function.
|
||||
OS.AddComment("live root count");
|
||||
AP.EmitInt16(MD.live_size(PI));
|
||||
AP.emitInt16(MD.live_size(PI));
|
||||
|
||||
// And for each live root...
|
||||
for (GCFunctionInfo::live_iterator LI = MD.live_begin(PI),
|
||||
@ -114,7 +114,7 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
|
||||
LI != LE; ++LI) {
|
||||
// Emit live root's offset within the stack frame.
|
||||
OS.AddComment("stack index (offset / wordsize)");
|
||||
AP.EmitInt16(LI->StackOffset / IntPtrSize);
|
||||
AP.emitInt16(LI->StackOffset / IntPtrSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
|
||||
// Very rude!
|
||||
report_fatal_error(" Too much descriptor for ocaml GC");
|
||||
}
|
||||
AP.EmitInt16(NumDescriptors);
|
||||
AP.emitInt16(NumDescriptors);
|
||||
AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3);
|
||||
|
||||
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.EmitInt16(FrameSize);
|
||||
AP.EmitInt16(LiveCount);
|
||||
AP.emitInt16(FrameSize);
|
||||
AP.emitInt16(LiveCount);
|
||||
|
||||
for (GCFunctionInfo::live_iterator K = FI.live_begin(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 "
|
||||
"of range for ocaml GC!");
|
||||
}
|
||||
AP.EmitInt16(K->StackOffset);
|
||||
AP.emitInt16(K->StackOffset);
|
||||
}
|
||||
|
||||
AP.EmitAlignment(IntPtrSize == 4 ? 2 : 3);
|
||||
|
@ -933,12 +933,12 @@ void DwarfStreamer::emitCompileUnitHeader(CompileUnit &Unit) {
|
||||
// Emit size of content not including length itself. The size has already
|
||||
// been computed in CompileUnit::computeOffsets(). Subtract 4 to that size to
|
||||
// account for the length field.
|
||||
Asm->EmitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset() - 4);
|
||||
Asm->EmitInt16(Version);
|
||||
Asm->emitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset() - 4);
|
||||
Asm->emitInt16(Version);
|
||||
// We share one abbreviations table across all units so it's always at the
|
||||
// start of the section.
|
||||
Asm->EmitInt32(0);
|
||||
Asm->EmitInt8(Unit.getOrigUnit().getAddressByteSize());
|
||||
Asm->emitInt32(0);
|
||||
Asm->emitInt8(Unit.getOrigUnit().getAddressByteSize());
|
||||
}
|
||||
|
||||
/// Emit the \p Abbrevs array as the shared abbreviation table
|
||||
@ -967,7 +967,7 @@ void DwarfStreamer::emitStrings(const NonRelocatableStringpool &Pool) {
|
||||
// Emit the string itself.
|
||||
Asm->OutStreamer->EmitBytes(Entry.getString());
|
||||
// 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->OutStreamer->EmitLabel(BeginLabel);
|
||||
Asm->EmitInt16(dwarf::DW_ARANGES_VERSION); // Version number
|
||||
Asm->EmitInt32(Unit.getStartOffset()); // Corresponding unit's offset
|
||||
Asm->EmitInt8(AddressSize); // Address size
|
||||
Asm->EmitInt8(0); // Segment size
|
||||
Asm->emitInt16(dwarf::DW_ARANGES_VERSION); // Version number
|
||||
Asm->emitInt32(Unit.getStartOffset()); // Corresponding unit's offset
|
||||
Asm->emitInt8(AddressSize); // Address size
|
||||
Asm->emitInt8(0); // Segment size
|
||||
|
||||
Asm->OutStreamer->emitFill(Padding, 0x0);
|
||||
|
||||
@ -1375,22 +1375,22 @@ void DwarfStreamer::emitPubSectionForUnit(
|
||||
// Emit the header.
|
||||
Asm->EmitLabelDifference(EndLabel, BeginLabel, 4); // Length
|
||||
Asm->OutStreamer->EmitLabel(BeginLabel);
|
||||
Asm->EmitInt16(dwarf::DW_PUBNAMES_VERSION); // Version
|
||||
Asm->EmitInt32(Unit.getStartOffset()); // Unit offset
|
||||
Asm->EmitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset()); // Size
|
||||
Asm->emitInt16(dwarf::DW_PUBNAMES_VERSION); // Version
|
||||
Asm->emitInt32(Unit.getStartOffset()); // Unit offset
|
||||
Asm->emitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset()); // Size
|
||||
HeaderEmitted = true;
|
||||
}
|
||||
Asm->EmitInt32(Name.Die->getOffset());
|
||||
Asm->emitInt32(Name.Die->getOffset());
|
||||
|
||||
// Emit the string itself.
|
||||
Asm->OutStreamer->EmitBytes(Name.Name.getString());
|
||||
// Emit a null terminator.
|
||||
Asm->EmitInt8(0);
|
||||
Asm->emitInt8(0);
|
||||
}
|
||||
|
||||
if (!HeaderEmitted)
|
||||
return;
|
||||
Asm->EmitInt32(0); // End marker.
|
||||
Asm->emitInt32(0); // End marker.
|
||||
Asm->OutStreamer->EmitLabel(EndLabel);
|
||||
}
|
||||
|
||||
|
@ -231,15 +231,15 @@ StringRef dwarfgen::Generator::generate() {
|
||||
auto Length = CU->getLength();
|
||||
MC->setDwarfVersion(Version);
|
||||
assert(Length != -1U);
|
||||
Asm->EmitInt32(Length);
|
||||
Asm->EmitInt16(Version);
|
||||
Asm->emitInt32(Length);
|
||||
Asm->emitInt16(Version);
|
||||
if (Version <= 4) {
|
||||
Asm->EmitInt32(0);
|
||||
Asm->EmitInt8(CU->getAddressSize());
|
||||
Asm->emitInt32(0);
|
||||
Asm->emitInt8(CU->getAddressSize());
|
||||
} else {
|
||||
Asm->EmitInt8(dwarf::DW_UT_compile);
|
||||
Asm->EmitInt8(CU->getAddressSize());
|
||||
Asm->EmitInt32(0);
|
||||
Asm->emitInt8(dwarf::DW_UT_compile);
|
||||
Asm->emitInt8(CU->getAddressSize());
|
||||
Asm->emitInt32(0);
|
||||
}
|
||||
Asm->emitDwarfDIE(*CU->getUnitDIE().Die);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user