Remember type source information for Objective C property declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105484 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 09d813c..6d3dcbc 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -1598,7 +1598,7 @@
const bool isReadWrite,
const unsigned Attributes,
bool *isOverridingProperty,
- QualType T,
+ TypeSourceInfo *T,
tok::ObjCKeywordKind MethodImplKind);
/// Called by ActOnProperty and HandlePropertyInClassExtension to
@@ -1611,7 +1611,8 @@
Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attributes, QualType T,
+ const unsigned Attributes,
+ TypeSourceInfo *T,
tok::ObjCKeywordKind MethodImplKind,
DeclContext *lexicalDC = 0);
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 4c89a11..4200eb9 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -41,7 +41,8 @@
!(Attributes & ObjCDeclSpec::DQ_PR_retain) &&
!(Attributes & ObjCDeclSpec::DQ_PR_copy)));
- QualType T = GetTypeForDeclarator(FD.D, S);
+ TypeSourceInfo *TSI = 0;
+ QualType T = GetTypeForDeclarator(FD.D, S, &TSI);
if (T->isReferenceType()) {
Diag(AtLoc, diag::error_reference_property);
return DeclPtrTy();
@@ -56,13 +57,13 @@
FD, GetterSel, SetterSel,
isAssign, isReadWrite,
Attributes,
- isOverridingProperty, T,
+ isOverridingProperty, TSI,
MethodImplKind);
DeclPtrTy Res = DeclPtrTy::make(CreatePropertyDecl(S, ClassDecl, AtLoc, FD,
GetterSel, SetterSel,
isAssign, isReadWrite,
- Attributes, T, MethodImplKind));
+ Attributes, TSI, MethodImplKind));
// Validate the attributes on the @property.
CheckObjCPropertyAttributes(Res, AtLoc, Attributes);
return Res;
@@ -76,7 +77,7 @@
const bool isReadWrite,
const unsigned Attributes,
bool *isOverridingProperty,
- QualType T,
+ TypeSourceInfo *T,
tok::ObjCKeywordKind MethodImplKind) {
// Diagnose if this property is already in continuation class.
@@ -190,11 +191,11 @@
const bool isAssign,
const bool isReadWrite,
const unsigned Attributes,
- QualType T,
+ TypeSourceInfo *TInfo,
tok::ObjCKeywordKind MethodImplKind,
DeclContext *lexicalDC){
-
IdentifierInfo *PropertyId = FD.D.getIdentifier();
+ QualType T = TInfo->getType();
// Issue a warning if property is 'assign' as default and its object, which is
// gc'able conforms to NSCopying protocol
@@ -215,7 +216,7 @@
DeclContext *DC = cast<DeclContext>(CDecl);
ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, DC,
FD.D.getIdentifierLoc(),
- PropertyId, AtLoc, T);
+ PropertyId, AtLoc, TInfo);
if (ObjCPropertyDecl *prevDecl =
ObjCPropertyDecl::findPropertyDecl(DC, PropertyId)) {