From 9b8c2911d9651179a62fea986a7346792a389d92 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Fri, 17 Oct 2003 18:27:46 +0000 Subject: [PATCH] Implement replaceMachineCodeForFunction() for x86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9204 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86TargetMachine.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index dcc9beaf9d0..14af52099dd 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -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; +}