mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Move target specific code to target files. The new MachineCodeEmitter
class is actually target independent! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -36,22 +36,6 @@ void VM::setupPassManager() {
|
||||
}
|
||||
}
|
||||
|
||||
void *VM::resolveFunctionReference(void *RefAddr) {
|
||||
Function *F = FunctionRefs[RefAddr];
|
||||
assert(F && "Reference address not known!");
|
||||
|
||||
void *Addr = getPointerToFunction(F);
|
||||
assert(Addr && "Pointer to function unknown!");
|
||||
|
||||
FunctionRefs.erase(RefAddr);
|
||||
return Addr;
|
||||
}
|
||||
|
||||
const std::string &VM::getFunctionReferencedName(void *RefAddr) {
|
||||
assert(FunctionRefs[RefAddr] && "Function address unknown!");
|
||||
return FunctionRefs[RefAddr]->getName();
|
||||
}
|
||||
|
||||
/// getPointerToFunction - This method is used to get the address of the
|
||||
/// specified function, compiling it if neccesary.
|
||||
///
|
||||
@@ -63,12 +47,7 @@ void *VM::getPointerToFunction(const Function *F) {
|
||||
return Addr = getPointerToNamedFunction(F->getName());
|
||||
|
||||
static bool isAlreadyCodeGenerating = false;
|
||||
if (isAlreadyCodeGenerating) {
|
||||
// Generate a function stub instead of reentering...
|
||||
void *SAddr = emitStubForFunction(*F);
|
||||
assert(SAddr && "Target machine doesn't support function stub generation!");
|
||||
return SAddr;
|
||||
}
|
||||
assert(!isAlreadyCodeGenerating && "ERROR: RECURSIVE COMPILATION DETECTED!");
|
||||
|
||||
// FIXME: JIT all of the functions in the module. Eventually this will JIT
|
||||
// functions on demand. This has the effect of populating all of the
|
||||
|
Reference in New Issue
Block a user