[cfe-commits] r44222 - in /cfe/trunk: AST/ASTContext.cpp test/CodeGen/cfstring.c
Anders Carlsson
andersca at mac.com
Sun Nov 18 16:25:31 PST 2007
Author: andersca
Date: Sun Nov 18 18:25:30 2007
New Revision: 44222
URL: http://llvm.org/viewvc/llvm-project?rev=44222&view=rev
Log:
Put back the flags field in the constant CF string type.
Added:
cfe/trunk/test/CodeGen/cfstring.c
Modified:
cfe/trunk/AST/ASTContext.cpp
Modified: cfe/trunk/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/ASTContext.cpp?rev=44222&r1=44221&r2=44222&view=diff
==============================================================================
--- cfe/trunk/AST/ASTContext.cpp (original)
+++ cfe/trunk/AST/ASTContext.cpp Sun Nov 18 18:25:30 2007
@@ -870,18 +870,20 @@
CFConstantStringTypeDecl = new RecordDecl(Decl::Struct, SourceLocation(),
&Idents.get("NSConstantString"),
0);
- QualType FieldTypes[3];
+ QualType FieldTypes[4];
// const int *isa;
FieldTypes[0] = getPointerType(IntTy.getQualifiedType(QualType::Const));
+ // int flags;
+ FieldTypes[1] = IntTy;
// const char *str;
- FieldTypes[1] = getPointerType(CharTy.getQualifiedType(QualType::Const));
+ FieldTypes[2] = getPointerType(CharTy.getQualifiedType(QualType::Const));
// long length;
- FieldTypes[2] = LongTy;
+ FieldTypes[3] = LongTy;
// Create fields
- FieldDecl *FieldDecls[3];
+ FieldDecl *FieldDecls[4];
- for (unsigned i = 0; i < 3; ++i)
+ for (unsigned i = 0; i < 4; ++i)
FieldDecls[i] = new FieldDecl(SourceLocation(), 0, FieldTypes[i]);
CFConstantStringTypeDecl->defineBody(FieldDecls, 4);
Added: cfe/trunk/test/CodeGen/cfstring.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/cfstring.c?rev=44222&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/cfstring.c (added)
+++ cfe/trunk/test/CodeGen/cfstring.c Sun Nov 18 18:25:30 2007
@@ -0,0 +1,6 @@
+// RUN: clang -emit-llvm %s
+#define CFSTR __builtin___CFStringMakeConstantString
+
+void f() {
+ CFSTR("Hello, World!");
+}
\ No newline at end of file
More information about the cfe-commits
mailing list