summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/AST/Type.h11
-rw-r--r--clang/lib/AST/ASTContext.cpp10
-rw-r--r--clang/test/CodeGenObjC/encode-test.m1
3 files changed, 9 insertions, 13 deletions
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index 5b09ef08ecf..349487f8794 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -2548,12 +2548,7 @@ public:
return getPointeeType()->isSpecificBuiltinType(BuiltinType::ObjCClass) &&
!Protocols.size();
}
-
- /// isObjCSelType - true for "SEL".
- bool isObjCSelType() const {
- return getPointeeType()->isSpecificBuiltinType(BuiltinType::ObjCSel);
- }
-
+
/// isObjCQualifiedIdType - true for "id <p>".
bool isObjCQualifiedIdType() const {
return getPointeeType()->isSpecificBuiltinType(BuiltinType::ObjCId) &&
@@ -2902,8 +2897,8 @@ inline bool Type::isObjCClassType() const {
return false;
}
inline bool Type::isObjCSelType() const {
- if (const ObjCObjectPointerType *OPT = getAs<ObjCObjectPointerType>())
- return OPT->isObjCSelType();
+ if (const PointerType *OPT = getAs<PointerType>())
+ return OPT->getPointeeType()->isSpecificBuiltinType(BuiltinType::ObjCSel);
return false;
}
inline bool Type::isObjCBuiltinType() const {
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 2579a6e8795..6c9ecf089b9 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3413,13 +3413,13 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
return;
}
- if (isObjCSelType(T)) {
- S += ':';
- return;
- }
-
if (const PointerType *PT = T->getAs<PointerType>()) {
+ if (PT->isObjCSelType()) {
+ S += ':';
+ return;
+ }
QualType PointeeTy = PT->getPointeeType();
+
bool isReadOnly = false;
// For historical/compatibility reasons, the read-only qualifier of the
// pointee gets emitted _before_ the '^'. The read-only qualifier of
diff --git a/clang/test/CodeGenObjC/encode-test.m b/clang/test/CodeGenObjC/encode-test.m
index 7aca79a8f38..db8470b6bb2 100644
--- a/clang/test/CodeGenObjC/encode-test.m
+++ b/clang/test/CodeGenObjC/encode-test.m
@@ -66,6 +66,7 @@ struct Innermost {
@interface Test
{
int ivar;
+ __attribute__((objc_gc(weak))) SEL selector;
}
-(void) test3: (Test* [3] [4])b ;
- (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3;
OpenPOWER on IntegriCloud