Hi, guys. I'm a newbie to LLVM and have a very simple question.<div><br></div><div>Which instructions should I use (in terms of IRBuilder calls) to allocate an array of bytes in stack (alloca?), then to work with it (from a given offset) as with integer (bitcast?). I mean something like that:</div>
<div><br></div><div><div>unsigned char var[8];</div><div>unsigned int offset = 3;</div><div>int val = *(int*)(&var+offset); /* read */</div><div>*(int*)(&var+offset) = 12; /* write */</div></div><div><br></div><div>
Yes, I can convert the code above to assembly language using LLVM online demo, but how can I perform that programmatically using IRBuilder?</div><div><br></div><div>Are there some LLVM code examples less trivial than Kaleidoscope?</div>
<div><br></div><div>Thanks in advance.</div>