This is an archive of the discontinued LLVM Phabricator instance.

[Frontend] Simplify PrecompiledPreamble::PCHStorage. NFC
ClosedPublic

Authored by sammccall on Apr 21 2022, 7:37 AM.

Details

Summary
  • Remove fiddly union, preambles are heavyweight
  • Remove fiddly move constructors in TempPCHFile and PCHStorage, use unique_ptr
  • Remove unneccesary accessors on PCHStorage
  • Remove trivial InMemoryStorage
  • Move implementation details into cpp file

This is a prefactoring, followup change will change the in-memory PCHStorage to
avoid extra string copies while creating it.

Diff Detail

Event Timeline

sammccall created this revision.Apr 21 2022, 7:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 7:37 AM
sammccall requested review of this revision.Apr 21 2022, 7:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 7:37 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
adamcz accepted this revision.Apr 21 2022, 7:46 AM
adamcz added inline comments.
clang/lib/Frontend/PrecompiledPreamble.cpp
373

Maybe add asserts here and below to check that Kind is indeed File or Memory?

This revision is now accepted and ready to land.Apr 21 2022, 7:46 AM
This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.