[LLVMdev] Total size of global data

Scott Ricketts sricketts at maxentric.com
Tue Jul 21 13:02:32 PDT 2009


I wrote a pass that attempts to add up the total size of the global
data in a module. Currently, it iterates through all of the global
values and checks their type sizes using TargetData. I have realized
that this is not quite right because global values can point to the
same data in memory (or can at least overlap) as in the case of
constant strings.

Is there an easier way to approach this? It would be great if there
were some simple way to get the total size of global data. If there
is, please point me in the right direction. Otherwise I will need to
do some messy checking for duplicate addresses and overlapping data.

Thanks,
Scott



More information about the llvm-dev mailing list