[clang] [clang/AST] Make it possible to use SwiftAttr in type context (PR #108631)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 09:08:39 PDT 2024


================
@@ -4104,6 +4105,19 @@ bool RecordType::hasConstFields() const {
   return false;
 }
 
+AttributedType::AttributedType(QualType canon, const Attr *attr,
+                               QualType modified, QualType equivalent)
+    : AttributedType(canon, attr->getKind(), attr, modified, equivalent) {}
+
+AttributedType::AttributedType(QualType canon, attr::Kind attrKind,
+                               const Attr *attr, QualType modified,
+                               QualType equivalent)
+    : Type(Attributed, canon, equivalent->getDependence()), Attribute(attr),
+      ModifiedType(modified), EquivalentType(equivalent) {
+  AttributedTypeBits.AttrKind = attrKind;
----------------
erichkeane wrote:

I think it'd be lovely to get these bits back.  Perhaps just remove attrKind from this `ctor` and just implement the above one instead.

https://github.com/llvm/llvm-project/pull/108631


More information about the cfe-commits mailing list