================
@@ -4896,6 +4896,54 @@ void
Parser::ParseLexedTypeAttribute(LateParsedTypeAttribute &LA,
OutAttrs.takeAllAppendingFrom(Attrs);
}
+void Parser::CompleteLateParsedTypeAttributes(
+ SmallVectorImpl<LateParsedTypeAttribute *> &LateTypeAttrs) {
+ for (LateParsedTypeAttribute *LTA : LateTypeAttrs) {
+ // Read these out before parsing, which destroys the attribute. The type is
+ // null if construction rejected the attribute, in which case the
diagnostic
+ // has already been emitted and there is nothing to complete.
+ BoundsAttributedType *BATy = LTA->TypeToComplete;
+ // Rejected during construction (already diagnosed); the cached tokens are
+ // self-contained, so there is nothing to drain — just discard it.
+ if (!BATy) {
+ delete LTA;
+ continue;
+ }
+ // The fields were
+ // attached in ParseStructDeclaration as each declarator was completed;
more
+ // than one appears when several declarators share a
+ // declaration-specifier-position attribute.
+ SmallVector<Decl *, 2> Fields(LTA->Decls);
----------------
rapidsna wrote:
Used `ArrayRef` instead.
https://github.com/llvm/llvm-project/pull/224556
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits