Implement replaceMachineCodeForFunction() for x86.
authorBrian Gaeke <gaeke@uiuc.edu>
Fri, 17 Oct 2003 18:27:46 +0000 (18:27 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Fri, 17 Oct 2003 18:27:46 +0000 (18:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9204 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86TargetMachine.cpp

index dcc9beaf9d02bcd89cc73655a4d96695366bc57c..14af52099dd410f102368ec4bb5c1f82b306b3a9 100644 (file)
@@ -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;
+}