Executor/ExecutionEngine.cpp
/// run - Start execution with the specified function and arguments.
///
Start execution with the specified function and arguments.
Start execution with the specified function and arguments .
llvm::GenericValue
ExecutionEngine::runFunction(llvm::Function *F,
    const std::vector<llvm::GenericValue> &ArgValues) {
    TRACE_FUNC;
    ASSERTC (F && "Function *F was null at entry to run()");
    std::vector<llvm::GenericValue> ActualArgs = ArgValues;
    const unsigned ArgCount = F->getFunctionType()->getNumParams();
    while(ActualArgs.size() < ArgCount) {
        ActualArgs.push_back( Judicator->map(std::next(F->arg_begin(), ActualArgs.size())) );
    }
    callFunction(F, ActualArgs);
    run();
    return ExitValue;
}
llvm :: GenericValue ExecutionEngine :: runFunction ( llvm :: Function * F , const std :: vector < llvm :: GenericValue > & ArgValues ) { TRACE_FUNC ; ASSERTC ( F && " " ) ; std :: vector < llvm :: GenericValue > ActualArgs = ArgValues ; const unsigned ArgCount = F -> getFunctionType ( ) -> getNumParams ( ) ; while ( ActualArgs . size ( ) < ArgCount ) { ActualArgs . push_back ( Judicator -> map ( std :: next ( F -> arg_begin ( ) , ActualArgs . size ( ) ) ) ) ; } callFunction ( F , ActualArgs ) ; run ( ) ; return ExitValue ; }
run - Start execution with the specified function and arguments.
run - Start execution with the specified function and arguments .
// Try extra hard not to pass extra args to a function that isn't // expecting them.  C programmers frequently bend the rules and // declare main() with fewer parameters than it actually gets // passed, and the interpreter barfs if you pass a function more // parameters than it is declared to take. This does not attempt to // take into account gratuitous differences in declared types, // though. // Set up the function call. // Start executing the function.