9#ifndef LLVM_CLANG_AST_NSAPI_H
10#define LLVM_CLANG_AST_NSAPI_H
13#include "llvm/ADT/ArrayRef.h"
18 class ObjCInterfaceDecl;
61 return isObjCEnumerator(
E,
"NSUTF8StringEncoding", NSUTF8StringEncodingId);
67 return isObjCEnumerator(
E,
"NSASCIIStringEncoding",NSASCIIStringEncodingId);
138 return getOrInitSelector(StringRef(
"objectForKeyedSubscript"),
139 objectForKeyedSubscriptSel);
144 return getOrInitSelector(StringRef(
"objectAtIndexedSubscript"),
145 objectAtIndexedSubscriptSel);
150 StringRef Ids[] = {
"setObject",
"forKeyedSubscript" };
151 return getOrInitSelector(Ids, setObjectForKeyedSubscriptSel);
156 StringRef Ids[] = {
"setObject",
"atIndexedSubscript" };
157 return getOrInitSelector(Ids, setObjectAtIndexedSubscriptSel);
162 return getOrInitSelector(StringRef(
"isEqual"), isEqualSel);
166 return getOrInitNullarySelector(
"new", NewSel);
170 return getOrInitNullarySelector(
"init", InitSel);
197 bool Instance)
const;
206 std::optional<NSNumberLiteralMethodKind>
211 std::optional<NSNumberLiteralMethodKind>
233 bool isObjCEnumerator(
const Expr *
E,
257 mutable Selector objectForKeyedSubscriptSel, objectAtIndexedSubscriptSel,
258 setObjectForKeyedSubscriptSel,setObjectAtIndexedSubscriptSel,
259 isEqualSel, InitSel, NewSel;
262 mutable IdentifierInfo *NSASCIIStringEncodingId, *NSUTF8StringEncodingId;
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This represents one expression.
One of these records is kept for each identifier that is lexed.
std::optional< NSNumberLiteralMethodKind > getNSNumberLiteralMethodKind(Selector Sel) const
Return NSNumberLiteralMethodKind if Sel is such a selector.
Selector getObjectAtIndexedSubscriptSelector() const
Returns selector for "objectAtIndexedSubscript:".
bool isObjCNSIntegerType(QualType T) const
Returns true if.
@ NSStr_initWithUTF8String
@ NSStr_stringWithCString
@ NSStr_stringWithCStringEncoding
@ NSStr_stringWithUTF8String
Selector getSetObjectAtIndexedSubscriptSelector() const
Returns selector for "setObject:atIndexedSubscript".
Selector getNSDictionarySelector(NSDictionaryMethodKind MK) const
The Objective-C NSDictionary selectors.
static const unsigned NumNSArrayMethods
static const unsigned NumNSStringMethods
Selector getNewSelector() const
@ ClassId_NSMutableOrderedSet
@ ClassId_NSMutableDictionary
Selector getIsEqualSelector() const
Returns selector for "isEqual:".
Selector getNSNumberLiteralSelector(NSNumberLiteralMethodKind MK, bool Instance) const
The Objective-C NSNumber selectors used to create NSNumber literals.
Selector getObjectForKeyedSubscriptSelector() const
Returns selector for "objectForKeyedSubscript:".
bool isMacroDefined(StringRef Id) const
Returns true if Id is currently defined as a macro.
std::optional< NSNumberLiteralMethodKind > getNSNumberFactoryMethodKind(QualType T) const
Determine the appropriate NSNumber factory method kind for a literal of the given type.
std::optional< NSDictionaryMethodKind > getNSDictionaryMethodKind(Selector Sel)
Return NSDictionaryMethodKind if Sel is such a selector.
static const unsigned NumClassIds
NSSetMethodKind
Enumerates the NSMutableSet/NSOrderedSet methods used to apply some checks.
@ NSOrderedSet_setObjectAtIndex
@ NSOrderedSet_replaceObjectAtIndexWithObject
@ NSOrderedSet_setObjectAtIndexedSubscript
@ NSOrderedSet_insertObjectAtIndex
NSDictionaryMethodKind
Enumerates the NSDictionary/NSMutableDictionary methods used to generate literals and to apply some c...
@ NSMutableDict_setValueForKey
@ NSDict_dictionaryWithObjectsForKeys
@ NSDict_dictionaryWithDictionary
@ NSMutableDict_setObjectForKey
@ NSDict_initWithObjectsForKeys
@ NSDict_dictionaryWithObjectForKey
@ NSDict_initWithDictionary
@ NSDict_dictionaryWithObjectsForKeysCount
@ NSDict_initWithObjectsAndKeys
@ NSMutableDict_setObjectForKeyedSubscript
@ NSDict_dictionaryWithObjectsAndKeys
Selector getInitSelector() const
Selector getNSArraySelector(NSArrayMethodKind MK) const
The Objective-C NSArray selectors.
std::optional< NSArrayMethodKind > getNSArrayMethodKind(Selector Sel)
Return NSArrayMethodKind if Sel is such a selector.
NSArrayMethodKind
Enumerates the NSArray/NSMutableArray methods used to generate literals and to apply some checks.
@ NSMutableArr_setObjectAtIndexedSubscript
@ NSMutableArr_insertObjectAtIndex
@ NSArr_arrayWithObjectsCount
@ NSMutableArr_replaceObjectAtIndex
bool isSubclassOfNSClass(ObjCInterfaceDecl *InterfaceDecl, NSClassIdKindKind NSClassKind) const
Returns true if InterfaceDecl is subclass of NSClassKind.
std::optional< NSSetMethodKind > getNSSetMethodKind(Selector Sel)
Return NSSetMethodKind if Sel is such a selector.
bool isNSUTF8StringEncodingConstant(const Expr *E) const
Returns true if the expression.
bool isNSNumberLiteralSelector(NSNumberLiteralMethodKind MK, Selector Sel) const
Selector getSetObjectForKeyedSubscriptSelector() const
Returns selector for "setObject:forKeyedSubscript".
static const unsigned NumNSNumberLiteralMethods
bool isObjCNSUIntegerType(QualType T) const
Returns true if.
ASTContext & getASTContext() const
NSNumberLiteralMethodKind
Enumerates the NSNumber methods used to generate literals.
@ NSNumberWithUnsignedChar
@ NSNumberWithUnsignedLongLong
@ NSNumberWithUnsignedInt
@ NSNumberWithUnsignedLong
@ NSNumberWithUnsignedInteger
@ NSNumberWithUnsignedShort
Selector getNSStringSelector(NSStringMethodKind MK) const
The Objective-C NSString selectors.
static const unsigned NumNSDictionaryMethods
bool isNSASCIIStringEncodingConstant(const Expr *E) const
Returns true if the expression.
bool isObjCBOOLType(QualType T) const
Returns true if.
static const unsigned NumNSSetMethods
StringRef GetNSIntegralKind(QualType T) const
Returns one of NSIntegral typedef names if.
Selector getNSSetSelector(NSSetMethodKind MK) const
The Objective-C NSSet selectors.
IdentifierInfo * getNSClassId(NSClassIdKindKind K) const
Represents an ObjC class declaration.
A (possibly-)qualified type.
Smart pointer class that efficiently represents Objective-C method names.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T