summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2016-02-25 16:36:26 +0000
committerBen Langmuir <blangmuir@apple.com>2016-02-25 16:36:26 +0000
commit4791a80a30c01f7fb8faf027450cd86b82d6da4a (patch)
tree645da03c99c97ee9165f6177ff7d92ccf2f9d34d /clang/lib/AST
parentf4e35f9cb9f8601ae52688be5085c35de9f35a97 (diff)
downloadbcm5719-llvm-4791a80a30c01f7fb8faf027450cd86b82d6da4a.tar.gz
bcm5719-llvm-4791a80a30c01f7fb8faf027450cd86b82d6da4a.zip
Add FieldNames to __NSConstantString_tag
Since consumers of the AST may expect fields to be named. Patch by Brad King! llvm-svn: 261887
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index eba35786e81..c6f5374d5c0 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -4877,21 +4877,27 @@ TypedefDecl *ASTContext::getCFConstantStringDecl() const {
CFConstantStringTagDecl->startDefinition();
QualType FieldTypes[4];
+ const char *FieldNames[4];
// const int *isa;
FieldTypes[0] = getPointerType(IntTy.withConst());
+ FieldNames[0] = "isa";
// int flags;
FieldTypes[1] = IntTy;
+ FieldNames[1] = "flags";
// const char *str;
FieldTypes[2] = getPointerType(CharTy.withConst());
+ FieldNames[2] = "str";
// long length;
FieldTypes[3] = LongTy;
+ FieldNames[3] = "length";
// Create fields
for (unsigned i = 0; i < 4; ++i) {
FieldDecl *Field = FieldDecl::Create(*this, CFConstantStringTagDecl,
SourceLocation(),
- SourceLocation(), nullptr,
+ SourceLocation(),
+ &Idents.get(FieldNames[i]),
FieldTypes[i], /*TInfo=*/nullptr,
/*BitWidth=*/nullptr,
/*Mutable=*/false,
OpenPOWER on IntegriCloud