Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ class Dwarf5AccelTableWriter : public AccelTableWriter {
const DWARF5AccelTableData &)>
getIndexForEntry,
bool IsSplitDwarf);

~Dwarf5AccelTableWriter() {
for (DebugNamesAbbrev *Abbrev : AbbreviationsVector)
Abbrev->~DebugNamesAbbrev();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just remove the allocator instead and use plain old unique pointers?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'm not familiar with how the abbrev stuff is implemented, so can't speak as to how much time this allocator is saving)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to accept and land to fix the bot.
Please followup with @felipepiovezan .

BTW. std::destroy should work here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can.... I don't really have a strong opinion on this.
It will look something like

std::unique_ptr<DebugNamesAbbrev> NewAbbrev =
            std::make_unique<DebugNamesAbbrev>(std::move(Abbrev));
        NewAbbrev->setNumber(AbbreviationsVector.size() + 1);
        AbbreviationsVector.push_back(std::move(NewAbbrev));
        AbbreviationsSet.InsertNode(AbbreviationsVector.back().get(), InsertPos);
        Value->setAbbrevNumber(AbbreviationsVector.back()->getNumber());

Couple reasons for leaving it like this

  1. Bumpptr allocator seems to be a more standard way of dong things, although it can lead to situations like this.
  2. This is also how .debug_abbrev handles it. Since we are going for convergence at some point.

void emit();
};
} // namespace
Expand Down