@@ -2613,55 +2613,6 @@ class DeclAttributes {
2613
2613
SourceLoc getStartLoc (bool forModifiers = false ) const ;
2614
2614
};
2615
2615
2616
- // / Semantic attributes that are applied to a declaration.
2617
- // /
2618
- // / This attribute list can include attributes that are not written in
2619
- // / source on a declaration, such as attributes that are applied during
2620
- // / macro expansion or inferred from the declaration context.
2621
- class SemanticDeclAttributes {
2622
- llvm::SmallVector<DeclAttribute *, 4 > attrList;
2623
-
2624
- public:
2625
- SemanticDeclAttributes () {}
2626
-
2627
- // / Add a constructed DeclAttribute to this list.
2628
- void add (DeclAttribute *attr) {
2629
- attrList.push_back (attr);
2630
- }
2631
-
2632
- using SemanticAttrList = llvm::SmallVectorImpl<DeclAttribute *>;
2633
-
2634
- template <typename AttrType, bool AllowInvalid>
2635
- using AttributeKindRange =
2636
- OptionalTransformRange<iterator_range<SemanticAttrList::const_iterator>,
2637
- ToAttributeKind<AttrType, AllowInvalid>,
2638
- SemanticAttrList::const_iterator>;
2639
-
2640
- template <typename AttrType, bool AllowInvalid = false >
2641
- AttributeKindRange<AttrType, AllowInvalid> getAttributes () const {
2642
- return AttributeKindRange<AttrType, AllowInvalid>(
2643
- make_range (attrList.begin (), attrList.end ()),
2644
- ToAttributeKind<AttrType, AllowInvalid>());
2645
- }
2646
-
2647
- // / Retrieve the first attribute of the given attribute class.
2648
- template <typename AttrType>
2649
- const AttrType *getAttribute (bool allowInvalid = false ) const {
2650
- for (auto attr : attrList)
2651
- if (auto *specificAttr = dyn_cast<AttrType>(attr))
2652
- if (specificAttr->isValid () || allowInvalid)
2653
- return specificAttr;
2654
-
2655
- return nullptr ;
2656
- }
2657
-
2658
- // / Determine whether there is an attribute with the given attribute class.
2659
- template <typename AttrType>
2660
- bool hasAttribute (bool allowInvalid = false ) const {
2661
- return getAttribute<AttrType>(allowInvalid) != nullptr ;
2662
- }
2663
- };
2664
-
2665
2616
// / TypeAttributes - These are attributes that may be applied to types.
2666
2617
class TypeAttributes {
2667
2618
// Get a SourceLoc for every possible attribute that can be parsed in source.
0 commit comments