Implement parsing and code generation of Objective-C string literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41238 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index 3ca766b..da3bc3d 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -1657,3 +1657,17 @@
return new ChooseExpr(BuiltinLoc, CondExpr, LHSExpr, RHSExpr, resType, RPLoc);
}
+// TODO: Move this to SemaObjC.cpp
+Sema::ExprResult Sema::ParseObjCStringLiteral(ExprTy *string)
+{
+ StringLiteral* S = static_cast<StringLiteral *>(string);
+
+ if (CheckBuiltinCFStringArgument(S))
+ return true;
+
+ QualType t = Context.getCFConstantStringType();
+ t = t.getQualifiedType(QualType::Const);
+ t = Context.getPointerType(t);
+
+ return new ObjCStringLiteral(S, t);
+}