================ @@ -271,8 +271,22 @@ class alignas(8) Module { DirectoryEntryRef Entry; }; - /// The headers that are part of this module. - SmallVector<Header, 2> Headers[5]; +private: + unsigned HeaderKindBeginIndex[6] = {}; + SmallVector<Header, 2> HeadersStorage; + +public: + ArrayRef<Header> getHeaders(HeaderKind HK) const { + auto BeginIt = HeadersStorage.begin() + HeaderKindBeginIndex[HK]; + auto EndIt = HeadersStorage.begin() + HeaderKindBeginIndex[HK + 1]; + return {BeginIt, EndIt}; + } + void addHeader(HeaderKind HK, Header H) { + auto EndIt = HeadersStorage.begin() + HeaderKindBeginIndex[HK + 1]; ---------------- cor3ntin wrote:
Ditto on the assert https://github.com/llvm/llvm-project/pull/113395 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits