Several cleanups:
- rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect.
- add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time.
- move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64385 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index c96fec7..049aca5 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1019,8 +1019,8 @@
// Objective C++: We're able to convert between "id" and a pointer
// to any interface (in both directions).
- if ((FromIface && Context.isObjCIdType(ToPointeeType))
- || (ToIface && Context.isObjCIdType(FromPointeeType))) {
+ if ((FromIface && Context.isObjCIdStructType(ToPointeeType))
+ || (ToIface && Context.isObjCIdStructType(FromPointeeType))) {
ConvertedType = BuildSimilarlyQualifiedPointerType(FromTypePtr,
ToPointeeType,
ToType, Context);
@@ -1029,10 +1029,10 @@
// Objective C++: Allow conversions between the Objective-C "id" and
// "Class", in either direction.
- if ((Context.isObjCIdType(FromPointeeType) &&
- Context.isObjCClassType(ToPointeeType)) ||
- (Context.isObjCClassType(FromPointeeType) &&
- Context.isObjCIdType(ToPointeeType))) {
+ if ((Context.isObjCIdStructType(FromPointeeType) &&
+ Context.isObjCClassStructType(ToPointeeType)) ||
+ (Context.isObjCClassStructType(FromPointeeType) &&
+ Context.isObjCIdStructType(ToPointeeType))) {
ConvertedType = ToType;
return true;
}
@@ -1131,10 +1131,10 @@
// Objective-C++ conversions are always okay.
// FIXME: We should have a different class of conversions for
// the Objective-C++ implicit conversions.
- if (Context.isObjCIdType(FromPointeeType) ||
- Context.isObjCIdType(ToPointeeType) ||
- Context.isObjCClassType(FromPointeeType) ||
- Context.isObjCClassType(ToPointeeType))
+ if (Context.isObjCIdStructType(FromPointeeType) ||
+ Context.isObjCIdStructType(ToPointeeType) ||
+ Context.isObjCClassStructType(FromPointeeType) ||
+ Context.isObjCClassStructType(ToPointeeType))
return false;
if (FromPointeeType->isRecordType() &&