Part of: #12758 (T9)
Depends on: #12835 (T8)
Type: Cherry-pick from upstream
Description
Introduce LateParsedAttrType as a new AST type node. This is a transient sugar type that wraps another type and holds an opaque pointer to a LateParsedTypeAttribute. Nothing creates or consumes this type yet — this only registers the type node across all visitors, printers, and serialization stubs.
Cherry-pick from llvm#179612.
Key files
TypeBase.h — LateParsedAttrType class definition
TypeLoc.h — LateParsedAttrTypeLoc with AttrNameLoc
TypeNodes.td — register as NeverCanonical
ASTContext.h/cpp — getLateParsedAttrType factory
RecursiveASTVisitor.h — traverse stubs
TreeTransform.h — TransformLateParsedAttrType
TypePrinter.cpp, ASTImporter.cpp, ASTStructuralEquivalence.cpp — desugar/print as wrapped type
ItaniumMangle.cpp, CodeGen, Serialization — unreachable/no-op stubs
clang/tools/libclang/CIndex.cpp — VisitLateParsedAttrTypeLoc
Why
The new late parsing approach creates LateParsedAttrType placeholders during type construction (processLateTypeAttrs). When late parsing completes, TreeTransform replaces the placeholder with a concrete type (e.g., CountAttributedType).
Validation
All existing lit tests must pass: llvm-lit --filter='counted-by|bounds-safety|sized-by' clang/test and llvm-lit clang/test/BoundsSafety
Part of: #12758 (T9)
Depends on: #12835 (T8)
Type: Cherry-pick from upstream
Description
Introduce
LateParsedAttrTypeas a new AST type node. This is a transient sugar type that wraps another type and holds an opaque pointer to aLateParsedTypeAttribute. Nothing creates or consumes this type yet — this only registers the type node across all visitors, printers, and serialization stubs.Cherry-pick from llvm#179612.
Key files
TypeBase.h—LateParsedAttrTypeclass definitionTypeLoc.h—LateParsedAttrTypeLocwithAttrNameLocTypeNodes.td— register asNeverCanonicalASTContext.h/cpp—getLateParsedAttrTypefactoryRecursiveASTVisitor.h— traverse stubsTreeTransform.h—TransformLateParsedAttrTypeTypePrinter.cpp,ASTImporter.cpp,ASTStructuralEquivalence.cpp— desugar/print as wrapped typeItaniumMangle.cpp, CodeGen, Serialization — unreachable/no-op stubsclang/tools/libclang/CIndex.cpp—VisitLateParsedAttrTypeLocWhy
The new late parsing approach creates
LateParsedAttrTypeplaceholders during type construction (processLateTypeAttrs). When late parsing completes,TreeTransformreplaces the placeholder with a concrete type (e.g.,CountAttributedType).Validation
All existing lit tests must pass:
llvm-lit --filter='counted-by|bounds-safety|sized-by' clang/testandllvm-lit clang/test/BoundsSafety