void AsmPrinter::emitDwarfAbbrev(const DIEAbbrev &Abbrev) const { // Emit the abbreviations code (base 1 index.) EmitULEB128(Abbrev.getNumber(), "Abbreviation Code"); // Emit the abbreviations data. Abbrev.Emit(this); }
// Define a unique number for the abbreviation. // void DwarfFile::assignAbbrevNumber(DIEAbbrev &Abbrev) { // Check the set for priors. DIEAbbrev *InSet = AbbreviationsSet.GetOrInsertNode(&Abbrev); // If it's newly added. if (InSet == &Abbrev) { // Add to abbreviation list. Abbreviations.push_back(&Abbrev); // Assign the vector position + 1 as its number. Abbrev.setNumber(Abbreviations.size()); } else { // Assign existing abbreviation number. Abbrev.setNumber(InSet->getNumber()); } }