summaryrefslogtreecommitdiffstats
path: root/include/clang/AST/NSAPI.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/NSAPI.h')
-rw-r--r--include/clang/AST/NSAPI.h49
1 files changed, 41 insertions, 8 deletions
diff --git a/include/clang/AST/NSAPI.h b/include/clang/AST/NSAPI.h
index 33fcce2..fc994c1 100644
--- a/include/clang/AST/NSAPI.h
+++ b/include/clang/AST/NSAPI.h
@@ -33,9 +33,12 @@ public:
ClassId_NSMutableArray,
ClassId_NSDictionary,
ClassId_NSMutableDictionary,
- ClassId_NSNumber
+ ClassId_NSNumber,
+ ClassId_NSMutableSet,
+ ClassId_NSCountedSet,
+ ClassId_NSMutableOrderedSet,
};
- static const unsigned NumClassIds = 7;
+ static const unsigned NumClassIds = 10;
enum NSStringMethodKind {
NSStr_stringWithString,
@@ -67,7 +70,8 @@ public:
return isObjCEnumerator(E, "NSASCIIStringEncoding",NSASCIIStringEncodingId);
}
- /// \brief Enumerates the NSArray methods used to generate literals.
+ /// \brief Enumerates the NSArray/NSMutableArray methods used to generate
+ /// literals and to apply some checks.
enum NSArrayMethodKind {
NSArr_array,
NSArr_arrayWithArray,
@@ -77,9 +81,12 @@ public:
NSArr_initWithArray,
NSArr_initWithObjects,
NSArr_objectAtIndex,
- NSMutableArr_replaceObjectAtIndex
+ NSMutableArr_replaceObjectAtIndex,
+ NSMutableArr_addObject,
+ NSMutableArr_insertObjectAtIndex,
+ NSMutableArr_setObjectAtIndexedSubscript
};
- static const unsigned NumNSArrayMethods = 9;
+ static const unsigned NumNSArrayMethods = 12;
/// \brief The Objective-C NSArray selectors.
Selector getNSArraySelector(NSArrayMethodKind MK) const;
@@ -87,7 +94,8 @@ public:
/// \brief Return NSArrayMethodKind if \p Sel is such a selector.
Optional<NSArrayMethodKind> getNSArrayMethodKind(Selector Sel);
- /// \brief Enumerates the NSDictionary methods used to generate literals.
+ /// \brief Enumerates the NSDictionary/NSMutableDictionary methods used
+ /// to generate literals and to apply some checks.
enum NSDictionaryMethodKind {
NSDict_dictionary,
NSDict_dictionaryWithDictionary,
@@ -99,9 +107,11 @@ public:
NSDict_initWithObjectsAndKeys,
NSDict_initWithObjectsForKeys,
NSDict_objectForKey,
- NSMutableDict_setObjectForKey
+ NSMutableDict_setObjectForKey,
+ NSMutableDict_setObjectForKeyedSubscript,
+ NSMutableDict_setValueForKey
};
- static const unsigned NumNSDictionaryMethods = 12;
+ static const unsigned NumNSDictionaryMethods = 14;
/// \brief The Objective-C NSDictionary selectors.
Selector getNSDictionarySelector(NSDictionaryMethodKind MK) const;
@@ -109,6 +119,23 @@ public:
/// \brief Return NSDictionaryMethodKind if \p Sel is such a selector.
Optional<NSDictionaryMethodKind> getNSDictionaryMethodKind(Selector Sel);
+ /// \brief Enumerates the NSMutableSet/NSOrderedSet methods used
+ /// to apply some checks.
+ enum NSSetMethodKind {
+ NSMutableSet_addObject,
+ NSOrderedSet_insertObjectAtIndex,
+ NSOrderedSet_setObjectAtIndex,
+ NSOrderedSet_setObjectAtIndexedSubscript,
+ NSOrderedSet_replaceObjectAtIndexWithObject
+ };
+ static const unsigned NumNSSetMethods = 5;
+
+ /// \brief The Objective-C NSSet selectors.
+ Selector getNSSetSelector(NSSetMethodKind MK) const;
+
+ /// \brief Return NSSetMethodKind if \p Sel is such a selector.
+ Optional<NSSetMethodKind> getNSSetMethodKind(Selector Sel);
+
/// \brief Returns selector for "objectForKeyedSubscript:".
Selector getObjectForKeyedSubscriptSelector() const {
return getOrInitSelector(StringRef("objectForKeyedSubscript"),
@@ -189,6 +216,9 @@ public:
/// of that name in objective-c.
StringRef GetNSIntegralKind(QualType T) const;
+ /// \brief Returns \c true if \p Id is currently defined as a macro.
+ bool isMacroDefined(StringRef Id) const;
+
private:
bool isObjCTypedef(QualType T, StringRef name, IdentifierInfo *&II) const;
bool isObjCEnumerator(const Expr *E,
@@ -207,6 +237,9 @@ private:
/// \brief The selectors for Objective-C NSDictionary methods.
mutable Selector NSDictionarySelectors[NumNSDictionaryMethods];
+ /// \brief The selectors for Objective-C NSSet methods.
+ mutable Selector NSSetSelectors[NumNSSetMethods];
+
/// \brief The Objective-C NSNumber selectors used to create NSNumber literals.
mutable Selector NSNumberClassSelectors[NumNSNumberLiteralMethods];
mutable Selector NSNumberInstanceSelectors[NumNSNumberLiteralMethods];
OpenPOWER on IntegriCloud