[llvm-commits] [llvm] r132613 - in /llvm/trunk: include/llvm/Analysis/BranchProbabilityInfo.h include/llvm/InitializePasses.h lib/Analysis/Analysis.cpp lib/Analysis/BranchProbabilityInfo.cpp lib/Analysis/CMakeLists.txt

Frits van Bommel fvbommel at gmail.com
Sat Jun 4 01:50:04 PDT 2011


On 4 June 2011 10:19, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> On Jun 4, 2011, at 12:56 AM, Frits van Bommel wrote:
>> Shouldn't you use 'uint32_t' instead of 'unsigned (int)' throughout
>> (and UINT32_MAX instead of UINT_MAX, etc.)?
>
> LLVM assumes that unsigned is 32 bits in *many* places. It won't work with
> any other int size.

Do they assume it's 32 bits, or that it's *at least* 32 bits? Note
that this code essentially assumes it's *exactly* 32 bits because its
results depend on the exact value of UINT_MAX.

But even if what you say is true, I don't consider that to be a good
excuse to contribute to the problem. And many places in LLVM use
(u)int32_t, too.

If nothing else, uint32_t is more self-documenting.



More information about the llvm-commits mailing list