r261887 - Add FieldNames to __NSConstantString_tag
Ben Langmuir via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 25 08:36:26 PST 2016
Author: benlangmuir
Date: Thu Feb 25 10:36:26 2016
New Revision: 261887
URL: http://llvm.org/viewvc/llvm-project?rev=261887&view=rev
Log:
Add FieldNames to __NSConstantString_tag
Since consumers of the AST may expect fields to be named.
Patch by Brad King!
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=261887&r1=261886&r2=261887&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Feb 25 10:36:26 2016
@@ -4877,21 +4877,27 @@ TypedefDecl *ASTContext::getCFConstantSt
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,
More information about the cfe-commits
mailing list