From: Brian Gaeke Date: Fri, 17 Oct 2003 18:27:46 +0000 (+0000) Subject: Implement replaceMachineCodeForFunction() for x86. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9b8c2911d9651179a62fea986a7346792a389d92;p=oota-llvm.git Implement replaceMachineCodeForFunction() for x86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9204 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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; +}