[cfe-commits] r64989 - in /cfe/trunk: include/clang/AST/Type.h lib/Sema/SemaDecl.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Feb 18 16:22:47 PST 2009
Author: fjahanian
Date: Wed Feb 18 18:22:47 2009
New Revision: 64989
URL: http://llvm.org/viewvc/llvm-project?rev=64989&view=rev
Log:
Couple of helpers for objc's gc attributes.
No change in functionality.
Modified:
cfe/trunk/include/clang/AST/Type.h
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=64989&r1=64988&r2=64989&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Wed Feb 18 18:22:47 2009
@@ -195,6 +195,16 @@
/// GCAttrTypesAttr - Returns gc attribute of this type.
inline QualType::GCAttrTypes getObjCGCAttr() const;
+
+ /// isObjCGCWeak true when Type is objc's weak.
+ bool isObjCGCWeak() const {
+ return getObjCGCAttr() == Weak;
+ }
+
+ /// isObjCGCStrong true when Type is objc's strong.
+ bool isObjCGCStrong() const {
+ return getObjCGCAttr() == Strong;
+ }
/// Emit - Serialize a QualType to Bitcode.
void Emit(llvm::Serializer& S) const;
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=64989&r1=64988&r2=64989&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Feb 18 18:22:47 2009
@@ -3510,7 +3510,7 @@
}
ProcessDeclAttributes(NewFD, D);
- if (T.getObjCGCAttr() == QualType::Weak)
+ if (T.isObjCGCWeak())
Diag(Loc, diag::warn_attribute_weak_on_field);
if (D.getInvalidType() || InvalidDecl)
More information about the cfe-commits
mailing list