[all-commits] [llvm/llvm-project] 44ef83: [clang][AST] Hash `AttributedType`'s `Attr` by Arg...
Qiongsi Wu via All-commits
all-commits at lists.llvm.org
Fri Jun 5 10:13:18 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 44ef831f9da0283e16c11c903d81d4186ed8ea6d
https://github.com/llvm/llvm-project/commit/44ef831f9da0283e16c11c903d81d4186ed8ea6d
Author: Qiongsi Wu <qiongsiwu at gmail.com>
Date: 2026-06-05 (Fri, 05 Jun 2026)
Changed paths:
M clang/include/clang/AST/ASTContext.h
M clang/include/clang/AST/Attr.h
M clang/include/clang/AST/TypeBase.h
M clang/include/clang/Basic/Attr.td
M clang/lib/AST/ASTContext.cpp
M clang/lib/AST/AttrImpl.cpp
M clang/lib/AST/Type.cpp
A clang/test/AST/attributed-type-dedup-address-space.c
A clang/test/AST/attributed-type-dedup-annotate-type-args.c
A clang/test/AST/attributed-type-dedup-annotate-type.m
A clang/test/AST/attributed-type-dedup-nullability.m
A clang/test/AST/attributed-type-dedup-objc-ownership.m
A clang/test/AST/attributed-type-dedup-pcs.c
A clang/test/AST/attributed-type-dedup-swift-attr.m
M clang/utils/TableGen/ClangAttrEmitter.cpp
Log Message:
-----------
[clang][AST] Hash `AttributedType`'s `Attr` by Arguments (#200961)
https://github.com/llvm/llvm-project/pull/108631 added
`ID.AddPointer(attr)` to `AttributedType::Profile`, which turned the
`ID` into a pointer-identity key. This inhibits deduplication of
attributed types (such as types with `_Nonnull/_Nullable` attributes).
Such duplications can lead to significant increases in pcm/pch sizes.
This PR adds the arguments of the attributes to the folding set ID, so
that the content of the argument is taken into account when computing
the ID in addition to the existing inputs. The implementation teaches
tablegen to generate the `profile` method for each attribute, similar to
how we generate methods to check equivalence. This way, the argument
contents are handled automatically. Additionally, an attribute can have
an escape hatch to add its own customized profile method, through the
`profileFn` tablegen field, in case something special is needed.
Assisted-by: claude-opus-4.7
Fixes rdar://170586474.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list