aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2007-10-29 05:01:08 +0000
committerAnders Carlsson <andersca@mac.com>2007-10-29 05:01:08 +0000
commit85f9bceab1542aafff012d4d28e998f4ba16e362 (patch)
treeb7fca1677fcf450c4cd1e8349873d93c14d43359 /Driver/RewriteTest.cpp
parentcd4b83cb4b4d69dbfa35ef97fe8ab88c0f2698a9 (diff)
Add (partial) support for @encode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r--Driver/RewriteTest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index db2c1ee70b..0c303daddf 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -329,7 +329,10 @@ Stmt *RewriteTest::RewriteFunctionBody(Stmt *S) {
Stmt *RewriteTest::RewriteAtEncode(ObjCEncodeExpr *Exp) {
// Create a new string expression.
QualType StrType = Context->getPointerType(Context->CharTy);
- Expr *Replacement = new StringLiteral("foo", 3, false, StrType,
+ std::string StrEncoding;
+ Context->getObjcEncodingForType(Exp->getEncodedType(), StrEncoding);
+ Expr *Replacement = new StringLiteral(StrEncoding.c_str(),
+ StrEncoding.length(), false, StrType,
SourceLocation(), SourceLocation());
Rewrite.ReplaceStmt(Exp, Replacement);
delete Exp;