================ @@ -3159,13 +3175,27 @@ Attr *ASTRecordReader::readAttr() { return New; } -/// Reads attributes from the current stream position. -void ASTRecordReader::readAttributes(AttrVec &Attrs) { +void ASTRecordReader::readAttributesImpl(AttrVec &Attrs, Decl *D) { for (unsigned I = 0, E = readInt(); I != E; ++I) - if (auto *A = readAttr()) + if (auto *A = readAttr(D)) Attrs.push_back(A); } +Attr *ASTRecordReader::readAttr() { return readAttrImpl(nullptr); } + +/// Reads attributes from the current stream position. +void ASTRecordReader::readAttributes(AttrVec &Attrs) { + readAttributesImpl(Attrs, nullptr); +} + +/// Reads one attribute from the current stream position, advancing Idx. +Attr *ASTRecordReader::readAttr(Decl *D) { return readAttrImpl(D); } ---------------- ilya-biryukov wrote:
The behavior of this funciton is drastically different from `readAttr`, could we use a different name and document that it delays reading of some attributes? Same for `readAttributes` https://github.com/llvm/llvm-project/pull/122726 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits