search for: add1callres

Displaying 12 results from an estimated 12 matches for "add1callres".

2008 Aug 19
7
[LLVMdev] Please help with LLVM C++ integration
...GlobalMapping( my_function, (void*)&some_test_func ); Function *FooF = cast<Function>(M->getOrInsertFunction("foo", Type::Int32Ty, (Type *)0)); BasicBlock * BB = BasicBlock::Create("EntryBlock", FooF); Value *Ten = ConstantInt::get(Type::Int32Ty, 10); CallInst *Add1CallRes = CallInst::Create(my_function, Ten, "some_test_func", BB); Add1CallRes->setTailCall(true); ReturnInst::Create(Add1CallRes, BB); std::cout << "We just constructed this LLVM module:\n\n" << *M; std::cout << "\n\nRunning foo: " << std::fl...
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
...> > Function *FooF = cast<Function>(M->getOrInsertFunction("foo", > Type::Int32Ty, (Type *)0)); > BasicBlock * BB = BasicBlock::Create("EntryBlock", FooF); > Value *Ten = ConstantInt::get(Type::Int32Ty, 10); > CallInst *Add1CallRes = CallInst::Create(my_function, Ten, > "some_test_func", BB); > Add1CallRes->setTailCall(true); > > ReturnInst::Create(Add1CallRes, BB); > > std::cout << "We just constructed this LLVM module:\n\n" << *M; > std:...
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
...> > Function *FooF = cast<Function>(M->getOrInsertFunction("foo", > Type::Int32Ty, (Type *)0)); > BasicBlock * BB = BasicBlock::Create("EntryBlock", FooF); > Value *Ten = ConstantInt::get(Type::Int32Ty, 10); > CallInst *Add1CallRes = CallInst::Create(my_function, Ten, > "some_test_func", BB); > Add1CallRes->setTailCall(true); > > ReturnInst::Create(Add1CallRes, BB); > > std::cout << "We just constructed this LLVM module:\n\n" << *M; > std:...
2004 Aug 10
0
[LLVMdev] API on JIT, code snippets
...local/lib/vmcore.o /usr/local/lib/support.o -ltarget -export-dynamic -ldl (don't ask me why some modules are left as .o) Well. Compiled. Tested. Infinite loop in: GenericValue gv = EE->runFunction(FooF, noargs); you were really, really close, Reid, just a one mistake: < CallInst * Add1CallRes = new CallInst(FooF, Params, "foo", BB); > CallInst * Add1CallRes = new CallInst(Add1F, Params, "add1", BB); :-P > There is only one remaining item that I don't know how to do. After > ExecutionEngine::runFunction, you want to extract the result int value >...
2004 Aug 09
5
[LLVMdev] API on JIT, code snippets
...BasicBlock *BB = new BasicBlock("EntryBlock of add1 function", FooF); > > // Get pointers to the constant `10'... > Value *Ten = ConstantSInt::get(Type::IntTy, 10); > > // Put the argument Ten on stack and make call: > // ... > Instruction *Add1CallRes = 0; // FIXME!!! > > // Create the return instruction and add it to the basic block > BB->getInstList().push_back(new ReturnInst(Add1CallRes)); > > } > > // Now we going to create JIT ?? > // FIXME! > > > // compile M module ?? >...
2004 Aug 10
1
[LLVMdev] API on JIT, code snippets
...rget -export-dynamic -ldl > > (don't ask me why some modules are left as .o) > > Well. Compiled. Tested. Infinite loop in: > > GenericValue gv = EE->runFunction(FooF, noargs); > > you were really, really close, Reid, just a one mistake: > > < CallInst * Add1CallRes = new CallInst(FooF, Params, "foo", BB); > > > CallInst * Add1CallRes = new CallInst(Add1F, Params, "add1", BB); > > :-P > >> There is only one remaining item that I don't know how to do. After >> ExecutionEngine::runFunction, you want to e...
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
On Aug 19, 2008, at 13:36, kirill havok wrote: > I got very interested in LLVM project, and I decided to start > writing my own scripting language based on it. By studying the > documentation, I could not find how to call external function, > written in C. That is, I have a set of functions written in C/C++, I > generate code, using LLVM C++ interface, how can I call(or
2004 Aug 09
1
[LLVMdev] API on JIT, code snippets
...BasicBlock *BB = new BasicBlock("EntryBlock of add1 function", FooF); > > // Get pointers to the constant `10'... > Value *Ten = ConstantSInt::get(Type::IntTy, 10); > > // Put the argument Ten on stack and make call: > // ... > Instruction *Add1CallRes = 0; // FIXME!!! > > // Create the return instruction and add it to the basic block > BB->getInstList().push_back(new ReturnInst(Add1CallRes)); > > } > > // Now we going to create JIT ?? > // FIXME! > > > // compile M module ?? >...
2004 Aug 09
0
[LLVMdev] API on JIT, code snippets
...("EntryBlock of add1 function", FooF); > > > > // Get pointers to the constant `10'... > > Value *Ten = ConstantSInt::get(Type::IntTy, 10); > > > > // Put the argument Ten on stack and make call: > > // ... > > Instruction *Add1CallRes = 0; // FIXME!!! > > > > // Create the return instruction and add it to the basic block > > BB->getInstList().push_back(new ReturnInst(Add1CallRes)); > > > > } > > > > // Now we going to create JIT ?? > > // FIXME! > > > >...
2004 Aug 09
0
[LLVMdev] API on JIT, code snippets
Reid wrote: > I have to agree with Misha on this. None of us knows "everything" about > LLVM and as you can see, Misha responded three hours before I did :). > Asking questions here is encouraged, so please feel free to post them on > LLVMdev. We'll always help where we can. well, OK :) Please find the attachment with the first approach to such an example i've
2008 Aug 19
5
[LLVMdev] Please help with LLVM C++ integration
Hello, I got very interested in LLVM project, and I decided to start writing my own scripting language based on it. By studying the documentation, I could not find how to call external function, written in C. That is, I have a set of functions written in C/C++, I generate code, using LLVM C++ interface, how can I call(or register in machine in run-time) my external functions? Maybe I just missed
2004 Aug 09
3
[LLVMdev] API on JIT, code snippets
Valery, I have to agree with Misha on this. None of us knows "everything" about LLVM and as you can see, Misha responded three hours before I did :). Asking questions here is encouraged, so please feel free to post them on LLVMdev. We'll always help where we can. Thanks, Reid. On Mon, 2004-08-09 at 06:37, Misha Brukman wrote: > On Mon, Aug 09, 2004 at 12:32:33PM +0400, Valery