Find size of memory pointer is pointing to

Date: Mon, 12 Nov 2012 10:58:40 +0100
From: Duncan Sands <baldrick@free.fr>
To: llvmdev@cs.uiuc.edu
Subject: Re: [LLVMdev] Find size of memory pointer is pointing to
Message-ID: <50A0C850.8050106@free.fr>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Sunil, you can do this using the routines in llvm/Analysis/MemoryBuiltins.h.

These routines are useful to identify memory allocation points and other memory objects. If you want to determine the size for an arbitrary pointer in a program, though, the harder problem is propagating the size information from the allocation to a place where a pointer is used. This requires a (simple) interprocedural dataflow analysis but will always be limited by imprecise call graphs and by context-dependent differences.

--Vikram