Hello! I failed to find answer in docs.
Duncan Sands
2010-Apr-20 11:02 UTC
[LLVMdev] Is alloca the only way to create a structure?
Hi lost,> I failed to find answer in docs.it's not clear what you mean by "create a structure": (1) you want a local stack variable of struct type. Then use AllocaInst. (2) you want a register of struct type. You can create these using the extractvalue and insertvalue instructions. (3) you want to allocate heap memory of struct type. Call malloc. (4) you want a global variable of struct type. Use GlobalVariable. Ciao, Duncan.
Maybe Matching Threads
- [LLVMdev] SIMD instructions and memory alignment on X86
- [LLVMdev] SIMD instructions and memory alignment on X86
- [LLVMdev] Determine whether a stored variable is local or global in the code of LLVM 2.7
- [LLVMdev] Determine whether a stored variable is local or global in the code of LLVM 2.7
- [LLVMdev] Missed optimisation opportunities?