Hi Richard,

On Mon, May 2, 2011 22:22, Richard Trieu wrote:
>> Index: lib/Sema/SemaStmt.cpp
>> ===================================================================
>> --- lib/Sema/SemaStmt.cpp        (revision 129825)
>> +++ lib/Sema/SemaStmt.cpp        (working copy)
>> @@ -1257,7 +1257,8 @@
>> ExprResult BoundExpr;
>> if (const ConstantArrayType *CAT = dyn_cast<ConstantArrayType>(UnqAT))
>> BoundExpr = Owned(IntegerLiteral::Create(Context, CAT->getSize(),
>> -                                                 Context.IntTy,
>> RangeLoc));
>> +
>> Context.getPointerDiffType(),
>> +                                                 RangeLoc));
>>
>> This should be the pointer difference type for the right address space.
>>  You could add an accessor to ASTContext to get the corresponding type
>> for the array's address space from the target info (perhaps
>> ASTContext::getArrayBoundType(QualType ArrayType)).
>
> I am not sure I understand.  I thought that there's only one pointer
> difference type?

In C and C++, there is, but TargetInfo provides the possibility of
different PtrDiffTypes for each address space. However, looking a little
deeper it seems that clang doesn't actually use those other types yet, so
I think your latest patch is fine for now. Feel free to check it in!

Thanks,
Richard


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to