[LLVMdev] array of pointers

Ananth Durbha avdurbha at yahoo.com
Wed Mar 6 23:44:04 PST 2013


                              

The getInitializer() method of a GlobalVariable returns 4 pointers like below. 


[4 x i32*] [i32* getelementptr inbounds ([256 x i32]* @CRC24ATable, i32 0, i32 0), i32* getelementptr inbounds ([256 x i32]* @CRC24BTable, i32 0, i32 0), i32* getelementptr inbounds ([256 x i32]* @CRC16Table, i32 0, i32 0), i32* getelementptr inbounds ([256 x 

i32]* @CRC8Table, i32 0, i32 0)]


I can use getAggregateElement(uint) to access each of the 4 elements (pointers). But I am not able to figure out how to cast the element so that I can then access each of the GEP expressions and its operands. 
I tried dyn_cast return value of getAggregateElement(uint) into Instruction type - 
but that didn't yield a non-null conversion.

Thanks in advance for helping a noob!

-Ananth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130306/35671b53/attachment.html>


More information about the llvm-dev mailing list