aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/Type.h2
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td52
-rw-r--r--include/clang/Sema/AttributeList.h2
-rw-r--r--lib/ARCMigrate/TransProperties.cpp8
-rw-r--r--lib/AST/TypePrinter.cpp10
-rw-r--r--lib/Frontend/InitPreprocessor.cpp26
-rw-r--r--lib/Sema/AttributeList.cpp2
-rw-r--r--lib/Sema/JumpDiagnostics.cpp4
-rw-r--r--lib/Sema/SemaChecking.cpp2
-rw-r--r--lib/Sema/SemaDecl.cpp10
-rw-r--r--lib/Sema/SemaDeclAttr.cpp6
-rw-r--r--lib/Sema/SemaExpr.cpp4
-rw-r--r--lib/Sema/SemaExprCXX.cpp2
-rw-r--r--lib/Sema/SemaObjCProperty.cpp6
-rw-r--r--lib/Sema/SemaOverload.cpp2
-rw-r--r--lib/Sema/SemaType.cpp32
-rw-r--r--lib/Sema/TreeTransform.h2
-rw-r--r--test/ARCMT/checking.m4
-rw-r--r--test/SemaObjC/arc-decls.m12
-rw-r--r--test/SemaObjC/arc-non-pod-memaccess.m24
-rw-r--r--test/SemaObjC/arc-property-decl-attrs.m6
-rw-r--r--test/SemaObjC/arc-property-lifetime.m6
-rw-r--r--test/SemaObjC/arc-property.m2
-rw-r--r--test/SemaObjC/arc-system-header.m2
-rw-r--r--test/SemaObjC/arc-type-conversion.m2
-rw-r--r--test/SemaObjC/arc.m24
-rw-r--r--test/SemaObjCXX/arc-non-pod.mm4
-rw-r--r--test/SemaObjCXX/arc-object-init-destroy.mm2
-rw-r--r--test/SemaObjCXX/arc-overloading.mm14
-rw-r--r--test/SemaObjCXX/arc-system-header.mm2
-rw-r--r--test/SemaObjCXX/arc-type-conversion.mm14
-rw-r--r--test/SemaObjCXX/gc-attributes.mm4
32 files changed, 147 insertions, 147 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 1b57a0ff50..945d17f3eb 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -3152,7 +3152,7 @@ public:
// Enumerated operand (string or keyword).
attr_objc_gc,
- attr_objc_lifetime,
+ attr_objc_ownership,
attr_pcs,
FirstEnumOperandKind = attr_objc_gc,
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 84aac0c14f..bced5ee48a 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -1181,9 +1181,9 @@ def err_as_qualified_auto_decl : Error<
"automatic variable qualified with an address space">;
def err_arg_with_address_space : Error<
"parameter may not be qualified with an address space">;
-def err_attr_objc_lifetime_bad_type : Error<
+def err_attr_objc_ownership_bad_type : Error<
"the type %0 cannot be retained">;
-def err_attr_objc_lifetime_redundant : Error<
+def err_attr_objc_ownership_redundant : Error<
"the type %0 already has retainment attributes set on it">;
def err_attribute_not_string : Error<
"argument to %0 attribute was not a string literal">;
@@ -1603,8 +1603,8 @@ def note_ovl_candidate_bad_gc : Note<"candidate "
"function (the implicit move assignment operator)|"
"constructor (inherited)}0%1 not viable: "
"%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
- "lifetime, but parameter has %select{no|__weak|__strong}4 lifetime">;
-def note_ovl_candidate_bad_lifetime : Note<"candidate "
+ "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
+def note_ovl_candidate_bad_ownership : Note<"candidate "
"%select{function|function|constructor|"
"function |function |constructor |"
"constructor (the implicit default constructor)|"
@@ -1612,9 +1612,9 @@ def note_ovl_candidate_bad_lifetime : Note<"candidate "
"function (the implicit copy assignment operator)|"
"constructor (inherited)}0%1 not viable: "
"%select{%ordinal6|'this'}5 argument (%2) has "
- "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 lifetime,"
+ "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
" but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
- "__autoreleasing}4 lifetime">;
+ "__autoreleasing}4 ownership">;
def note_ovl_candidate_bad_cvr_this : Note<"candidate "
"%select{|function|||function||||"
"function (the implicit copy assignment operator)|}0 not viable: "
@@ -2498,7 +2498,7 @@ def note_protected_by_cxx_catch : Note<
"jump bypasses initialization of catch block">;
def note_protected_by___block : Note<
"jump bypasses setup of __block variable">;
-def note_protected_by_objc_lifetime : Note<
+def note_protected_by_objc_ownership : Note<
"jump bypasses initialization of retaining variable">;
def note_exits_cleanup : Note<
@@ -2521,7 +2521,7 @@ def note_exits_cxx_catch : Note<
"jump exits catch block">;
def note_exits_objc_autoreleasepool : Note<
"jump exits autoreleasepool block">;
-def note_exits_objc_lifetime : Note<
+def note_exits_objc_ownership : Note<
"jump exits scope of retaining variable">;
def err_func_returning_array_function : Error<
@@ -2608,22 +2608,22 @@ def warn_arc_trivial_member_function_with_object_member : Warning<
"code; add a non-trivial %select{copy constructor|copy assignment operator|"
"destructor}1 to make it ABI-compatible">,
InGroup<AutomaticReferenceCountingABI>, DefaultIgnore;
-def err_arc_new_array_without_lifetime : Error<
- "'new' cannot allocate an array of %0 with no explicit lifetime">;
+def err_arc_new_array_without_ownership : Error<
+ "'new' cannot allocate an array of %0 with no explicit ownership">;
def warn_err_new_delete_object_array : Warning<
"%select{allocating|destroying}0 an array of %1; this array must not "
"%select{be deleted in|have been allocated from}0 non-ARC code">,
InGroup<AutomaticReferenceCountingABI>, DefaultIgnore;
def err_arc_autoreleasing_var : Error<
"%select{__block variables|global variables|fields|ivars}0 cannot have "
- "__autoreleasing lifetime">;
-def err_arc_thread_lifetime : Error<
- "thread-local variable has non-trivial lifetime: type is %0">;
-def err_arc_indirect_no_lifetime : Error<
- "%select{pointer|reference}1 to non-const type %0 with no explicit lifetime">,
+ "__autoreleasing ownership">;
+def err_arc_thread_ownership : Error<
+ "thread-local variable has non-trivial ownership: type is %0">;
+def err_arc_indirect_no_ownership : Error<
+ "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">,
InGroup<AutomaticReferenceCounting>;
-def err_arc_array_param_no_lifetime : Error<
- "must explicitly describe intended lifetime of an object array parameter">;
+def err_arc_array_param_no_ownership : Error<
+ "must explicitly describe intended ownership of an object array parameter">;
def err_arc_pseudo_dtor_inconstant_quals : Error<
"pseudo-destructor destroys object of type %0 with inconsistently-qualified "
"type %1">;
@@ -2650,24 +2650,24 @@ def warn_arc_retain_cycle : Warning<
def note_arc_retain_cycle_owner : Note<
"block will be retained by %select{the captured object|an object strongly "
"retained by the captured object}0">;
-def note_nontrivial_objc_lifetime : Note<
+def note_nontrivial_objc_ownership : Note<
"because type %0 has %select{no|no|__strong|__weak|__autoreleasing}1 "
- "lifetime">;
+ "ownership">;
def warn_arc_object_memaccess : Warning<
"%select{destination for|source of}0 this %1 call is a pointer to "
- "lifetime-qualified type %2">, InGroup<ARCNonPodMemAccess>;
+ "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
-def err_arc_strong_property_lifetime : Error<
+def err_arc_strong_property_ownership : Error<
"existing ivar %1 for strong property %0 may not be "
"%select{|__unsafe_unretained||__weak}2">;
-def err_arc_assign_property_lifetime : Error<
+def err_arc_assign_property_ownership : Error<
"existing ivar %1 for unsafe_unretained property %0 must be __unsafe_unretained">;
-def err_arc_inconsistent_property_lifetime : Error<
+def err_arc_inconsistent_property_ownership : Error<
"%select{strong|weak|unsafe_unretained}1 property %0 may not also be "
"declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
-def err_arc_atomic_lifetime : Error<
+def err_arc_atomic_ownership : Error<
"cannot perform atomic operation on a pointer to type %0: type has "
- "non-trivial lifetime">;
+ "non-trivial ownership">;
def err_arc_bridge_cast_incompatible : Error<
"incompatible types casting %0 to %1 with a %select{__bridge|"
@@ -3541,7 +3541,7 @@ def err_typecheck_incompatible_address_space : Error<
"|sending %0 to parameter of type %1"
"|casting %0 to type %1}2"
" changes address space of pointer">;
-def err_typecheck_incompatible_lifetime : Error<
+def err_typecheck_incompatible_ownership : Error<
"%select{assigning %1 to %0"
"|passing %0 to parameter of type %1"
"|returning %0 from a function with result type %1"
diff --git a/include/clang/Sema/AttributeList.h b/include/clang/Sema/AttributeList.h
index a3122db3b3..597bda6894 100644
--- a/include/clang/Sema/AttributeList.h
+++ b/include/clang/Sema/AttributeList.h
@@ -206,7 +206,7 @@ public:
AT_ns_consumed, // Clang-specific.
AT_ns_consumes_self, // Clang-specific.
AT_objc_gc,
- AT_objc_lifetime, // Clang-specific.
+ AT_objc_ownership, // Clang-specific.
AT_objc_precise_lifetime, // Clang-specific.
AT_opencl_image_access, // OpenCL-specific.
AT_opencl_kernel_function, // OpenCL-specific.
diff --git a/lib/ARCMigrate/TransProperties.cpp b/lib/ARCMigrate/TransProperties.cpp
index 2122e03700..e0009ac241 100644
--- a/lib/ARCMigrate/TransProperties.cpp
+++ b/lib/ARCMigrate/TransProperties.cpp
@@ -116,7 +116,7 @@ public:
Transaction Trans(Pass.TA);
Pass.TA.insert(prop.IvarD->getLocation(), "__weak ");
- Pass.TA.clearDiagnostic(diag::err_arc_assign_property_lifetime,
+ Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
prop.ArcPropAssignErrorLoc);
}
@@ -126,7 +126,7 @@ public:
if (PI->ShouldChangeToWeak) {
Transaction Trans(Pass.TA);
Pass.TA.insert(PI->IvarD->getLocation(), "__unsafe_unretained ");
- Pass.TA.clearDiagnostic(diag::err_arc_assign_property_lifetime,
+ Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
PI->ArcPropAssignErrorLoc);
}
}
@@ -151,7 +151,7 @@ public:
!= Qualifiers::OCL_Strong)
return true;
if (!Pass.TA.hasDiagnostic(
- diag::err_arc_assign_property_lifetime, D->getLocation()))
+ diag::err_arc_assign_property_ownership, D->getLocation()))
return true;
// There is a "error: existing ivar for assign property must be
@@ -162,7 +162,7 @@ public:
Transaction Trans(Pass.TA);
Pass.TA.insert(ivarD->getLocation(), "__unsafe_unretained ");
Pass.TA.clearDiagnostic(
- diag::err_arc_assign_property_lifetime, D->getLocation());
+ diag::err_arc_assign_property_ownership, D->getLocation());
} else {
// Mark that we want the ivar to become weak.
unsigned loc = SM.getInstantiationLoc(propD->getAtLoc()).getRawEncoding();
diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp
index ccb456018d..b89d2aa316 100644
--- a/lib/AST/TypePrinter.cpp
+++ b/lib/AST/TypePrinter.cpp
@@ -845,9 +845,9 @@ void TypePrinter::printPackExpansion(const PackExpansionType *T,
void TypePrinter::printAttributed(const AttributedType *T,
std::string &S) {
- // Prefer the macro forms of the GC and lifetime qualifiers.
+ // Prefer the macro forms of the GC and ownership qualifiers.
if (T->getAttrKind() == AttributedType::attr_objc_gc ||
- T->getAttrKind() == AttributedType::attr_objc_lifetime)
+ T->getAttrKind() == AttributedType::attr_objc_ownership)
return print(T->getEquivalentType(), S);
print(T->getModifiedType(), S);
@@ -916,10 +916,10 @@ void TypePrinter::printAttributed(const AttributedType *T,
break;
}
- case AttributedType::attr_objc_lifetime:
- S += "objc_lifetime(";
+ case AttributedType::attr_objc_ownership:
+ S += "objc_ownership(";
switch (T->getEquivalentType().getObjCLifetime()) {
- case Qualifiers::OCL_None: llvm_unreachable("no lifetime!"); break;
+ case Qualifiers::OCL_None: llvm_unreachable("no ownership!"); break;
case Qualifiers::OCL_ExplicitNone: S += "none"; break;
case Qualifiers::OCL_Strong: S += "strong"; break;
case Qualifiers::OCL_Weak: S += "weak"; break;
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
index aefd1ea5b8..2276e16eb7 100644
--- a/lib/Frontend/InitPreprocessor.cpp
+++ b/lib/Frontend/InitPreprocessor.cpp
@@ -244,8 +244,8 @@ static void AddObjCXXARCLibcxxDefines(const LangOptions &LangOpts,
Out << "template <class _Tp>\n"
<< "inline __attribute__ ((__visibility__(\"hidden\"), "
<< "__always_inline__))\n"
- << "__attribute__((objc_lifetime(strong))) _Tp*\n"
- << "addressof(__attribute__((objc_lifetime(strong))) _Tp& __x) {\n"
+ << "__attribute__((objc_ownership(strong))) _Tp*\n"
+ << "addressof(__attribute__((objc_ownership(strong))) _Tp& __x) {\n"
<< " return &__x;\n"
<< "}\n"
<< "\n";
@@ -254,8 +254,8 @@ static void AddObjCXXARCLibcxxDefines(const LangOptions &LangOpts,
Out << "template <class _Tp>\n"
<< "inline __attribute__ ((__visibility__(\"hidden\"),"
<< "__always_inline__))\n"
- << "__attribute__((objc_lifetime(weak))) _Tp*\n"
- << "addressof(__attribute__((objc_lifetime(weak))) _Tp& __x) {\n"
+ << "__attribute__((objc_ownership(weak))) _Tp*\n"
+ << "addressof(__attribute__((objc_ownership(weak))) _Tp& __x) {\n"
<< " return &__x;\n"
<< "};\n"
<< "\n";
@@ -264,8 +264,8 @@ static void AddObjCXXARCLibcxxDefines(const LangOptions &LangOpts,
Out << "template <class _Tp>\n"
<< "inline __attribute__ ((__visibility__(\"hidden\"),"
<< "__always_inline__))\n"
- << "__attribute__((objc_lifetime(autoreleasing))) _Tp*\n"
- << "addressof(__attribute__((objc_lifetime(autoreleasing))) _Tp& __x) "
+ << "__attribute__((objc_ownership(autoreleasing))) _Tp*\n"
+ << "addressof(__attribute__((objc_ownership(autoreleasing))) _Tp& __x) "
<< "{\n"
<< " return &__x;\n"
<< "}\n"
@@ -312,7 +312,7 @@ static void AddObjCXXARCLibstdcxxDefines(const LangOptions &LangOpts,
<< "\n";
Out << "template<typename _Tp>\n"
- << "struct __is_scalar<__attribute__((objc_lifetime(strong))) _Tp> {\n"
+ << "struct __is_scalar<__attribute__((objc_ownership(strong))) _Tp> {\n"
<< " enum { __value = 0 };\n"
<< " typedef __false_type __type;\n"
<< "};\n"
@@ -320,7 +320,7 @@ static void AddObjCXXARCLibstdcxxDefines(const LangOptions &LangOpts,
if (!LangOpts.ObjCNoAutoRefCountRuntime) {
Out << "template<typename _Tp>\n"
- << "struct __is_scalar<__attribute__((objc_lifetime(weak))) _Tp> {\n"
+ << "struct __is_scalar<__attribute__((objc_ownership(weak))) _Tp> {\n"
<< " enum { __value = 0 };\n"
<< " typedef __false_type __type;\n"
<< "};\n"
@@ -328,7 +328,7 @@ static void AddObjCXXARCLibstdcxxDefines(const LangOptions &LangOpts,
}
Out << "template<typename _Tp>\n"
- << "struct __is_scalar<__attribute__((objc_lifetime(autoreleasing)))"
+ << "struct __is_scalar<__attribute__((objc_ownership(autoreleasing)))"
<< " _Tp> {\n"
<< " enum { __value = 0 };\n"
<< " typedef __false_type __type;\n"
@@ -614,12 +614,12 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__FAST_RELAXED_MATH__");
if (LangOpts.ObjCAutoRefCount) {
- Builder.defineMacro("__weak", "__attribute__((objc_lifetime(weak)))");
- Builder.defineMacro("__strong", "__attribute__((objc_lifetime(strong)))");
+ Builder.defineMacro("__weak", "__attribute__((objc_ownership(weak)))");
+ Builder.defineMacro("__strong", "__attribute__((objc_ownership(strong)))");
Builder.defineMacro("__autoreleasing",
- "__attribute__((objc_lifetime(autoreleasing)))");
+ "__attribute__((objc_ownership(autoreleasing)))");
Builder.defineMacro("__unsafe_unretained",
- "__attribute__((objc_lifetime(none)))");
+ "__attribute__((objc_ownership(none)))");
}
// Get other target #defines.
diff --git a/lib/Sema/AttributeList.cpp b/lib/Sema/AttributeList.cpp
index fda4e0ccd8..afc23e9be2 100644
--- a/lib/Sema/AttributeList.cpp
+++ b/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/lib/Sema/JumpDiagnostics.cpp b/lib/Sema/JumpDiagnostics.cpp
index 007d755a87..8cabc92285 100644
--- a/lib/Sema/JumpDiagnostics.cpp
+++ b/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/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 92da37bf23..6a09bf0e40 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/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/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 4a000e9fc2..adfc6f9501 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 4769b09264..1b358f4ca6 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/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/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index adc1331a9f..3fdfb63c10 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/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/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 0cd707e1f5..f8da76bf84 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/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/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 2dbb7401dd..75ff0d119a 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/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/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 944d481318..7686080ff5 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/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/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index bfffb9e41b..ea1086c867 100644
--- a/lib/Sema/SemaType.cpp
+++ b/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 {