search for: createaddfunction

Displaying 2 results from an estimated 2 matches for "createaddfunction".

2012 Sep 19
0
[LLVMdev] newbie question on getelementptr
...) produced i32 (i32, i32)*. However, I'm getting a "bus error" when trying to run the retrieved function using an ExecutionEngine (not sure if this is the proper way to run a function). Here is my code: // includes omitted using namespace llvm; using namespace std; static Function *CreateAddFunction(Module *module) { Function *func_add = cast<Function> ( module->getOrInsertFunction("add", Type::getInt32Ty(module->getContext()), Type::getInt32Ty(module->getContext()), Type::getInt32Ty(module-&gt...
2012 Sep 19
3
[LLVMdev] newbie question on getelementptr
Hi All, I'm new to LLVM and I'm having a coding problem. I'm creating a GlobalVariable that contains a StructType that contains a Function. The function returns i32 and takes two i32's. Here is my code: GlobalVariable* retrieved = module->getGlobalVariable("myGV"); ... Constant* result = ConstantExpr::getGetElementPtr(retrieved, indices); How do I get my Function