[LLVMdev] 32-bit indexes

Duncan Sands baldrick at free.fr
Tue Dec 4 08:38:56 PST 2007


Hi Jon,

> But array lengths must be 32-bit?

array types can have 64 bit lengths.  This is useful for modelling
all of memory as an array.

> I've just started using arrays here so maybe I'm doing something wrong but 
> attempting to allocate an array with a 64-bit length gives the error:
> 
> bench: Instructions.cpp:650: llvm::Value* getAISize(llvm::Value*): Assertion 
> `Amt->getType() == Type::Int32Ty && "Malloc/Allocation array size is not a 
> 32-bit integer!"' failed.

Ah, memory allocation!  I think you want to declare a very long array type and
then alloc one of them (rather than trying to alloc a large number of array
components).

Ciao,

Duncan.



More information about the llvm-dev mailing list