[LLVMdev] Type get size

Scott Ricketts sricketts at maxentric.com
Mon Jun 29 15:41:47 PDT 2009


I am trying to get the address ranges that are allocated by the global
variable list of a module. I cannot seem to find an easy way to get
the size of a global variable. That is, if the C source looks like:

int a[3];

then printing the description of the type of this global looks like:

[3 x i32]*

Is there some nice way to get "3 words" or "12 bytes" from the above
example? Let's assume I do some "isSized" check. It looks like there
is a getPrimitiveSizeInBits, but nothing for composite types. Maybe I
am missing something.

Thanks,
Scott



More information about the llvm-dev mailing list