Displaying 4 results from an estimated 4 matches for "getmainfunct".
2005 Jan 08
0
[LLVMdev] Primer with LLVM
...that this isn't supported at this
time, so you will have to modify the ExecutionEngine
(llvm/lib/ExecutionEngine/* and llvm/lib/ExecutionEngine/JIT/*) to do
this.
> (6) Localize entry point (¿main?)
> (7) Execute it
llvm/tools/lli/lli.cpp ->
Function *Fn = MP->getModule()->getMainFunction();
if (!Fn) {
std::cerr << "'main' function not found in module.\n";
return -1;
}
// Run main...
int Result = EE->runFunctionAsMain(Fn, InputArgv, envp);
See
llvm/lib/ExecutionEngine/ExecutionEngine.cpp for runFunctionAsMain()
--
Mi...
2007 Mar 06
6
[LLVMdev] alloca & store generation
...t %argc, sbyte** %argv) {
entry:
alloca int ; <int*>:0 [#uses=1]
alloca sbyte** ; <sbyte***>:0 [#uses=1]
store int %argc, int* %0
store sbyte** %argv, sbyte*** %0
...
-----
I used the following code in my transformation:
-----
BasicBlock* eb = M.getMainFunction()->getEntryBlock();
Function::arg_iterator argc_it = mainfun->arg_begin();
Function::arg_iterator argv_it = argc_it;
++argv_it;
Argument* argc = &*argc_it;
Argument* argv = &*argv_it;
Instruction* insertNewInstsBefore = &eb->front();
AllocaInst* argc_all...
2007 Mar 06
0
[LLVMdev] alloca & store generation
...; <int*>:0 [#uses=1]
> alloca sbyte** ; <sbyte***>:0 [#uses=1]
> store int %argc, int* %0
> store sbyte** %argv, sbyte*** %0
> ...
> -----
>
> I used the following code in my transformation:
>
> -----
> BasicBlock* eb = M.getMainFunction()->getEntryBlock();
> Function::arg_iterator argc_it = mainfun->arg_begin();
> Function::arg_iterator argv_it = argc_it;
> ++argv_it;
> Argument* argc = &*argc_it;
> Argument* argv = &*argv_it;
> Instruction* insertNewInstsBefore = &eb->fr...
2005 Jan 08
3
[LLVMdev] Primer with LLVM
> >>> Would be great if we append into the documentation several "patters"
> >>> to show how perform with LLVM. It would accelerate the learn curve for
> >>> beginners like me, avoiding basic errors and mistakes. If I reach a
> >>> good level with LLVM I can make these.
> >>
> >> I'm not sure if I understand what you