[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
Mon P Wang
monping at apple.com
Mon Jun 23 18:04:33 PDT 2008
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?
-- Mon Ping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080623/eb88d1a8/attachment.html>
More information about the llvm-commits
mailing list