Add (partial) support for @encode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index db2c1ee..0c303da 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -329,7 +329,10 @@
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;