Displaying 2 results from an estimated 2 matches for "const_ptr_5".
2013 Sep 28
1
[LLVMdev] use function address as global variable initializer
Hi
I would like to initialize a global variable to the address of a function.
Looking at how clang compiles the C code below, i see @main_ptr = global
i8* bitcast (i32 ()* @main to i8*), align 8
but how do i generate i8* bitcast (i32 ()* @main to i8*), align 8 in LLVM
IR and use it as initializer to a GlobalVariable.
I know i will need to use the bitcast instruction. but as far i as i
2013 Aug 19
4
[LLVMdev] Generating GetElementPtr inlined in a function argument list programmatically
Hello LLVMDev List,
It's my first time sending a message to the List - I have been working on a tool for my research project using LLVM. Thanks for your awesome work!
I have come across some bytecode like the following with an GetElementPtr instruction in brackets:
Bytecode:%3 = call i32 @_Z4funcPKc(i8* getelementptr inbounds ([5 x i8]* @.str2, i32 0, i32 0))
C++ code:func("bleh");