Skip to content
Snippets Groups Projects
Commit 857c21b4 authored by Misha Brukman's avatar Misha Brukman
Browse files

* Tabs to spaces

* Doxygenified function comments
* Added FIXMEs to solicit documentation for other functions

llvm-svn: 9022
parent aa7d26c8
No related branches found
No related tags found
No related merge requests found
//===-- ExecutionEngine.cpp - Common Implementation shared by EE's --------===// //===-- ExecutionEngine.cpp - Common Implementation shared by EEs ---------===//
// //
// This file defines the common interface used by the various execution engine // This file defines the common interface used by the various execution engine
// subclasses. // subclasses.
...@@ -25,8 +25,10 @@ ExecutionEngine::~ExecutionEngine() { ...@@ -25,8 +25,10 @@ ExecutionEngine::~ExecutionEngine() {
delete &CurMod; delete &CurMod;
} }
ExecutionEngine *ExecutionEngine::create (Module *M, bool ForceInterpreter, /// FIXME: document
bool TraceMode) { ///
ExecutionEngine *ExecutionEngine::create(Module *M, bool ForceInterpreter,
bool TraceMode) {
ExecutionEngine *EE = 0; ExecutionEngine *EE = 0;
// If there is nothing that is forcing us to use the interpreter, make a JIT. // If there is nothing that is forcing us to use the interpreter, make a JIT.
...@@ -39,9 +41,9 @@ ExecutionEngine *ExecutionEngine::create (Module *M, bool ForceInterpreter, ...@@ -39,9 +41,9 @@ ExecutionEngine *ExecutionEngine::create (Module *M, bool ForceInterpreter,
return EE; return EE;
} }
// getPointerToGlobal - This returns the address of the specified global /// getPointerToGlobal - This returns the address of the specified global
// value. This may involve code generation if it's a function. /// value. This may involve code generation if it's a function.
// ///
void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) { void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) {
if (Function *F = const_cast<Function*>(dyn_cast<Function>(GV))) if (Function *F = const_cast<Function*>(dyn_cast<Function>(GV)))
return getPointerToFunction(F); return getPointerToFunction(F);
...@@ -50,6 +52,8 @@ void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) { ...@@ -50,6 +52,8 @@ void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) {
return GlobalAddress[GV]; return GlobalAddress[GV];
} }
/// FIXME: document
///
GenericValue ExecutionEngine::getConstantValue(const Constant *C) { GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
GenericValue Result; GenericValue Result;
...@@ -133,8 +137,10 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { ...@@ -133,8 +137,10 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
return Result; return Result;
} }
/// FIXME: document
///
void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr, void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr,
const Type *Ty) { const Type *Ty) {
if (getTargetData().isLittleEndian()) { if (getTargetData().isLittleEndian()) {
switch (Ty->getPrimitiveID()) { switch (Ty->getPrimitiveID()) {
case Type::BoolTyID: case Type::BoolTyID:
...@@ -204,6 +210,8 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr, ...@@ -204,6 +210,8 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr,
} }
} }
/// FIXME: document
///
GenericValue ExecutionEngine::LoadValueFromMemory(GenericValue *Ptr, GenericValue ExecutionEngine::LoadValueFromMemory(GenericValue *Ptr,
const Type *Ty) { const Type *Ty) {
GenericValue Result; GenericValue Result;
...@@ -338,7 +346,7 @@ void ExecutionEngine::emitGlobals() { ...@@ -338,7 +346,7 @@ void ExecutionEngine::emitGlobals() {
NumInitBytes += Size; NumInitBytes += Size;
DEBUG(std::cerr << "Global '" << I->getName() << "' -> " DEBUG(std::cerr << "Global '" << I->getName() << "' -> "
<< (void*)GlobalAddress[I] << "\n"); << (void*)GlobalAddress[I] << "\n");
} else { } else {
// External variable reference. Try to use the dynamic loader to // External variable reference. Try to use the dynamic loader to
// get a pointer to it. // get a pointer to it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment