[llvm-commits] [llvm] r52149 - in /llvm/trunk: lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs utils/llvm.grm
Dan Gohman
gohman at apple.com
Mon Jun 23 18:19:36 PDT 2008
On Jun 23, 2008, at 6:04 PM, Mon P Wang wrote:
> Hi,
>
> On Jun 23, 2008, at 11:43 AM, Dan Gohman wrote:
>
>> On Jun 23, 2008, at 10:18 AM, Chris Lattner wrote:
>>> [Text Deleted]
>>>> +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Mon Jun 9 09:45:02
>>>> 2008
>>>> @@ -2505,6 +2499,80 @@
>>>> delete PTy; delete $2;
>>>> CHECK_FOR_ERROR
>>>> }
>>>> + | '[' ConstVector ']' { // Nonempty unsized arr
>>>> + const Type *ETy = (*$2)[0]->getType();
>>>> + int NumElements = $2->size();
>>>
>>> Please use uint64_t for NumElements.
>>
>> fixed.
>>>
>
> Quick question about the change. When the NumElements changed to
> uint64_t, we started
> to have code that looks like
> uint64_t NumElements = ATy->getNumElements();
> // Verify that we have the correct size...
> if (NumElements != -1 && NumElements != (int)$3->size())
>
> The code doesn't look quite right (though it is functionally
> correct) with int64_t with a value cast to int and a negative
> number. The compiler will also generating a warning because we are
> comparing signed and unsigned. Should we get rid of this warning by
> explicitly casting to uint64_t instead?
Hi Mon Ping,
I agree; thanks for pointing this out. I submitted r52664, which I
believe
fixes some minor problems, as well as the compiler warnings.
Dan
More information about the llvm-commits
mailing list