@@ -89,7 +89,7 @@ void AccelTableBase::finalize(AsmPrinter *Asm, StringRef Prefix) {
8989namespace {
9090// / Base class for writing out Accelerator tables. It holds the common
9191// / functionality for the two Accelerator table types.
92- class AccelTableEmitter {
92+ class AccelTableWriter {
9393protected:
9494 AsmPrinter *const Asm; // /< Destination.
9595 const AccelTableBase &Contents; // /< Data to emit.
@@ -106,13 +106,13 @@ class AccelTableEmitter {
106106 void emitOffsets (const MCSymbol *Base) const ;
107107
108108public:
109- AccelTableEmitter (AsmPrinter *Asm, const AccelTableBase &Contents,
110- bool SkipIdenticalHashes)
109+ AccelTableWriter (AsmPrinter *Asm, const AccelTableBase &Contents,
110+ bool SkipIdenticalHashes)
111111 : Asm(Asm), Contents(Contents), SkipIdenticalHashes(SkipIdenticalHashes) {
112112 }
113113};
114114
115- class AppleAccelTableEmitter : public AccelTableEmitter {
115+ class AppleAccelTableWriter : public AccelTableWriter {
116116 using Atom = AppleAccelTableData::Atom;
117117
118118 // / The fixed header of an Apple Accelerator Table.
@@ -165,9 +165,9 @@ class AppleAccelTableEmitter : public AccelTableEmitter {
165165 void emitData () const ;
166166
167167public:
168- AppleAccelTableEmitter (AsmPrinter *Asm, const AccelTableBase &Contents,
169- ArrayRef<Atom> Atoms, const MCSymbol *SecBegin)
170- : AccelTableEmitter (Asm, Contents, true ),
168+ AppleAccelTableWriter (AsmPrinter *Asm, const AccelTableBase &Contents,
169+ ArrayRef<Atom> Atoms, const MCSymbol *SecBegin)
170+ : AccelTableWriter (Asm, Contents, true ),
171171 Header(Contents.getBucketCount(), Contents.getUniqueHashCount(),
172172 8 + (Atoms.size() * 4)),
173173 HeaderData(Atoms), SecBegin(SecBegin) {}
@@ -182,7 +182,7 @@ class AppleAccelTableEmitter : public AccelTableEmitter {
182182
183183// / Class responsible for emitting a DWARF v5 Accelerator Table. The only public
184184// / function is emit(), which performs the actual emission.
185- class Dwarf5AccelTableEmitter : public AccelTableEmitter {
185+ class Dwarf5AccelTableWriter : public AccelTableWriter {
186186 struct Header {
187187 uint32_t UnitLength = 0 ;
188188 uint16_t Version = 5 ;
@@ -200,7 +200,7 @@ class Dwarf5AccelTableEmitter : public AccelTableEmitter {
200200 : CompUnitCount(CompUnitCount), BucketCount(BucketCount),
201201 NameCount (NameCount) {}
202202
203- void emit (const Dwarf5AccelTableEmitter &Ctx) const ;
203+ void emit (const Dwarf5AccelTableWriter &Ctx) const ;
204204 };
205205 struct AttributeEncoding {
206206 dwarf::Index Index;
@@ -230,15 +230,15 @@ class Dwarf5AccelTableEmitter : public AccelTableEmitter {
230230 void emitData () const ;
231231
232232public:
233- Dwarf5AccelTableEmitter (
234- AsmPrinter *Asm, const AccelTableBase &Contents, const DwarfDebug &DD,
235- ArrayRef<std::unique_ptr<DwarfCompileUnit>> CompUnits);
233+ Dwarf5AccelTableWriter (AsmPrinter *Asm, const AccelTableBase &Contents,
234+ const DwarfDebug &DD,
235+ ArrayRef<std::unique_ptr<DwarfCompileUnit>> CompUnits);
236236
237237 void emit () const ;
238238};
239239} // namespace
240240
241- void AccelTableEmitter ::emitHashes () const {
241+ void AccelTableWriter ::emitHashes () const {
242242 uint64_t PrevHash = std::numeric_limits<uint64_t >::max ();
243243 unsigned BucketIdx = 0 ;
244244 for (auto &Bucket : Contents.getBuckets ()) {
@@ -254,7 +254,7 @@ void AccelTableEmitter::emitHashes() const {
254254 }
255255}
256256
257- void AccelTableEmitter ::emitOffsets (const MCSymbol *Base) const {
257+ void AccelTableWriter ::emitOffsets (const MCSymbol *Base) const {
258258 const auto &Buckets = Contents.getBuckets ();
259259 uint64_t PrevHash = std::numeric_limits<uint64_t >::max ();
260260 for (size_t i = 0 , e = Buckets.size (); i < e; ++i) {
@@ -269,7 +269,7 @@ void AccelTableEmitter::emitOffsets(const MCSymbol *Base) const {
269269 }
270270}
271271
272- void AppleAccelTableEmitter ::Header::emit (AsmPrinter *Asm) const {
272+ void AppleAccelTableWriter ::Header::emit (AsmPrinter *Asm) const {
273273 Asm->OutStreamer ->AddComment (" Header Magic" );
274274 Asm->emitInt32 (Magic);
275275 Asm->OutStreamer ->AddComment (" Header Version" );
@@ -284,7 +284,7 @@ void AppleAccelTableEmitter::Header::emit(AsmPrinter *Asm) const {
284284 Asm->emitInt32 (HeaderDataLength);
285285}
286286
287- void AppleAccelTableEmitter ::HeaderData::emit (AsmPrinter *Asm) const {
287+ void AppleAccelTableWriter ::HeaderData::emit (AsmPrinter *Asm) const {
288288 Asm->OutStreamer ->AddComment (" HeaderData Die Offset Base" );
289289 Asm->emitInt32 (DieOffsetBase);
290290 Asm->OutStreamer ->AddComment (" HeaderData Atom Count" );
@@ -298,7 +298,7 @@ void AppleAccelTableEmitter::HeaderData::emit(AsmPrinter *Asm) const {
298298 }
299299}
300300
301- void AppleAccelTableEmitter ::emitBuckets () const {
301+ void AppleAccelTableWriter ::emitBuckets () const {
302302 const auto &Buckets = Contents.getBuckets ();
303303 unsigned index = 0 ;
304304 for (size_t i = 0 , e = Buckets.size (); i < e; ++i) {
@@ -319,7 +319,7 @@ void AppleAccelTableEmitter::emitBuckets() const {
319319 }
320320}
321321
322- void AppleAccelTableEmitter ::emitData () const {
322+ void AppleAccelTableWriter ::emitData () const {
323323 const auto &Buckets = Contents.getBuckets ();
324324 for (size_t i = 0 , e = Buckets.size (); i < e; ++i) {
325325 uint64_t PrevHash = std::numeric_limits<uint64_t >::max ();
@@ -345,7 +345,7 @@ void AppleAccelTableEmitter::emitData() const {
345345 }
346346}
347347
348- void AppleAccelTableEmitter ::emit () const {
348+ void AppleAccelTableWriter ::emit () const {
349349 Header.emit (Asm);
350350 HeaderData.emit (Asm);
351351 emitBuckets ();
@@ -354,8 +354,8 @@ void AppleAccelTableEmitter::emit() const {
354354 emitData ();
355355}
356356
357- void Dwarf5AccelTableEmitter ::Header::emit (
358- const Dwarf5AccelTableEmitter &Ctx) const {
357+ void Dwarf5AccelTableWriter ::Header::emit (
358+ const Dwarf5AccelTableWriter &Ctx) const {
359359 assert (CompUnitCount > 0 && " Index must have at least one CU." );
360360
361361 AsmPrinter *Asm = Ctx.Asm ;
@@ -386,7 +386,7 @@ void Dwarf5AccelTableEmitter::Header::emit(
386386 Asm->OutStreamer ->EmitBytes ({AugmentationString, AugmentationStringSize});
387387}
388388
389- DenseSet<uint32_t > Dwarf5AccelTableEmitter ::getUniqueTags () const {
389+ DenseSet<uint32_t > Dwarf5AccelTableWriter ::getUniqueTags () const {
390390 DenseSet<uint32_t > UniqueTags;
391391 for (auto &Bucket : Contents.getBuckets ()) {
392392 for (auto *Hash : Bucket) {
@@ -400,8 +400,8 @@ DenseSet<uint32_t> Dwarf5AccelTableEmitter::getUniqueTags() const {
400400 return UniqueTags;
401401}
402402
403- SmallVector<Dwarf5AccelTableEmitter ::AttributeEncoding, 2 >
404- Dwarf5AccelTableEmitter ::getUniformAttributes () const {
403+ SmallVector<Dwarf5AccelTableWriter ::AttributeEncoding, 2 >
404+ Dwarf5AccelTableWriter ::getUniformAttributes () const {
405405 SmallVector<AttributeEncoding, 2 > UA;
406406 if (CompUnits.size () > 1 ) {
407407 size_t LargestCUIndex = CompUnits.size () - 1 ;
@@ -412,7 +412,7 @@ Dwarf5AccelTableEmitter::getUniformAttributes() const {
412412 return UA;
413413}
414414
415- void Dwarf5AccelTableEmitter ::emitCUList () const {
415+ void Dwarf5AccelTableWriter ::emitCUList () const {
416416 for (const auto &CU : enumerate(CompUnits)) {
417417 assert (CU.index () == CU.value ()->getUniqueID ());
418418 Asm->OutStreamer ->AddComment (" Compilation unit " + Twine (CU.index ()));
@@ -422,7 +422,7 @@ void Dwarf5AccelTableEmitter::emitCUList() const {
422422 }
423423}
424424
425- void Dwarf5AccelTableEmitter ::emitBuckets () const {
425+ void Dwarf5AccelTableWriter ::emitBuckets () const {
426426 uint32_t Index = 1 ;
427427 for (const auto &Bucket : enumerate(Contents.getBuckets ())) {
428428 Asm->OutStreamer ->AddComment (" Bucket " + Twine (Bucket.index ()));
@@ -431,7 +431,7 @@ void Dwarf5AccelTableEmitter::emitBuckets() const {
431431 }
432432}
433433
434- void Dwarf5AccelTableEmitter ::emitStringOffsets () const {
434+ void Dwarf5AccelTableWriter ::emitStringOffsets () const {
435435 for (const auto &Bucket : enumerate(Contents.getBuckets ())) {
436436 for (auto *Hash : Bucket.value ()) {
437437 DwarfStringPoolEntryRef String = Hash->Name ;
@@ -442,7 +442,7 @@ void Dwarf5AccelTableEmitter::emitStringOffsets() const {
442442 }
443443}
444444
445- void Dwarf5AccelTableEmitter ::emitAbbrevs () const {
445+ void Dwarf5AccelTableWriter ::emitAbbrevs () const {
446446 Asm->OutStreamer ->EmitLabel (AbbrevStart);
447447 for (const auto &Abbrev : Abbreviations) {
448448 Asm->OutStreamer ->AddComment (" Abbrev code" );
@@ -462,7 +462,7 @@ void Dwarf5AccelTableEmitter::emitAbbrevs() const {
462462 Asm->OutStreamer ->EmitLabel (AbbrevEnd);
463463}
464464
465- void Dwarf5AccelTableEmitter ::emitEntry (
465+ void Dwarf5AccelTableWriter ::emitEntry (
466466 const DWARF5AccelTableData &Entry) const {
467467 auto AbbrevIt = Abbreviations.find (Entry.getDie ().getTag ());
468468 assert (AbbrevIt != Abbreviations.end () &&
@@ -488,7 +488,7 @@ void Dwarf5AccelTableEmitter::emitEntry(
488488 }
489489}
490490
491- void Dwarf5AccelTableEmitter ::emitData () const {
491+ void Dwarf5AccelTableWriter ::emitData () const {
492492 Asm->OutStreamer ->EmitLabel (EntryPool);
493493 for (auto &Bucket : Contents.getBuckets ()) {
494494 for (auto *Hash : Bucket) {
@@ -502,10 +502,10 @@ void Dwarf5AccelTableEmitter::emitData() const {
502502 }
503503}
504504
505- Dwarf5AccelTableEmitter::Dwarf5AccelTableEmitter (
505+ Dwarf5AccelTableWriter::Dwarf5AccelTableWriter (
506506 AsmPrinter *Asm, const AccelTableBase &Contents, const DwarfDebug &DD,
507507 ArrayRef<std::unique_ptr<DwarfCompileUnit>> CompUnits)
508- : AccelTableEmitter (Asm, Contents, false ),
508+ : AccelTableWriter (Asm, Contents, false ),
509509 Header(CompUnits.size(), Contents.getBucketCount(),
510510 Contents.getUniqueNameCount()),
511511 DD(DD), CompUnits(CompUnits) {
@@ -517,7 +517,7 @@ Dwarf5AccelTableEmitter::Dwarf5AccelTableEmitter(
517517 Abbreviations.try_emplace (Tag, UniformAttributes);
518518}
519519
520- void Dwarf5AccelTableEmitter ::emit () const {
520+ void Dwarf5AccelTableWriter ::emit () const {
521521 Header.emit (*this );
522522 emitCUList ();
523523 emitBuckets ();
@@ -534,14 +534,14 @@ void llvm::emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
534534 StringRef Prefix, const MCSymbol *SecBegin,
535535 ArrayRef<AppleAccelTableData::Atom> Atoms) {
536536 Contents.finalize (Asm, Prefix);
537- AppleAccelTableEmitter (Asm, Contents, Atoms, SecBegin).emit ();
537+ AppleAccelTableWriter (Asm, Contents, Atoms, SecBegin).emit ();
538538}
539539
540540void llvm::emitDWARF5AccelTable (
541541 AsmPrinter *Asm, AccelTable<DWARF5AccelTableData> &Contents,
542542 const DwarfDebug &DD, ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs) {
543543 Contents.finalize (Asm, " names" );
544- Dwarf5AccelTableEmitter (Asm, Contents, DD, CUs).emit ();
544+ Dwarf5AccelTableWriter (Asm, Contents, DD, CUs).emit ();
545545}
546546
547547void AppleAccelTableOffsetData::emit (AsmPrinter *Asm) const {
@@ -592,7 +592,7 @@ const SmallVector<AppleAccelTableData::Atom, 4>
592592#endif
593593
594594#ifndef NDEBUG
595- void AppleAccelTableEmitter ::Header::print (raw_ostream &OS) const {
595+ void AppleAccelTableWriter ::Header::print (raw_ostream &OS) const {
596596 OS << " Magic: " << format (" 0x%x" , Magic) << " \n "
597597 << " Version: " << Version << " \n "
598598 << " Hash Function: " << HashFunction << " \n "
@@ -605,13 +605,13 @@ void AppleAccelTableData::Atom::print(raw_ostream &OS) const {
605605 << " Form: " << dwarf::FormEncodingString (Form) << " \n " ;
606606}
607607
608- void AppleAccelTableEmitter ::HeaderData::print (raw_ostream &OS) const {
608+ void AppleAccelTableWriter ::HeaderData::print (raw_ostream &OS) const {
609609 OS << " DIE Offset Base: " << DieOffsetBase << " \n " ;
610610 for (auto Atom : Atoms)
611611 Atom.print (OS);
612612}
613613
614- void AppleAccelTableEmitter ::print (raw_ostream &OS) const {
614+ void AppleAccelTableWriter ::print (raw_ostream &OS) const {
615615 Header.print (OS);
616616 HeaderData.print (OS);
617617 Contents.print (OS);
0 commit comments