Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170721 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp
index 591a4af..4406f2d 100644
--- a/lib/Sema/SemaAttr.cpp
+++ b/lib/Sema/SemaAttr.cpp
@@ -1,4 +1,4 @@
-//===--- SemaAttr.cpp - Semantic Analysis for Attribute ------------------===//
+//===--- SemaAttr.cpp - Semantic Analysis for Attributes ------------------===//
//
// The LLVM Compiler Infrastructure
//
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 6cb8659..095d25a 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -5806,8 +5806,8 @@
if (!PD)
return;
- unsigned Attribute = PD->getPropertyAttributes();
- if (Attribute & ObjCPropertyDecl::OBJC_PR_assign) {
+ unsigned Attributes = PD->getPropertyAttributes();
+ if (Attributes & ObjCPropertyDecl::OBJC_PR_assign) {
// when 'assign' attribute was not explicitly specified
// by user, ignore it and rely on property type itself
// for lifetime info.
@@ -5825,7 +5825,7 @@
RHS = cast->getSubExpr();
}
}
- else if (Attribute & ObjCPropertyDecl::OBJC_PR_weak) {
+ else if (Attributes & ObjCPropertyDecl::OBJC_PR_weak) {
while (ImplicitCastExpr *cast = dyn_cast<ImplicitCastExpr>(RHS)) {
if (cast->getCastKind() == CK_ARCConsumeObject) {
Diag(Loc, diag::warn_arc_retained_assign)
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 554bb35..ab8cac8 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -4591,20 +4591,20 @@
/// \brief Determine whether the addition of the given flag to an Objective-C
/// property's attributes will cause a conflict.
-static bool ObjCPropertyFlagConflicts(unsigned Attribute, unsigned NewFlag) {
+static bool ObjCPropertyFlagConflicts(unsigned Attributes, unsigned NewFlag) {
// Check if we've already added this flag.
- if (Attribute & NewFlag)
+ if (Attributes & NewFlag)
return true;
- Attribute |= NewFlag;
+ Attributes |= NewFlag;
// Check for collisions with "readonly".
- if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attribute & ObjCDeclSpec::DQ_PR_readwrite))
+ if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_readwrite))
return true;
// Check for more than one of { assign, copy, retain, strong, weak }.
- unsigned AssignCopyRetMask = Attribute & (ObjCDeclSpec::DQ_PR_assign |
+ unsigned AssignCopyRetMask = Attributes & (ObjCDeclSpec::DQ_PR_assign |
ObjCDeclSpec::DQ_PR_unsafe_unretained |
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain |
@@ -4626,38 +4626,38 @@
if (!CodeCompleter)
return;
- unsigned Attribute = ODS.getPropertyAttributes();
+ unsigned Attributes = ODS.getPropertyAttributes();
ResultBuilder Results(*this, CodeCompleter->getAllocator(),
CodeCompleter->getCodeCompletionTUInfo(),
CodeCompletionContext::CCC_Other);
Results.EnterNewScope();
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_readonly))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readonly))
Results.AddResult(CodeCompletionResult("readonly"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_assign))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_assign))
Results.AddResult(CodeCompletionResult("assign"));
- if (!ObjCPropertyFlagConflicts(Attribute,
+ if (!ObjCPropertyFlagConflicts(Attributes,
ObjCDeclSpec::DQ_PR_unsafe_unretained))
Results.AddResult(CodeCompletionResult("unsafe_unretained"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_readwrite))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readwrite))
Results.AddResult(CodeCompletionResult("readwrite"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_retain))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_retain))
Results.AddResult(CodeCompletionResult("retain"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_strong))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_strong))
Results.AddResult(CodeCompletionResult("strong"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_copy))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_copy))
Results.AddResult(CodeCompletionResult("copy"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_nonatomic))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_nonatomic))
Results.AddResult(CodeCompletionResult("nonatomic"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_atomic))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_atomic))
Results.AddResult(CodeCompletionResult("atomic"));
// Only suggest "weak" if we're compiling for ARC-with-weak-references or GC.
if (getLangOpts().ObjCARCWeak || getLangOpts().getGC() != LangOptions::NonGC)
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_weak))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_weak))
Results.AddResult(CodeCompletionResult("weak"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_setter)) {
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_setter)) {
CodeCompletionBuilder Setter(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
Setter.AddTypedTextChunk("setter");
@@ -4665,7 +4665,7 @@
Setter.AddPlaceholderChunk("method");
Results.AddResult(CodeCompletionResult(Setter.TakeString()));
}
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_getter)) {
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_getter)) {
CodeCompletionBuilder Getter(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
Getter.AddTypedTextChunk("getter");
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index c1afaa7..96e911d 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2804,7 +2804,7 @@
// Warn about ignored type attributes, for example:
// __attribute__((aligned)) struct A;
- // Attribute should be placed after tag to apply to type declaration.
+ // Attributes should be placed after tag to apply to type declaration.
if (!DS.getAttributes().empty()) {
DeclSpec::TST TypeSpecType = DS.getTypeSpecType();
if (TypeSpecType == DeclSpec::TST_class ||
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index cabb1fb..22aad16 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -2722,7 +2722,7 @@
}
/// Handle __attribute__((format_arg((idx)))) attribute based on
-/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attribute.html
+/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
static void handleFormatArgAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (!checkAttributeNumArgs(S, Attr, 1))
return;
@@ -2824,7 +2824,7 @@
}
/// Handle __attribute__((init_priority(priority))) attributes based on
-/// http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attribute.html
+/// http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html
static void handleInitPriorityAttr(Sema &S, Decl *D,
const AttributeList &Attr) {
if (!S.getLangOpts().CPlusPlus) {
@@ -2896,7 +2896,7 @@
}
/// Handle __attribute__((format(type,idx,firstarg))) attributes based on
-/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attribute.html
+/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
static void handleFormatAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (!Attr.getParameterName()) {
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index 1d0eef5..8ba14d5 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -434,7 +434,7 @@
if (ExplicitParams)
CheckCXXDefaultArguments(Method);
- // Attribute on the lambda apply to the method.
+ // Attributes on the lambda apply to the method.
ProcessDeclAttributes(CurScope, Method, ParamInfo);
// Introduce the function call operator as the current declaration context.
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index a498558..170bbde 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -121,23 +121,23 @@
bool *isOverridingProperty,
tok::ObjCKeywordKind MethodImplKind,
DeclContext *lexicalDC) {
- unsigned Attribute = ODS.getPropertyAttributes();
+ unsigned Attributes = ODS.getPropertyAttributes();
TypeSourceInfo *TSI = GetTypeForDeclarator(FD.D, S);
QualType T = TSI->getType();
- Attribute |= deduceWeakPropertyFromType(*this, T);
+ Attributes |= deduceWeakPropertyFromType(*this, T);
- bool isReadWrite = ((Attribute & ObjCDeclSpec::DQ_PR_readwrite) ||
+ bool isReadWrite = ((Attributes & ObjCDeclSpec::DQ_PR_readwrite) ||
// default is readwrite!
- !(Attribute & ObjCDeclSpec::DQ_PR_readonly));
+ !(Attributes & ObjCDeclSpec::DQ_PR_readonly));
// property is defaulted to 'assign' if it is readwrite and is
// not retain or copy
- bool isAssign = ((Attribute & ObjCDeclSpec::DQ_PR_assign) ||
+ bool isAssign = ((Attributes & ObjCDeclSpec::DQ_PR_assign) ||
(isReadWrite &&
- !(Attribute & ObjCDeclSpec::DQ_PR_retain) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_strong) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_copy) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_weak)));
+ !(Attributes & ObjCDeclSpec::DQ_PR_retain) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_strong) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_copy) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_weak)));
// Proceed with constructing the ObjCPropertDecls.
ObjCContainerDecl *ClassDecl = cast<ObjCContainerDecl>(CurContext);
@@ -146,12 +146,12 @@
Decl *Res = HandlePropertyInClassExtension(S, AtLoc, LParenLoc,
FD, GetterSel, SetterSel,
isAssign, isReadWrite,
- Attribute,
+ Attributes,
ODS.getPropertyAttributes(),
isOverridingProperty, TSI,
MethodImplKind);
if (Res) {
- CheckObjCPropertyAttributes(Res, AtLoc, Attribute, false);
+ CheckObjCPropertyAttributes(Res, AtLoc, Attributes, false);
if (getLangOpts().ObjCAutoRefCount)
checkARCPropertyDecl(*this, cast<ObjCPropertyDecl>(Res));
}
@@ -162,14 +162,14 @@
ObjCPropertyDecl *Res = CreatePropertyDecl(S, ClassDecl, AtLoc, LParenLoc, FD,
GetterSel, SetterSel,
isAssign, isReadWrite,
- Attribute,
+ Attributes,
ODS.getPropertyAttributes(),
TSI, MethodImplKind);
if (lexicalDC)
Res->setLexicalDeclContext(lexicalDC);
// Validate the attributes on the @property.
- CheckObjCPropertyAttributes(Res, AtLoc, Attribute,
+ CheckObjCPropertyAttributes(Res, AtLoc, Attributes,
(isa<ObjCInterfaceDecl>(ClassDecl) ||
isa<ObjCProtocolDecl>(ClassDecl)));
@@ -181,31 +181,31 @@
}
static ObjCPropertyDecl::PropertyAttributeKind
-makePropertyAttributesAsWritten(unsigned Attribute) {
+makePropertyAttributesAsWritten(unsigned Attributes) {
unsigned attributesAsWritten = 0;
- if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readonly;
- if (Attribute & ObjCDeclSpec::DQ_PR_readwrite)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readwrite)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readwrite;
- if (Attribute & ObjCDeclSpec::DQ_PR_getter)
+ if (Attributes & ObjCDeclSpec::DQ_PR_getter)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_getter;
- if (Attribute & ObjCDeclSpec::DQ_PR_setter)
+ if (Attributes & ObjCDeclSpec::DQ_PR_setter)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_setter;
- if (Attribute & ObjCDeclSpec::DQ_PR_assign)
+ if (Attributes & ObjCDeclSpec::DQ_PR_assign)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_assign;
- if (Attribute & ObjCDeclSpec::DQ_PR_retain)
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_retain;
- if (Attribute & ObjCDeclSpec::DQ_PR_strong)
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_strong;
- if (Attribute & ObjCDeclSpec::DQ_PR_weak)
+ if (Attributes & ObjCDeclSpec::DQ_PR_weak)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_weak;
- if (Attribute & ObjCDeclSpec::DQ_PR_copy)
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_copy;
- if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_unsafe_unretained;
- if (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)
+ if (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_nonatomic;
- if (Attribute & ObjCDeclSpec::DQ_PR_atomic)
+ if (Attributes & ObjCDeclSpec::DQ_PR_atomic)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_atomic;
return (ObjCPropertyDecl::PropertyAttributeKind)attributesAsWritten;
@@ -259,7 +259,7 @@
Selector GetterSel, Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attribute,
+ const unsigned Attributes,
const unsigned AttributesAsWritten,
bool *isOverridingProperty,
TypeSourceInfo *T,
@@ -292,9 +292,9 @@
PropertyId, AtLoc, LParenLoc, T);
PDecl->setPropertyAttributesAsWritten(
makePropertyAttributesAsWritten(AttributesAsWritten));
- if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
- if (Attribute & ObjCDeclSpec::DQ_PR_readwrite)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readwrite)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
// Set setter/getter selector name. Needed later.
PDecl->setGetterName(GetterSel);
@@ -320,7 +320,7 @@
ObjCPropertyDecl *PrimaryPDecl =
CreatePropertyDecl(S, CCPrimary, AtLoc, LParenLoc,
FD, GetterSel, SetterSel, isAssign, isReadWrite,
- Attribute,AttributesAsWritten, T, MethodImplKind, DC);
+ Attributes,AttributesAsWritten, T, MethodImplKind, DC);
// A case of continuation class adding a new property in the class. This
// is not what it was meant for. However, gcc supports it and so should we.
@@ -359,7 +359,7 @@
unsigned PIkind = PIDecl->getPropertyAttributesAsWritten();
if (isReadWrite && (PIkind & ObjCPropertyDecl::OBJC_PR_readonly)) {
PIkind |= deduceWeakPropertyFromType(*this, PIDecl->getType());
- unsigned ClassExtensionMemoryModel = getOwnershipRule(Attribute);
+ unsigned ClassExtensionMemoryModel = getOwnershipRule(Attributes);
unsigned PrimaryClassMemoryModel = getOwnershipRule(PIkind);
if (PrimaryClassMemoryModel && ClassExtensionMemoryModel &&
(PrimaryClassMemoryModel != ClassExtensionMemoryModel)) {
@@ -391,11 +391,11 @@
PIDecl = cast<ObjCPropertyDecl>(ProtocolPtrTy);
}
PIDecl->makeitReadWriteAttribute();
- if (Attribute & ObjCDeclSpec::DQ_PR_retain)
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain)
PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
- if (Attribute & ObjCDeclSpec::DQ_PR_strong)
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong)
PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
- if (Attribute & ObjCDeclSpec::DQ_PR_copy)
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy)
PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
PIDecl->setSetterName(SetterSel);
} else {
@@ -404,7 +404,7 @@
// This is a common error where the user often intended the original
// declaration to be readonly.
unsigned diag =
- (Attribute & ObjCDeclSpec::DQ_PR_readwrite) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_readwrite) &&
(PIkind & ObjCPropertyDecl::OBJC_PR_readwrite)
? diag::err_use_continuation_class_redeclaration_readwrite
: diag::err_use_continuation_class;
@@ -432,7 +432,7 @@
Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attribute,
+ const unsigned Attributes,
const unsigned AttributesAsWritten,
TypeSourceInfo *TInfo,
tok::ObjCKeywordKind MethodImplKind,
@@ -443,7 +443,7 @@
// Issue a warning if property is 'assign' as default and its object, which is
// gc'able conforms to NSCopying protocol
if (getLangOpts().getGC() != LangOptions::NonGC &&
- isAssign && !(Attribute & ObjCDeclSpec::DQ_PR_assign))
+ isAssign && !(Attributes & ObjCDeclSpec::DQ_PR_assign))
if (const ObjCObjectPointerType *ObjPtrTy =
T->getAs<ObjCObjectPointerType>()) {
ObjCInterfaceDecl *IDecl = ObjPtrTy->getObjectType()->getInterface();
@@ -487,44 +487,44 @@
PDecl->setPropertyAttributesAsWritten(
makePropertyAttributesAsWritten(AttributesAsWritten));
- if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
- if (Attribute & ObjCDeclSpec::DQ_PR_getter)
+ if (Attributes & ObjCDeclSpec::DQ_PR_getter)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_getter);
- if (Attribute & ObjCDeclSpec::DQ_PR_setter)
+ if (Attributes & ObjCDeclSpec::DQ_PR_setter)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_setter);
if (isReadWrite)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
- if (Attribute & ObjCDeclSpec::DQ_PR_retain)
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
- if (Attribute & ObjCDeclSpec::DQ_PR_strong)
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
- if (Attribute & ObjCDeclSpec::DQ_PR_weak)
+ if (Attributes & ObjCDeclSpec::DQ_PR_weak)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_weak);
- if (Attribute & ObjCDeclSpec::DQ_PR_copy)
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
- if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
if (isAssign)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
// In the semantic attributes, one of nonatomic or atomic is always set.
- if (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)
+ if (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic);
else
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_atomic);
// 'unsafe_unretained' is alias for 'assign'.
- if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
if (isAssign)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
@@ -644,8 +644,8 @@
static void
DiagnoseClassAndClassExtPropertyMismatch(Sema &S, ObjCInterfaceDecl *ClassDecl,
ObjCPropertyDecl *property) {
- unsigned Attribute = property->getPropertyAttributesAsWritten();
- bool warn = (Attribute & ObjCDeclSpec::DQ_PR_readonly);
+ unsigned Attributes = property->getPropertyAttributesAsWritten();
+ bool warn = (Attributes & ObjCDeclSpec::DQ_PR_readonly);
for (const ObjCCategoryDecl *CDecl = ClassDecl->getFirstClassExtension();
CDecl; CDecl = CDecl->getNextClassExtension()) {
ObjCPropertyDecl *ClassExtProperty = 0;
@@ -664,7 +664,7 @@
// can override readonly->readwrite and 'setter' attributes originally
// placed on class's property declaration now make sense in the overridden
// property.
- if (Attribute & ObjCDeclSpec::DQ_PR_readonly) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_readonly) {
if (!classExtPropertyAttr ||
(classExtPropertyAttr &
(ObjCDeclSpec::DQ_PR_readwrite|
@@ -685,15 +685,15 @@
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain |
ObjCDeclSpec::DQ_PR_strong);
- if (Attribute & setterAttrs) {
+ if (Attributes & setterAttrs) {
const char * which =
- (Attribute & ObjCDeclSpec::DQ_PR_assign) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_assign) ?
"assign" :
- (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
"unsafe_unretained" :
- (Attribute & ObjCDeclSpec::DQ_PR_copy) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_copy) ?
"copy" :
- (Attribute & ObjCDeclSpec::DQ_PR_retain) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_retain) ?
"retain" : "strong";
S.Diag(property->getLocation(),
@@ -1652,7 +1652,7 @@
ObjCMethodDecl *SetterMethod = 0;
bool LookedUpGetterSetter = false;
- unsigned Attribute = Property->getPropertyAttributes();
+ unsigned Attributes = Property->getPropertyAttributes();
unsigned AttributesAsWritten = Property->getPropertyAttributesAsWritten();
if (!(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_atomic) &&
@@ -1675,8 +1675,8 @@
}
// We only care about readwrite atomic property.
- if ((Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic) ||
- !(Attribute & ObjCPropertyDecl::OBJC_PR_readwrite))
+ if ((Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) ||
+ !(Attributes & ObjCPropertyDecl::OBJC_PR_readwrite))
continue;
if (const ObjCPropertyImplDecl *PIDecl
= IMPDecl->FindPropertyImplDecl(Property->getIdentifier())) {
@@ -1929,7 +1929,7 @@
void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
SourceLocation Loc,
- unsigned &Attribute,
+ unsigned &Attributes,
bool propertyInPrimaryClass) {
// FIXME: Improve the reported location.
if (!PDecl || PDecl->isInvalidDecl())
@@ -1939,7 +1939,7 @@
QualType PropertyTy = PropertyDecl->getType();
if (getLangOpts().ObjCAutoRefCount &&
- (Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
PropertyTy->isObjCRetainableType()) {
// 'readonly' property with no obvious lifetime.
// its life time will be determined by its backing ivar.
@@ -1949,7 +1949,7 @@
ObjCDeclSpec::DQ_PR_strong |
ObjCDeclSpec::DQ_PR_weak |
ObjCDeclSpec::DQ_PR_assign);
- if ((Attribute & rel) == 0)
+ if ((Attributes & rel) == 0)
return;
}
@@ -1957,132 +1957,132 @@
// we postpone most property diagnosis until class's implementation
// because, its readonly attribute may be overridden in its class
// extensions making other attributes, which make no sense, to make sense.
- if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attribute & ObjCDeclSpec::DQ_PR_readwrite))
+ if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_readwrite))
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "readonly" << "readwrite";
}
// readonly and readwrite/assign/retain/copy conflict.
- else if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attribute & (ObjCDeclSpec::DQ_PR_readwrite |
+ else if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & (ObjCDeclSpec::DQ_PR_readwrite |
ObjCDeclSpec::DQ_PR_assign |
ObjCDeclSpec::DQ_PR_unsafe_unretained |
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain |
ObjCDeclSpec::DQ_PR_strong))) {
- const char * which = (Attribute & ObjCDeclSpec::DQ_PR_readwrite) ?
+ const char * which = (Attributes & ObjCDeclSpec::DQ_PR_readwrite) ?
"readwrite" :
- (Attribute & ObjCDeclSpec::DQ_PR_assign) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_assign) ?
"assign" :
- (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
"unsafe_unretained" :
- (Attribute & ObjCDeclSpec::DQ_PR_copy) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_copy) ?
"copy" : "retain";
- Diag(Loc, (Attribute & (ObjCDeclSpec::DQ_PR_readwrite)) ?
+ Diag(Loc, (Attributes & (ObjCDeclSpec::DQ_PR_readwrite)) ?
diag::err_objc_property_attr_mutually_exclusive :
diag::warn_objc_property_attr_mutually_exclusive)
<< "readonly" << which;
}
// Check for copy or retain on non-object types.
- if ((Attribute & (ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
+ if ((Attributes & (ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong)) &&
!PropertyTy->isObjCRetainableType() &&
!PropertyDecl->getAttr<ObjCNSObjectAttr>()) {
Diag(Loc, diag::err_objc_property_requires_object)
- << (Attribute & ObjCDeclSpec::DQ_PR_weak ? "weak" :
- Attribute & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain (or strong)");
- Attribute &= ~(ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
+ << (Attributes & ObjCDeclSpec::DQ_PR_weak ? "weak" :
+ Attributes & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain (or strong)");
+ Attributes &= ~(ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong);
PropertyDecl->setInvalidDecl();
}
// Check for more than one of { assign, copy, retain }.
- if (Attribute & ObjCDeclSpec::DQ_PR_assign) {
- if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_assign) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "copy";
- Attribute &= ~ObjCDeclSpec::DQ_PR_copy;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "retain";
- Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "strong";
- Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
}
if (getLangOpts().ObjCAutoRefCount &&
- (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
+ (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
- } else if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) {
- if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
+ } else if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "copy";
- Attribute &= ~ObjCDeclSpec::DQ_PR_copy;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "retain";
- Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "strong";
- Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
}
if (getLangOpts().ObjCAutoRefCount &&
- (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
+ (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
- } else if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
- if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
+ } else if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "retain";
- Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "strong";
- Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_weak) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_weak) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
}
- else if ((Attribute & ObjCDeclSpec::DQ_PR_retain) &&
- (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
+ else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "retain" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
}
- else if ((Attribute & ObjCDeclSpec::DQ_PR_strong) &&
- (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
+ else if ((Attributes & ObjCDeclSpec::DQ_PR_strong) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "strong" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
- if ((Attribute & ObjCDeclSpec::DQ_PR_atomic) &&
- (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)) {
+ if ((Attributes & ObjCDeclSpec::DQ_PR_atomic) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "atomic" << "nonatomic";
- Attribute &= ~ObjCDeclSpec::DQ_PR_atomic;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_atomic;
}
// Warn if user supplied no assignment attribute, property is
// readwrite, and this is an object type.
- if (!(Attribute & (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_copy |
+ if (!(Attributes & (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_unsafe_unretained |
ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong |
ObjCDeclSpec::DQ_PR_weak)) &&
@@ -2091,7 +2091,7 @@
// With arc, @property definitions should default to (strong) when
// not specified; including when property is 'readonly'.
PropertyDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
- else if (!(Attribute & ObjCDeclSpec::DQ_PR_readonly)) {
+ else if (!(Attributes & ObjCDeclSpec::DQ_PR_readonly)) {
bool isAnyClassTy =
(PropertyTy->isObjCClassType() ||
PropertyTy->isObjCQualifiedClassType());
@@ -2118,19 +2118,19 @@
// (please trim this list while you are at it).
}
- if (!(Attribute & ObjCDeclSpec::DQ_PR_copy)
- &&!(Attribute & ObjCDeclSpec::DQ_PR_readonly)
+ if (!(Attributes & ObjCDeclSpec::DQ_PR_copy)
+ &&!(Attributes & ObjCDeclSpec::DQ_PR_readonly)
&& getLangOpts().getGC() == LangOptions::GCOnly
&& PropertyTy->isBlockPointerType())
Diag(Loc, diag::warn_objc_property_copy_missing_on_block);
- else if ((Attribute & ObjCDeclSpec::DQ_PR_retain) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_strong) &&
+ else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_strong) &&
PropertyTy->isBlockPointerType())
Diag(Loc, diag::warn_objc_property_retain_of_block);
- if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attribute & ObjCDeclSpec::DQ_PR_setter))
+ if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_setter))
Diag(Loc, diag::warn_objc_readonly_property_has_setter);
}
diff --git a/lib/Sema/TargetAttributesSema.h b/lib/Sema/TargetAttributesSema.h
index 143f5d3..410c900 100644
--- a/lib/Sema/TargetAttributesSema.h
+++ b/lib/Sema/TargetAttributesSema.h
@@ -1,4 +1,4 @@
-//===--- TargetAttributesSema.h - Semantic Analysis For Target Attribute -===//
+//===--- TargetAttributesSema.h - Semantic Analysis For Target Attributes -===//
//
// The LLVM Compiler Infrastructure
//