Implement rewrite rules for ObjC string constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43665 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index a8900c1..f0b179b 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -861,23 +861,20 @@
QualType ASTContext::getCFConstantStringType() {
if (!CFConstantStringTypeDecl) {
CFConstantStringTypeDecl = new RecordDecl(Decl::Struct, SourceLocation(),
- &Idents.get("__builtin_CFString"),
+ &Idents.get("NSConstantString"),
0);
-
- QualType FieldTypes[4];
+ QualType FieldTypes[3];
// const int *isa;
FieldTypes[0] = getPointerType(IntTy.getQualifiedType(QualType::Const));
- // int flags;
- FieldTypes[1] = IntTy;
// const char *str;
- FieldTypes[2] = getPointerType(CharTy.getQualifiedType(QualType::Const));
+ FieldTypes[1] = getPointerType(CharTy.getQualifiedType(QualType::Const));
// long length;
- FieldTypes[3] = LongTy;
+ FieldTypes[2] = LongTy;
// Create fields
- FieldDecl *FieldDecls[4];
+ FieldDecl *FieldDecls[3];
- for (unsigned i = 0; i < 4; ++i)
+ for (unsigned i = 0; i < 3; ++i)
FieldDecls[i] = new FieldDecl(SourceLocation(), 0, FieldTypes[i]);
CFConstantStringTypeDecl->defineBody(FieldDecls, 4);