aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-07-15 18:40:39 +0000
committerSteve Naroff <snaroff@apple.com>2009-07-15 18:40:39 +0000
commitde2e22d33afec98324a66a358dfe0951b3c7259a (patch)
treed4bb699e42464c745d95b1d753e62a916d3415ed /lib/Sema/SemaOverload.cpp
parent92db2841691b2f2a99294872ead8887854297ed7 (diff)
Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).
This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-). This patch also adds Type::isObjCBuiltinType(). This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index bee3936048..35c5567503 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1011,15 +1011,9 @@ bool Sema::isObjCPointerConversion(QualType FromType, QualType ToType,
FromType->getAsObjCObjectPointerType();
if (ToObjCPtr && FromObjCPtr) {
- // Objective C++: We're able to convert between "id" and a pointer
- // to any interface (in both directions).
- if (ToObjCPtr->isObjCIdType() && FromObjCPtr->isObjCIdType()) {
- ConvertedType = ToType;
- return true;
- }
- // Objective C++: Allow conversions between the Objective-C "Class" and a
+ // Objective C++: We're able to convert between "id" or "Class" and a
// pointer to any interface (in both directions).
- if (ToObjCPtr->isObjCClassType() || FromObjCPtr->isObjCClassType()) {
+ if (ToObjCPtr->isObjCBuiltinType() && FromObjCPtr->isObjCBuiltinType()) {
ConvertedType = ToType;
return true;
}
@@ -1169,8 +1163,7 @@ bool Sema::CheckPointerConversion(Expr *From, QualType ToType) {
// Objective-C++ conversions are always okay.
// FIXME: We should have a different class of conversions for the
// Objective-C++ implicit conversions.
- if (FromPtrType->isObjCIdType() || ToPtrType->isObjCIdType() ||
- FromPtrType->isObjCClassType() || ToPtrType->isObjCClassType())
+ if (FromPtrType->isObjCBuiltinType() || ToPtrType->isObjCBuiltinType())
return false;
}