mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Minor cleanups: wrap at 80 lines. Convert file comment to doxygen format and
llvm style git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8024 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
59da488266
commit
05a1a306bc
@ -11,8 +11,6 @@
|
|||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
|
||||||
#include "Config/stdlib.h"
|
|
||||||
|
|
||||||
// FIXME: REMOVE THIS
|
// FIXME: REMOVE THIS
|
||||||
#include "llvm/PassManager.h"
|
#include "llvm/PassManager.h"
|
||||||
|
|
||||||
@ -103,36 +101,29 @@ VM::VM(Module *M, TargetMachine *tm) : ExecutionEngine(M), TM(*tm) {
|
|||||||
emitGlobals();
|
emitGlobals();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/// VM::run - This method begins the execution of a program beginning at the
|
||||||
// Method: run()
|
/// specified function name. The function is called with the specified
|
||||||
//
|
/// arguments and array of environment variables (a la main()).
|
||||||
// Description:
|
///
|
||||||
// This method begins the execution of a program beginning at the
|
/// Inputs:
|
||||||
// specified function name. The function is called with the
|
/// FnName - The name of the function as a C++ string.
|
||||||
// specified arguments and array of environment variables (a la main()).
|
/// Args - A vector of C++ strings containing the arguments.
|
||||||
//
|
/// envp - An array of C strings containing the environment.
|
||||||
// Inputs:
|
///
|
||||||
// FnName - The name of the function as a C++ string.
|
/// Return value:
|
||||||
// Args - A vector of C++ strings containing the arguments.
|
/// 1 - An error occurred.
|
||||||
// envp - An array of C strings containing the environment.
|
/// Otherwise, the return value from the specified function is returned.
|
||||||
//
|
///
|
||||||
// Outputs:
|
int VM::run(const std::string &FnName, const std::vector<std::string> &Args,
|
||||||
// None.
|
const char **envp) {
|
||||||
//
|
|
||||||
// Return value:
|
|
||||||
// 1 - An error occurred.
|
|
||||||
// Otherwise, the return value from the specified function is returned.
|
|
||||||
//
|
|
||||||
int VM::run(const std::string &FnName,
|
|
||||||
const std::vector<std::string> &Args,
|
|
||||||
const char ** envp) {
|
|
||||||
Function *F = getModule().getNamedFunction(FnName);
|
Function *F = getModule().getNamedFunction(FnName);
|
||||||
if (F == 0) {
|
if (F == 0) {
|
||||||
std::cerr << "Could not find function '" << FnName << "' in module!\n";
|
std::cerr << "Could not find function '" << FnName << "' in module!\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int(*PF)(int, char**, const char**) = (int(*)(int, char**, const char**))getPointerToFunction(F);
|
int (*PF)(int, char**, const char**) =
|
||||||
|
(int(*)(int, char**, const char**))getPointerToFunction(F);
|
||||||
assert(PF != 0 && "Null pointer to function?");
|
assert(PF != 0 && "Null pointer to function?");
|
||||||
|
|
||||||
// Build an argv vector...
|
// Build an argv vector...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user