diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-07 19:51:47 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-07 19:51:47 +0000 |
commit | 02d95baf23cbb29ea4ca58b3e8f54f92f845b900 (patch) | |
tree | 057b3b8f236157a1ca5d3d718624213f64e41cea /lib/AST/Expr.cpp | |
parent | fc0f021b492cf28ee7b3a6bd4445ae569e6f15de (diff) |
Instantiation support for more Obj-C expressions, string literals, @selector and @protocol expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 4a53a4123d..c12dd6747c 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1556,6 +1556,22 @@ ObjCMessageExpr::ObjCMessageExpr(Expr *receiver, Selector selInfo, RBracloc = RBrac; } +ObjCStringLiteral* ObjCStringLiteral::Clone(ASTContext &C) const { + // Clone the string literal. + StringLiteral *NewString = + String ? cast<StringLiteral>(String)->Clone(C) : 0; + + return new (C) ObjCStringLiteral(NewString, getType(), AtLoc); +} + +ObjCSelectorExpr *ObjCSelectorExpr::Clone(ASTContext &C) const { + return new (C) ObjCSelectorExpr(getType(), SelName, AtLoc, RParenLoc); +} + +ObjCProtocolExpr *ObjCProtocolExpr::Clone(ASTContext &C) const { + return new (C) ObjCProtocolExpr(getType(), Protocol, AtLoc, RParenLoc); +} + // constructor for class messages. // FIXME: clsName should be typed to ObjCInterfaceType ObjCMessageExpr::ObjCMessageExpr(IdentifierInfo *clsName, Selector selInfo, |