-
Book Overview & Buying
-
Table Of Contents
LLVM Essentials
By :
In LLVM, the getelementptr instruction is used to get the address of an element in an aggregate data structure. It only calculates the address and does not access the memory.
The first argument of the getelementptr instruction is a type used as the basis for calculating the address. The second argument is pointer or vector of pointers which act as base of the address - which in our array case will be a. The next arguments are the indices of the element to be accessed.
The Language reference (http://llvm.org/docs/LangRef.html#getelementptr-instruction) mentions important notes on getelementptr instruction as follows:
The first index always indexes the pointer value given as the first argument, the second index indexes a value of the type pointed to (not necessarily the value directly pointed to, since the first index can be non-zero), etc. The first type indexed into must be a pointer value, subsequent types can be arrays, vectors, and structs. Note that subsequent...
Change the font size
Change margin width
Change background colour