diff options
| author | Anders Carlsson <andersca@mac.com> | 2007-11-19 00:25:30 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2007-11-19 00:25:30 +0000 |
| commit | 9c1011c090de1a45950478875305c2349c8a2c14 (patch) | |
| tree | e6b5de81bc0b56bcdc2346daf4851ad5135ab535 | |
| parent | 094079c0dc8e83583ed7aeca273355636650c34e (diff) | |
| download | bcm5719-llvm-9c1011c090de1a45950478875305c2349c8a2c14.tar.gz bcm5719-llvm-9c1011c090de1a45950478875305c2349c8a2c14.zip | |
Put back the flags field in the constant CF string type.
llvm-svn: 44222
| -rw-r--r-- | clang/AST/ASTContext.cpp | 12 | ||||
| -rw-r--r-- | clang/test/CodeGen/cfstring.c | 6 |
2 files changed, 13 insertions, 5 deletions
diff --git a/clang/AST/ASTContext.cpp b/clang/AST/ASTContext.cpp index 9d597bcc430..740d6e56fab 100644 --- a/clang/AST/ASTContext.cpp +++ b/clang/AST/ASTContext.cpp @@ -870,18 +870,20 @@ QualType ASTContext::getCFConstantStringType() { 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); diff --git a/clang/test/CodeGen/cfstring.c b/clang/test/CodeGen/cfstring.c new file mode 100644 index 00000000000..c7df1b30339 --- /dev/null +++ b/clang/test/CodeGen/cfstring.c @@ -0,0 +1,6 @@ +// RUN: clang -emit-llvm %s +#define CFSTR __builtin___CFStringMakeConstantString + +void f() { + CFSTR("Hello, World!"); +}
\ No newline at end of file |

