diff options
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 1e52e535329..97f1b882619 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -4041,10 +4041,12 @@ Stmt::child_range ObjCMessageExpr::children() { ObjCArrayLiteral::ObjCArrayLiteral(ArrayRef<Expr *> Elements, QualType T, ObjCMethodDecl *Method, + ObjCMethodDecl *AllocMethod, SourceRange SR) : Expr(ObjCArrayLiteralClass, T, VK_RValue, OK_Ordinary, false, false, false, false), - NumElements(Elements.size()), Range(SR), ArrayWithObjectsMethod(Method) + NumElements(Elements.size()), Range(SR), ArrayWithObjectsMethod(Method), + ArrayAllocMethod(AllocMethod) { Expr **SaveElements = getElements(); for (unsigned I = 0, N = Elements.size(); I != N; ++I) { @@ -4062,10 +4064,11 @@ ObjCArrayLiteral::ObjCArrayLiteral(ArrayRef<Expr *> Elements, ObjCArrayLiteral *ObjCArrayLiteral::Create(const ASTContext &C, ArrayRef<Expr *> Elements, QualType T, ObjCMethodDecl * Method, + ObjCMethodDecl *allocMethod, SourceRange SR) { void *Mem = C.Allocate(sizeof(ObjCArrayLiteral) + Elements.size() * sizeof(Expr *)); - return new (Mem) ObjCArrayLiteral(Elements, T, Method, SR); + return new (Mem) ObjCArrayLiteral(Elements, T, Method, allocMethod, SR); } ObjCArrayLiteral *ObjCArrayLiteral::CreateEmpty(const ASTContext &C, @@ -4080,11 +4083,13 @@ ObjCDictionaryLiteral::ObjCDictionaryLiteral( ArrayRef<ObjCDictionaryElement> VK, bool HasPackExpansions, QualType T, ObjCMethodDecl *method, + ObjCMethodDecl *allocMethod, SourceRange SR) : Expr(ObjCDictionaryLiteralClass, T, VK_RValue, OK_Ordinary, false, false, false, false), NumElements(VK.size()), HasPackExpansions(HasPackExpansions), Range(SR), - DictWithObjectsMethod(method) + DictWithObjectsMethod(method), + DictAllocMethod(allocMethod) { KeyValuePair *KeyValues = getKeyValues(); ExpansionData *Expansions = getExpansionData(); @@ -4117,6 +4122,7 @@ ObjCDictionaryLiteral::Create(const ASTContext &C, ArrayRef<ObjCDictionaryElement> VK, bool HasPackExpansions, QualType T, ObjCMethodDecl *method, + ObjCMethodDecl *allocMethod, SourceRange SR) { unsigned ExpansionsSize = 0; if (HasPackExpansions) @@ -4124,7 +4130,8 @@ ObjCDictionaryLiteral::Create(const ASTContext &C, void *Mem = C.Allocate(sizeof(ObjCDictionaryLiteral) + sizeof(KeyValuePair) * VK.size() + ExpansionsSize); - return new (Mem) ObjCDictionaryLiteral(VK, HasPackExpansions, T, method, SR); + return new (Mem) ObjCDictionaryLiteral(VK, HasPackExpansions, T, + method, allocMethod, SR); } ObjCDictionaryLiteral * |