diff options
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/AttributeList.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/JumpDiagnostics.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 10 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaType.cpp | 32 | ||||
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 2 |
11 files changed, 36 insertions, 36 deletions
diff --git a/clang/lib/Sema/AttributeList.cpp b/clang/lib/Sema/AttributeList.cpp index fda4e0ccd85..afc23e9be20 100644 --- a/clang/lib/Sema/AttributeList.cpp +++ b/clang/lib/Sema/AttributeList.cpp @@ -180,7 +180,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) { .Case("cf_returns_autoreleased", AT_cf_returns_autoreleased) .Case("ns_consumes_self", AT_ns_consumes_self) .Case("ns_consumed", AT_ns_consumed) - .Case("objc_lifetime", AT_objc_lifetime) + .Case("objc_ownership", AT_objc_ownership) .Case("objc_precise_lifetime", AT_objc_precise_lifetime) .Case("ownership_returns", AT_ownership_returns) .Case("ownership_holds", AT_ownership_holds) diff --git a/clang/lib/Sema/JumpDiagnostics.cpp b/clang/lib/Sema/JumpDiagnostics.cpp index 007d755a877..8cabc922855 100644 --- a/clang/lib/Sema/JumpDiagnostics.cpp +++ b/clang/lib/Sema/JumpDiagnostics.cpp @@ -138,8 +138,8 @@ static ScopePair GetDiagForGotoScopeDecl(ASTContext &Context, const Decl *D) { case Qualifiers::OCL_Strong: case Qualifiers::OCL_Weak: - return ScopePair(diag::note_protected_by_objc_lifetime, - diag::note_exits_objc_lifetime); + return ScopePair(diag::note_protected_by_objc_ownership, + diag::note_exits_objc_ownership); } } diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 92da37bf234..6a09bf0e40c 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -436,7 +436,7 @@ Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) { case Qualifiers::OCL_Weak: case Qualifiers::OCL_Strong: case Qualifiers::OCL_Autoreleasing: - Diag(DRE->getLocStart(), diag::err_arc_atomic_lifetime) + Diag(DRE->getLocStart(), diag::err_arc_atomic_ownership) << ValType << FirstArg->getSourceRange(); return ExprError(); } diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 4a000e9fc26..adfc6f95013 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3518,7 +3518,7 @@ bool Sema::inferObjCARCLifetime(ValueDecl *decl) { // Thread-local variables cannot have lifetime. if (lifetime && lifetime != Qualifiers::OCL_ExplicitNone && var->isThreadSpecified()) { - Diag(var->getLocation(), diag::err_arc_thread_lifetime) + Diag(var->getLocation(), diag::err_arc_thread_ownership) << var->getType(); return true; } @@ -6137,7 +6137,7 @@ ParmVarDecl *Sema::CheckParameter(DeclContext *DC, SourceLocation StartLoc, // - otherwise, it's an error if (T->isArrayType()) { if (!T.isConstQualified()) { - Diag(NameLoc, diag::err_arc_array_param_no_lifetime) + Diag(NameLoc, diag::err_arc_array_param_no_ownership) << TSInfo->getTypeLoc().getSourceRange(); } lifetime = Qualifiers::OCL_ExplicitNone; @@ -7902,7 +7902,7 @@ bool Sema::CheckNontrivialField(FieldDecl *FD) { if (getSourceManager().isInSystemHeader(Loc)) { if (!FD->hasAttr<UnavailableAttr>()) FD->addAttr(new (Context) UnavailableAttr(Loc, Context, - "this system field has retaining lifetime")); + "this system field has retaining ownership")); return false; } } @@ -8069,7 +8069,7 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) { case Qualifiers::OCL_Autoreleasing: case Qualifiers::OCL_Weak: case Qualifiers::OCL_Strong: - Diag((*fi)->getLocation(), diag::note_nontrivial_objc_lifetime) + Diag((*fi)->getLocation(), diag::note_nontrivial_objc_ownership) << QT << EltTy.getObjCLifetime(); return; } @@ -8386,7 +8386,7 @@ void Sema::ActOnFields(Scope* S, if (getSourceManager().isInSystemHeader(loc)) { if (!FD->hasAttr<UnavailableAttr>()) { FD->addAttr(new (Context) UnavailableAttr(loc, Context, - "this system field has retaining lifetime")); + "this system field has retaining ownership")); } } else { Diag(FD->getLocation(), diag::err_arc_objc_object_in_struct); diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 4769b092642..1b358f4ca6d 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -2780,7 +2780,7 @@ static void HandleNSReturnsRetainedAttr(Decl *d, const AttributeList &attr, }; } -static void HandleObjCLifetimeAttr(Decl *d, const AttributeList &attr, +static void HandleObjCOwnershipAttr(Decl *d, const AttributeList &attr, Sema &S) { if (hasDeclarator(d)) return; @@ -2978,8 +2978,8 @@ static void ProcessInheritableDeclAttr(Scope *scope, Decl *D, case AttributeList::AT_shared: HandleSharedAttr (D, Attr, S); break; case AttributeList::AT_vecreturn: HandleVecReturnAttr (D, Attr, S); break; - case AttributeList::AT_objc_lifetime: - HandleObjCLifetimeAttr(D, Attr, S); break; + case AttributeList::AT_objc_ownership: + HandleObjCOwnershipAttr(D, Attr, S); break; case AttributeList::AT_objc_precise_lifetime: HandleObjCPreciseLifetimeAttr(D, Attr, S); break; diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index adc1331a9fb..3fdfb63c10b 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -4053,7 +4053,7 @@ ExprResult Sema::CheckCastTypes(SourceLocation CastStartLoc, SourceRange TyR, ExprPtr->getPointeeType()->isObjCLifetimeType() && !CastQuals.compatiblyIncludesObjCLifetime(ExprQuals)) { Diag(castExpr->getLocStart(), - diag::err_typecheck_incompatible_lifetime) + diag::err_typecheck_incompatible_ownership) << castExprType << castType << AA_Casting << castExpr->getSourceRange(); @@ -8587,7 +8587,7 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy, } else if (lhq.getObjCLifetime() != rhq.getObjCLifetime()) { - DiagKind = diag::err_typecheck_incompatible_lifetime; + DiagKind = diag::err_typecheck_incompatible_ownership; break; } diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 0cd707e1f58..f8da76bf848 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1144,7 +1144,7 @@ bool Sema::CheckAllocatedType(QualType AllocType, SourceLocation Loc, QualType BaseAllocType = Context.getBaseElementType(AT); if (BaseAllocType.getObjCLifetime() == Qualifiers::OCL_None && BaseAllocType->isObjCLifetimeType()) - return Diag(Loc, diag::err_arc_new_array_without_lifetime) + return Diag(Loc, diag::err_arc_new_array_without_ownership) << BaseAllocType; } } diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 2dbb7401ddb..75ff0d119a4 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -63,7 +63,7 @@ static void checkARCPropertyDecl(Sema &S, ObjCPropertyDecl *property) { property->setInvalidDecl(); S.Diag(property->getLocation(), - diag::err_arc_inconsistent_property_lifetime) + diag::err_arc_inconsistent_property_ownership) << property->getDeclName() << selector << propertyLifetime; @@ -420,7 +420,7 @@ static void checkARCPropertyImpl(Sema &S, SourceLocation propertyImplLoc, case Qualifiers::OCL_ExplicitNone: case Qualifiers::OCL_Weak: - S.Diag(propertyImplLoc, diag::err_arc_strong_property_lifetime) + S.Diag(propertyImplLoc, diag::err_arc_strong_property_ownership) << property->getDeclName() << ivar->getDeclName() << ivarLifetime; @@ -463,7 +463,7 @@ static void checkARCPropertyImpl(Sema &S, SourceLocation propertyImplLoc, case Qualifiers::OCL_Weak: case Qualifiers::OCL_Strong: - S.Diag(propertyImplLoc, diag::err_arc_assign_property_lifetime) + S.Diag(propertyImplLoc, diag::err_arc_assign_property_ownership) << property->getDeclName() << ivar->getDeclName(); break; diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 944d4813183..7686080ff58 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -6805,7 +6805,7 @@ void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand, unsigned I) { } if (FromQs.getObjCLifetime() != ToQs.getObjCLifetime()) { - S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_lifetime) + S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_ownership) << (unsigned) FnKind << FnDesc << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index bfffb9e41bb..ea1086c8671 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -112,7 +112,7 @@ static void diagnoseBadTypeAttribute(Sema &S, const AttributeList &attr, // smallest available pointer type (i.e. 'void*' in 'void**'). #define OBJC_POINTER_TYPE_ATTRS_CASELIST \ case AttributeList::AT_objc_gc: \ - case AttributeList::AT_objc_lifetime + case AttributeList::AT_objc_ownership // Function type attributes. #define FUNCTION_TYPE_ATTRS_CASELIST \ @@ -297,15 +297,15 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state, static bool handleObjCGCTypeAttr(TypeProcessingState &state, AttributeList &attr, QualType &type); -static bool handleObjCLifetimeTypeAttr(TypeProcessingState &state, +static bool handleObjCOwnershipTypeAttr(TypeProcessingState &state, AttributeList &attr, QualType &type); static bool handleObjCPointerTypeAttr(TypeProcessingState &state, AttributeList &attr, QualType &type) { if (attr.getKind() == AttributeList::AT_objc_gc) return handleObjCGCTypeAttr(state, attr, type); - assert(attr.getKind() == AttributeList::AT_objc_lifetime); - return handleObjCLifetimeTypeAttr(state, attr, type); + assert(attr.getKind() == AttributeList::AT_objc_ownership); + return handleObjCOwnershipTypeAttr(state, attr, type); } /// Given that an objc_gc attribute was written somewhere on a @@ -1065,9 +1065,9 @@ static QualType inferARCLifetimeForPointee(Sema &S, QualType type, if (S.DelayedDiagnostics.shouldDelayDiagnostics()) { S.DelayedDiagnostics.add( sema::DelayedDiagnostic::makeForbiddenType(loc, - diag::err_arc_indirect_no_lifetime, type, isReference)); + diag::err_arc_indirect_no_ownership, type, isReference)); } else { - S.Diag(loc, diag::err_arc_indirect_no_lifetime) << type << isReference; + S.Diag(loc, diag::err_arc_indirect_no_ownership) << type << isReference; } implicitLifetime = Qualifiers::OCL_Autoreleasing; } @@ -1647,13 +1647,13 @@ static void inferARCWriteback(TypeProcessingState &state, chunk.Kind == DeclaratorChunk::BlockPointer); for (const AttributeList *attr = chunk.getAttrs(); attr; attr = attr->getNext()) - if (attr->getKind() == AttributeList::AT_objc_lifetime) + if (attr->getKind() == AttributeList::AT_objc_ownership) return; // If there wasn't one, add one (with an invalid source location // so that we don't make an AttributedType for it). AttributeList *attr = declarator.getAttributePool() - .create(&S.Context.Idents.get("objc_lifetime"), SourceLocation(), + .create(&S.Context.Idents.get("objc_ownership"), SourceLocation(), /*scope*/ 0, SourceLocation(), &S.Context.Idents.get("autoreleasing"), SourceLocation(), /*args*/ 0, 0, @@ -2474,8 +2474,8 @@ static AttributeList::Kind getAttrListKind(AttributedType::Kind kind) { return AttributeList::AT_neon_polyvector_type; case AttributedType::attr_objc_gc: return AttributeList::AT_objc_gc; - case AttributedType::attr_objc_lifetime: - return AttributeList::AT_objc_lifetime; + case AttributedType::attr_objc_ownership: + return AttributeList::AT_objc_ownership; case AttributedType::attr_noreturn: return AttributeList::AT_noreturn; case AttributedType::attr_cdecl: @@ -2962,11 +2962,11 @@ static void HandleAddressSpaceTypeAttribute(QualType &Type, Type = S.Context.getAddrSpaceQualType(Type, ASIdx); } -/// handleObjCLifetimeTypeAttr - Process an objc_lifetime +/// handleObjCOwnershipTypeAttr - Process an objc_ownership /// attribute on the specified type. /// /// Returns 'true' if the attribute was handled. -static bool handleObjCLifetimeTypeAttr(TypeProcessingState &state, +static bool handleObjCOwnershipTypeAttr(TypeProcessingState &state, AttributeList &attr, QualType &type) { if (!type->isObjCRetainableType() && !type->isDependentType()) @@ -2975,14 +2975,14 @@ static bool handleObjCLifetimeTypeAttr(TypeProcessingState &state, Sema &S = state.getSema(); if (type.getQualifiers().getObjCLifetime()) { - S.Diag(attr.getLoc(), diag::err_attr_objc_lifetime_redundant) + S.Diag(attr.getLoc(), diag::err_attr_objc_ownership_redundant) << type; return true; } if (!attr.getParameterName()) { S.Diag(attr.getLoc(), diag::err_attribute_argument_n_not_string) - << "objc_lifetime" << 1; + << "objc_ownership" << 1; attr.setInvalid(); return true; } @@ -2998,7 +2998,7 @@ static bool handleObjCLifetimeTypeAttr(TypeProcessingState &state, lifetime = Qualifiers::OCL_Autoreleasing; else { S.Diag(attr.getLoc(), diag::warn_attribute_type_not_supported) - << "objc_lifetime" << attr.getParameterName(); + << "objc_ownership" << attr.getParameterName(); attr.setInvalid(); return true; } @@ -3016,7 +3016,7 @@ static bool handleObjCLifetimeTypeAttr(TypeProcessingState &state, // If we have a valid source location for the attribute, use an // AttributedType instead. if (attr.getLoc().isValid()) - type = S.Context.getAttributedType(AttributedType::attr_objc_lifetime, + type = S.Context.getAttributedType(AttributedType::attr_objc_ownership, origType, type); // Forbid __weak if we don't have a runtime. diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index b8060277ed3..0d923d113a2 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -3197,7 +3197,7 @@ TreeTransform<Derived>::TransformQualifiedType(TypeLocBuilder &TLB, // Otherwise, complain about the addition of a qualifier to an // already-qualified type. SourceRange R = TLB.getTemporaryTypeLoc(Result).getSourceRange(); - SemaRef.Diag(R.getBegin(), diag::err_attr_objc_lifetime_redundant) + SemaRef.Diag(R.getBegin(), diag::err_attr_objc_ownership_redundant) << Result << R; Quals.removeObjCLifetime(); |