================ @@ -624,6 +624,20 @@ class ASTContext : public RefCountedBase<ASTContext> { using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>; ParameterIndexTable ParamIndices; +public: + struct CXXRecordDeclRelocationInfo { + unsigned IsRelocatable; + unsigned IsReplaceable; + }; + std::optional<CXXRecordDeclRelocationInfo> + getRelocationInfoForCXXRecord(const CXXRecordDecl *) const; + void setRelocationInfoForCXXRecord(const CXXRecordDecl *, + CXXRecordDeclRelocationInfo); + +private: + llvm::DenseMap<const CXXRecordDecl *, CXXRecordDeclRelocationInfo> ---------------- erichkeane wrote:
With the 'value' here only being 2 bits of information, I find myself wondering if we could switch `CXXRecordDeclRelocationInfo` to an enum-as-flags, and do something with `PointerIntPair` here. Then store these either as a sorted vector, or a 'set' in some way? Perhaps have a look around? Also, do we typically do caching like this in ASTContext? I thought we did this in Sema more often. Also-also: does this play well with deserialization? https://github.com/llvm/llvm-project/pull/127636 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits