summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/AST/NSAPI.h10
-rw-r--r--clang/include/clang/Sema/Sema.h9
-rw-r--r--clang/lib/AST/NSAPI.cpp17
-rw-r--r--clang/lib/Sema/Sema.cpp3
4 files changed, 35 insertions, 4 deletions
diff --git a/clang/include/clang/AST/NSAPI.h b/clang/include/clang/AST/NSAPI.h
index 0b21b033481..c64338549f9 100644
--- a/clang/include/clang/AST/NSAPI.h
+++ b/clang/include/clang/AST/NSAPI.h
@@ -76,9 +76,10 @@ public:
NSArr_initWithArray,
NSArr_initWithObjects,
NSArr_objectAtIndex,
- NSMutableArr_replaceObjectAtIndex
+ NSMutableArr_replaceObjectAtIndex,
+ NSArr_initWithObjectsCount
};
- static const unsigned NumNSArrayMethods = 9;
+ static const unsigned NumNSArrayMethods = 10;
/// \brief The Objective-C NSArray selectors.
Selector getNSArraySelector(NSArrayMethodKind MK) const;
@@ -98,9 +99,10 @@ public:
NSDict_initWithObjectsAndKeys,
NSDict_initWithObjectsForKeys,
NSDict_objectForKey,
- NSMutableDict_setObjectForKey
+ NSMutableDict_setObjectForKey,
+ NSDict_initWithObjectsForKeysCount
};
- static const unsigned NumNSDictionaryMethods = 11;
+ static const unsigned NumNSDictionaryMethods = 12;
/// \brief The Objective-C NSDictionary selectors.
Selector getNSDictionarySelector(NSDictionaryMethodKind MK) const;
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 59a5e5dd4f9..3880cb57736 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -672,12 +672,21 @@ public:
/// \brief The declaration of the arrayWithObjects:count: method.
ObjCMethodDecl *ArrayWithObjectsMethod;
+
+ /// \brief The declaration of the initWithObjects:count: method.
+ ObjCMethodDecl *InitArrayWithObjectsMethod;
/// \brief The declaration of the Objective-C NSDictionary class.
ObjCInterfaceDecl *NSDictionaryDecl;
/// \brief The declaration of the dictionaryWithObjects:forKeys:count: method.
ObjCMethodDecl *DictionaryWithObjectsMethod;
+
+ /// \brief The declaration of the initWithObjects:forKeys:count: method.
+ ObjCMethodDecl *InitDictionaryWithObjectsMethod;
+
+ /// \brief The declaration for + (id) alloc method.
+ ObjCMethodDecl *AllocObjectsMethod;
/// \brief id<NSCopying> type.
QualType QIDNSCopying;
diff --git a/clang/lib/AST/NSAPI.cpp b/clang/lib/AST/NSAPI.cpp
index 986b3b53983..c6afc8e3819 100644
--- a/clang/lib/AST/NSAPI.cpp
+++ b/clang/lib/AST/NSAPI.cpp
@@ -119,6 +119,14 @@ Selector NSAPI::getNSArraySelector(NSArrayMethodKind MK) const {
Sel = Ctx.Selectors.getSelector(2, KeyIdents);
break;
}
+ case NSArr_initWithObjectsCount: {
+ IdentifierInfo *KeyIdents[] = {
+ &Ctx.Idents.get("initWithObjects"),
+ &Ctx.Idents.get("count")
+ };
+ Sel = Ctx.Selectors.getSelector(2, KeyIdents);
+ break;
+ }
}
return (NSArraySelectors[MK] = Sel);
}
@@ -204,6 +212,15 @@ Selector NSAPI::getNSDictionarySelector(
Sel = Ctx.Selectors.getSelector(2, KeyIdents);
break;
}
+ case NSDict_initWithObjectsForKeysCount: {
+ IdentifierInfo *KeyIdents[] = {
+ &Ctx.Idents.get("initWithObjects"),
+ &Ctx.Idents.get("forKeys"),
+ &Ctx.Idents.get("count")
+ };
+ Sel = Ctx.Selectors.getSelector(3, KeyIdents);
+ break;
+ }
}
return (NSDictionarySelectors[MK] = Sel);
}
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 46c5cba84df..7fb5eba1c2d 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -95,7 +95,10 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
NSNumberDecl(nullptr),
NSStringDecl(nullptr), StringWithUTF8StringMethod(nullptr),
NSArrayDecl(nullptr), ArrayWithObjectsMethod(nullptr),
+ InitArrayWithObjectsMethod(nullptr),
NSDictionaryDecl(nullptr), DictionaryWithObjectsMethod(nullptr),
+ InitDictionaryWithObjectsMethod(nullptr),
+ AllocObjectsMethod(nullptr),
GlobalNewDeleteDeclared(false),
TUKind(TUKind),
NumSFINAEErrors(0),
OpenPOWER on IntegriCloud