mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Implement replaceMachineCodeForFunction() for x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9204 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4ca7e53690
commit
9b8c2911d9
@ -142,3 +142,10 @@ bool X86TargetMachine::addPassesToJITCompile(FunctionPassManager &PM) {
|
||||
return false; // success!
|
||||
}
|
||||
|
||||
bool X86TargetMachine::replaceMachineCodeForFunction (void *Old, void *New) {
|
||||
char *OldByte = (char *) Old;
|
||||
*OldByte++ = 0xE9; // JMP
|
||||
unsigned *OldWord = (unsigned *) OldByte;
|
||||
*OldWord = (unsigned) New;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user