Type get size

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.


Ah, I needed some target-dependent stuff (TargetData) to make this work.