[cfe-commits] r138238 - /cfe/trunk/include/clang/AST/DeclBase.h
Fariborz Jahanian
fjahanian at apple.com
Mon Aug 22 10:13:51 PDT 2011
Author: fjahanian
Date: Mon Aug 22 12:13:51 2011
New Revision: 138238
URL: http://llvm.org/viewvc/llvm-project?rev=138238&view=rev
Log:
objc- checking for objc decl context range is unreliable and
subject to change. Check for equality instead.
Modified:
cfe/trunk/include/clang/AST/DeclBase.h
Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=138238&r1=138237&r2=138238&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Mon Aug 22 12:13:51 2011
@@ -894,8 +894,15 @@
}
bool isObjCContainer() const {
- return (DeclKind >= (int)Decl::ObjCCategory &&
- DeclKind <= (int)Decl::ObjCProtocol);
+ switch (DeclKind) {
+ case Decl::ObjCCategory:
+ case Decl::ObjCCategoryImpl:
+ case Decl::ObjCImplementation:
+ case Decl::ObjCInterface:
+ case Decl::ObjCProtocol:
+ return true;
+ }
+ return false;
}
bool isFunctionOrMethod() const {
More information about the cfe-commits
mailing list