aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-13 17:21:33 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-13 17:21:33 +0000
commite289d81369914678db386f6aa86faf8f178e245d (patch)
tree5fb05e9bbab057038b28cf6e4e87696f1c8cc8de /lib/Sema/SemaObjCProperty.cpp
parent8c7f4bca64d5128311ce50449ae9d2048c2ffea4 (diff)
Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--lib/Sema/SemaObjCProperty.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 9f50dea233..fe5fc1a5a3 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -80,7 +80,7 @@ Decl *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
unsigned Attributes = ODS.getPropertyAttributes();
TypeSourceInfo *TSI = GetTypeForDeclarator(FD.D, S);
QualType T = TSI->getType();
- if ((getLangOptions().getGCMode() != LangOptions::NonGC &&
+ if ((getLangOptions().getGC() != LangOptions::NonGC &&
T.isObjCGCWeak()) ||
(getLangOptions().ObjCAutoRefCount &&
T.getObjCLifetime() == Qualifiers::OCL_Weak))
@@ -291,7 +291,7 @@ ObjCPropertyDecl *Sema::CreatePropertyDecl(Scope *S,
// Issue a warning if property is 'assign' as default and its object, which is
// gc'able conforms to NSCopying protocol
- if (getLangOptions().getGCMode() != LangOptions::NonGC &&
+ if (getLangOptions().getGC() != LangOptions::NonGC &&
isAssign && !(Attributes & ObjCDeclSpec::DQ_PR_assign))
if (const ObjCObjectPointerType *ObjPtrTy =
T->getAs<ObjCObjectPointerType>()) {
@@ -597,7 +597,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
if ((kind & ObjCPropertyDecl::OBJC_PR_weak) &&
!getLangOptions().ObjCAutoRefCount &&
- getLangOptions().getGCMode() != LangOptions::NonGC) {
+ getLangOptions().getGC() != LangOptions::NonGC) {
if (PropType.isObjCGCStrong()) {
Diag(PropertyLoc,
diag::err_gc_weak_property_strong_type);
@@ -655,7 +655,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
if (kind & ObjCPropertyDecl::OBJC_PR_weak &&
!getLangOptions().ObjCAutoRefCount &&
- getLangOptions().getGCMode() == LangOptions::NonGC) {
+ getLangOptions().getGC() == LangOptions::NonGC) {
Diag(PropertyLoc, diag::error_synthesize_weak_non_arc_or_gc);
Diag(property->getLocation(), diag::note_property_declare);
}
@@ -724,7 +724,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
}
// __weak is explicit. So it works on Canonical type.
if ((PropType.isObjCGCWeak() && !IvarType.isObjCGCWeak() &&
- getLangOptions().getGCMode() != LangOptions::NonGC)) {
+ getLangOptions().getGC() != LangOptions::NonGC)) {
Diag(PropertyLoc, diag::error_weak_property)
<< property->getDeclName() << Ivar->getDeclName();
Diag(Ivar->getLocation(), diag::note_ivar_decl);
@@ -733,7 +733,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
// Fall thru - see previous comment
if ((property->getType()->isObjCObjectPointerType() ||
PropType.isObjCGCStrong()) && IvarType.isObjCGCWeak() &&
- getLangOptions().getGCMode() != LangOptions::NonGC) {
+ getLangOptions().getGC() != LangOptions::NonGC) {
Diag(PropertyLoc, diag::error_strong_property)
<< property->getDeclName() << Ivar->getDeclName();
// Fall thru - see previous comment
@@ -1364,7 +1364,7 @@ void
Sema::AtomicPropertySetterGetterRules (ObjCImplDecl* IMPDecl,
ObjCContainerDecl* IDecl) {
// Rules apply in non-GC mode only
- if (getLangOptions().getGCMode() != LangOptions::NonGC)
+ if (getLangOptions().getGC() != LangOptions::NonGC)
return;
for (ObjCContainerDecl::prop_iterator I = IDecl->prop_begin(),
E = IDecl->prop_end();
@@ -1422,7 +1422,7 @@ Sema::AtomicPropertySetterGetterRules (ObjCImplDecl* IMPDecl,
}
void Sema::DiagnoseOwningPropertyGetterSynthesis(const ObjCImplementationDecl *D) {
- if (getLangOptions().getGCMode() == LangOptions::GCOnly)
+ if (getLangOptions().getGC() == LangOptions::GCOnly)
return;
for (ObjCImplementationDecl::propimpl_iterator
@@ -1739,11 +1739,11 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
PropertyDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
else {
// Skip this warning in gc-only mode.
- if (getLangOptions().getGCMode() != LangOptions::GCOnly)
+ if (getLangOptions().getGC() != LangOptions::GCOnly)
Diag(Loc, diag::warn_objc_property_no_assignment_attribute);
// If non-gc code warn that this is likely inappropriate.
- if (getLangOptions().getGCMode() == LangOptions::NonGC)
+ if (getLangOptions().getGC() == LangOptions::NonGC)
Diag(Loc, diag::warn_objc_property_default_assign_on_object);
}
@@ -1755,7 +1755,7 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
if (!(Attributes & ObjCDeclSpec::DQ_PR_copy)
&&!(Attributes & ObjCDeclSpec::DQ_PR_readonly)
- && getLangOptions().getGCMode() == LangOptions::GCOnly
+ && getLangOptions().getGC() == LangOptions::GCOnly
&& PropertyTy->isBlockPointerType())
Diag(Loc, diag::warn_objc_property_copy_missing_on_block);
}