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 | 0880e9f58d414d1eb08564795abd274264bd7da1 (patch) | |
| tree | 6af06081a9251b43b04172af25100ce6626559fe /clang/lib/AST/Expr.cpp | |
| parent | 315d2294f82676ba4199a139484b7cdaae40c159 (diff) | |
| download | bcm5719-llvm-0880e9f58d414d1eb08564795abd274264bd7da1.tar.gz bcm5719-llvm-0880e9f58d414d1eb08564795abd274264bd7da1.zip | |
Instantiation support for more Obj-C expressions, string literals, @selector and @protocol expressions.
llvm-svn: 73036
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 4a53a4123d1..c12dd6747c6 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/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, |

