[cfe-commits] r125445 - in /cfe/trunk: include/clang/Sema/Overload.h include/clang/Sema/Sema.h lib/Sema/SemaExprCXX.cpp lib/Sema/SemaOverload.cpp test/CodeGenObjCXX/blocks.mm test/SemaCXX/block-call.cpp test/SemaObjCXX/blocks.mm
Fariborz Jahanian
fjahanian at apple.com
Sun Feb 13 12:07:47 PST 2011
On Feb 13, 2011, at 11:33 AM, John McCall wrote:
> On Feb 12, 2011, at 11:07 AM, Fariborz Jahanian wrote:
>> Author: fjahanian
>> Date: Sat Feb 12 13:07:46 2011
>> New Revision: 125445
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=125445&view=rev
>> Log:
>> Implement objective-c++'s block pointer type matching involving
>> types which are contravariance in argument types and covariance
>> in return types. // rdar://8979379.
>
> To add to Doug's comments:
>
>> + const FunctionProtoType *FromFunctionType
>> + = FromPointeeType->getAs<FunctionProtoType>();
>> + const FunctionProtoType *ToFunctionType
>> + = ToPointeeType->getAs<FunctionProtoType>();
>> +
>> + if (FromFunctionType && ToFunctionType) {
>
> You can use an early return here.
>
>> + if (Context.getCanonicalType(FromPointeeType)
>> + == Context.getCanonicalType(ToPointeeType))
>> + return true;
>> +
>> + // Perform the quick checks that will tell us whether these
>> + // function types are obviously different.
>> + if (FromFunctionType->getNumArgs() != ToFunctionType->getNumArgs() ||
>> + FromFunctionType->isVariadic() != ToFunctionType->isVariadic() ||
>> + FromFunctionType->getTypeQuals() != ToFunctionType->getTypeQuals())
>> + return false;
>
> You should bail out on an ExtInfo mismatch, too.
Thanks. In r125467 now. What does checking for ExtInfo accomplish beyond the other
checkings?
- Fariborz
>
> John.
More information about the cfe-commits
mailing list