clang: include/clang/AST/NSAPI.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_CLANG_AST_NSAPI_H
10#define LLVM_CLANG_AST_NSAPI_H
11
13#include "llvm/ADT/ArrayRef.h"
14#include
15
17 class ASTContext;
18 class ObjCInterfaceDecl;
19 class QualType;
20 class Expr;
21
22
24public:
26
28
42
52
54
55
57
58
59
61 return isObjCEnumerator(E, "NSUTF8StringEncoding", NSUTF8StringEncodingId);
62 }
63
64
65
67 return isObjCEnumerator(E, "NSASCIIStringEncoding",NSASCIIStringEncodingId);
68 }
69
70
71
87
88
90
91
93
94
95
112
113
115
116
118
119
120
129
130
132
133
135
136
138 return getOrInitSelector(StringRef("objectForKeyedSubscript"),
139 objectForKeyedSubscriptSel);
140 }
141
142
144 return getOrInitSelector(StringRef("objectAtIndexedSubscript"),
145 objectAtIndexedSubscriptSel);
146 }
147
148
150 StringRef Ids[] = { "setObject", "forKeyedSubscript" };
151 return getOrInitSelector(Ids, setObjectForKeyedSubscriptSel);
152 }
153
154
156 StringRef Ids[] = { "setObject", "atIndexedSubscript" };
157 return getOrInitSelector(Ids, setObjectAtIndexedSubscriptSel);
158 }
159
160
162 return getOrInitSelector(StringRef("isEqual"), isEqualSel);
163 }
164
166 return getOrInitNullarySelector("new", NewSel);
167 }
168
170 return getOrInitNullarySelector("init", InitSel);
171 }
172
173
192
193
194
195
197 bool Instance) const;
198
203 }
204
205
206 std::optional
208
209
210
211 std::optional
213
214
216
218
220
221
223
224
226
227
230
231private:
233 bool isObjCEnumerator(const Expr *E,
236 Selector getOrInitNullarySelector(StringRef Id, Selector &Sel) const;
237
239
241
243
244
246
247
249
250
252
253
256
257 mutable Selector objectForKeyedSubscriptSel, objectAtIndexedSubscriptSel,
258 setObjectForKeyedSubscriptSel,setObjectAtIndexedSubscriptSel,
259 isEqualSel, InitSel, NewSel;
260
261 mutable IdentifierInfo *BOOLId, *NSIntegerId, *NSUIntegerId;
262 mutable IdentifierInfo *NSASCIIStringEncodingId, *NSUTF8StringEncodingId;
263};
264
265}
266
267#endif
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