Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- PPCJITInfo.h - PowerPC impl. of the JIT interface -------*- C++ -*-===// |
Misha Brukman | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 2 | // |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 7 | // |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the PowerPC implementation of the TargetJITInfo class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Misha Brukman | e67a212 | 2004-08-11 00:11:25 +0000 | [diff] [blame] | 14 | #ifndef POWERPC_JITINFO_H |
| 15 | #define POWERPC_JITINFO_H |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 16 | |
Bruno Cardoso Lopes | a194c3a | 2009-05-30 20:51:52 +0000 | [diff] [blame] | 17 | #include "llvm/CodeGen/JITCodeEmitter.h" |
Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 18 | #include "llvm/Target/TargetJITInfo.h" |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
Evan Cheng | 2dd2c65 | 2006-03-13 23:20:37 +0000 | [diff] [blame] | 21 | class PPCTargetMachine; |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 22 | |
Nate Begeman | 6cca84e | 2005-10-16 05:39:50 +0000 | [diff] [blame] | 23 | class PPCJITInfo : public TargetJITInfo { |
Misha Brukman | e67a212 | 2004-08-11 00:11:25 +0000 | [diff] [blame] | 24 | protected: |
Evan Cheng | 2dd2c65 | 2006-03-13 23:20:37 +0000 | [diff] [blame] | 25 | PPCTargetMachine &TM; |
Nate Begeman | 18f0329 | 2006-08-29 02:30:59 +0000 | [diff] [blame] | 26 | bool is64Bit; |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 27 | public: |
Nate Begeman | 18f0329 | 2006-08-29 02:30:59 +0000 | [diff] [blame] | 28 | PPCJITInfo(PPCTargetMachine &tm, bool tmIs64Bit) : TM(tm) { |
| 29 | useGOT = 0; |
| 30 | is64Bit = tmIs64Bit; |
| 31 | } |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 32 | |
Jeffrey Yasskin | f2ad571 | 2009-11-23 23:35:19 +0000 | [diff] [blame] | 33 | virtual StubLayout getStubLayout(); |
Nicolas Geoffray | a7557df | 2008-04-16 20:46:05 +0000 | [diff] [blame] | 34 | virtual void *emitFunctionStub(const Function* F, void *Fn, |
Bruno Cardoso Lopes | a194c3a | 2009-05-30 20:51:52 +0000 | [diff] [blame] | 35 | JITCodeEmitter &JCE); |
Chris Lattner | 0aa794b | 2005-10-14 23:53:41 +0000 | [diff] [blame] | 36 | virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); |
| 37 | virtual void relocate(void *Function, MachineRelocation *MR, |
| 38 | unsigned NumRelocs, unsigned char* GOTBase); |
| 39 | |
| 40 | /// replaceMachineCodeForFunction - Make it so that calling the function |
| 41 | /// whose machine code is at OLD turns into a call to NEW, perhaps by |
| 42 | /// overwriting OLD with a branch to NEW. This is used for self-modifying |
| 43 | /// code. |
| 44 | /// |
| 45 | virtual void replaceMachineCodeForFunction(void *Old, void *New); |
| 46 | }; |
Misha Brukman | e05203f | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | #endif |