forked from OSchip/llvm-project
Implement replaceMachineCodeForFunction() for x86.
llvm-svn: 9204
This commit is contained in:
parent
2e24fcadf5
commit
1a7668a9fd
|
@ -142,3 +142,10 @@ bool X86TargetMachine::addPassesToJITCompile(FunctionPassManager &PM) {
|
||||||
return false; // success!
|
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