[LLVMdev] Is instruction using array

Tobias von Koch T.EdlerVonKoch at freescale.com
Fri Aug 17 07:19:02 PDT 2012


Hi Sunil,

On 17/08/12 15:05, sunil rathee wrote:
> I want to know that is there any way to find a given instruction is 
> using an array as operand?
>

You could check whether the operand is a getelementptr instruction. This 
would indicate either an array or structure access but you could 
distinguish those based on the type of the accessed value. If you want 
to link the access to a particular array and subscript in the original 
source code, you might want to hack Clang to add this as metadata on the 
instruction (assuming your IR comes from C/C++ code).

Tobias

-- 
Network & Multimedia Solutions Group
Freescale Semiconductor UK Ltd
Colvilles Road, East Kilbride, Glasgow G75 0TG, Scotland.
Company Registration Number: SC262720

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120817/69dd0f88/attachment.html>


More information about the llvm-dev mailing list