summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCJITInfo.cpp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-01-14 23:15:26 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-01-14 23:15:26 +0000
commit13c10c4e49109054281a8e2c074f8c901ab0404a (patch)
treee5c8b32261295e0762d466b7b942f22d42c48b03 /lib/Target/PowerPC/PPCJITInfo.cpp
parent83c20d3fb3a415c7e5c9a3c5ddcb47058ddd8388 (diff)
downloadllvm-13c10c4e49109054281a8e2c074f8c901ab0404a.tar.gz
llvm-13c10c4e49109054281a8e2c074f8c901ab0404a.tar.bz2
llvm-13c10c4e49109054281a8e2c074f8c901ab0404a.tar.xz
Teach PPC how to replaceMachineCodeForFunction correctly. (Fixes
JITTest.FunctionIsRecompiledAndRelinked.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCJITInfo.cpp')
-rw-r--r--lib/Target/PowerPC/PPCJITInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCJITInfo.cpp b/lib/Target/PowerPC/PPCJITInfo.cpp
index be6e51e0dd..daf4ec6d01 100644
--- a/lib/Target/PowerPC/PPCJITInfo.cpp
+++ b/lib/Target/PowerPC/PPCJITInfo.cpp
@@ -308,6 +308,7 @@ extern "C" void *PPCCompilationCallbackC(unsigned *StubCallAddrPlus4,
// Rewrite the stub with an unconditional branch to the target, for any users
// who took the address of the stub.
EmitBranchToAt((intptr_t)StubCallAddr, (intptr_t)Target, false, is64Bit);
+ sys::Memory::InvalidateInstructionCache(StubCallAddr, 7*4);
// Put the address of the target function to call and the address to return to
// after calling the target function in a place that is easy to get on the
@@ -441,4 +442,5 @@ void PPCJITInfo::relocate(void *Function, MachineRelocation *MR,
void PPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
EmitBranchToAt((intptr_t)Old, (intptr_t)New, false, is64Bit);
+ sys::Memory::InvalidateInstructionCache(Old, 7*4);
}