[clang][NFC] Store record layout base offsets in SortedVectorMaps (#246392)
The record layout builders and C++ record layouts stored the base and
virtual base offsets in DenseMaps, which start at 64 buckets, so a
record with a single base cost a 1 KB allocation. Most records have one
or two bases, so use llvm::SortedVectorMap instead, and move the
builder's maps into the layout instead of copying them.
On some LLVM TUs (GVN, LiveVariables, RegionStore, SemaExpr) with
-fsyntax-only, the peak footprint goes down by 1.7/3.6/3.7/6.7 MB.
Assisted-by: Claude Opus 5.5
---------
Co-authored-by: Gabor Horvath <gaborh@apple.com>